Exemplo n.º 1
0
void Aggregates_ShowPopupMenu (HWND hList, POINT ptList, POINT ptScreen)
{
   if (!ptScreen.x && !ptScreen.y)
      {
      RECT rWindow;
      GetWindowRect (hList, &rWindow);
      ptScreen.x = rWindow.left + (rWindow.right -rWindow.left)/2;
      ptScreen.y = rWindow.top + (rWindow.bottom -rWindow.top)/2;
      Aggregates_ShowParticularPopupMenu (hList, ptScreen, NULL);
      }
   else if (FL_HitTestForHeaderBar (hList, ptList))
      {
      HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS);
      DisplayContextMenu (hm, ptScreen, hList);
      }
   else
      {
      LPIDENT lpiSelected = NULL;

      HLISTITEM hItem;
      if ((hItem = FastList_ItemFromPoint (hList, &ptList, TRUE)) != NULL)
         lpiSelected = (LPIDENT)FastList_GetItemParam (hList, hItem);

      if (lpiSelected && (lpiSelected != (LPIDENT)FL_GetSelectedData (hList)))
         lpiSelected = NULL;

      if (lpiSelected && lpiSelected->fIsServer())
         Server_ShowParticularPopupMenu (hList, ptScreen, lpiSelected);
      else
         Aggregates_ShowParticularPopupMenu (hList, ptScreen, lpiSelected);
      }
}
Exemplo n.º 2
0
void Aggregates_ShowParticularPopupMenu (HWND hParent, POINT ptScreen, LPIDENT lpiAggregate)
{
   HMENU hm;

   if (lpiAggregate == NULL)
      hm = TaLocale_LoadMenu (MENU_AGG_NONE);
   else
      hm = TaLocale_LoadMenu (MENU_AGG);

   if (hm != NULL)
      {
      if (lpiAggregate == NULL)
         {
         HMENU hmView = GetSubMenu (hm, 0);

         CheckMenuRadioItem (hmView,
                             M_VIEW_ONEICON, M_VIEW_STATUS,
                             (gr.ivAgg == ivTWOICONS) ? M_VIEW_TWOICONS :
                             (gr.ivAgg == ivONEICON)  ? M_VIEW_ONEICON : M_VIEW_STATUS,
                             MF_BYCOMMAND);
         }

      DisplayContextMenu (hm, ptScreen, hParent);
      }
}
/* ************************************
* BOOL OnRclickTree(NMHDR* pNMHDR)
* 功能	在窗口被右键单击后调用,用于显示右键菜单
*			判断是否在Tree View节点上单击,并计算鼠标位置
* 参数	pNMHDR,WM_NOTITY 消息的 lParam
* 返回值	是否单击了节点
**************************************/
BOOL OnRclickTree(NMHDR* pNMHDR)
{
	POINT point;
	TVHITTESTINFO thti;
	HTREEITEM htItem;

	// 获取鼠标的位置
	GetCursorPos(&point);

	// 计算相对Client的鼠标位置,
	// TreeView_HitTest要求的鼠标位置是相对于Client
	ScreenToClient(hwndTreeView,&point);
	// 填充TVHITTESTINFO结构
	thti.pt = point;
	thti.flags = TVHT_TORIGHT;

	// TreeView_HitTest测试是否点击的了节点,获取被点击节点的句柄
	htItem =TreeView_HitTest(hwndTreeView,&thti);

	// 也可以根据节点属性的不同来弹出不同的右键菜单
	// TreeView_GetItem等函数可以用于获取TVITEM结构中的各个字段
	// 用户可以设置lParam字段来保存与节点相关的附加信息
	if(htItem!=NULL)
	{
		// DisplayContextMenu函数要求的鼠标位置是相对于屏幕的
		ClientToScreen(hwndTreeView,&point);
		// 选中用户右击的节点,否则Tree View中被选中的节点不会改变
		TreeView_SelectItem(hwndTreeView,htItem);
		// 调用DisplayContextMenu函数显示右键菜单
		DisplayContextMenu(hwndMain, point);
		return TRUE;
	}
	return FALSE;
}
void CEditTreeCtrl::OnRclick(NMHDR* pNMHDR, LRESULT* pResult) 
{
	*pResult = 1;
	UINT flags;
	CPoint point;
	GetCursorPos(&point);
	ScreenToClient(&point);
	HTREEITEM hItem = HitTest(point, &flags);
	if(hItem && (flags & TVHT_ONITEM) && !(flags & TVHT_ONITEMRIGHT))
		SelectItem(hItem);
	ClientToScreen(&point);
	DisplayContextMenu(point);
}
Exemplo n.º 5
0
void Filesets_OnEndTask_DragMenu (HWND hDlg, LPTASKPACKET ptp)
{
   HMENU hm = TaLocale_LoadMenu (MENU_SET_DRAGDROP);

   if (!ptp->rc)
      EnableMenu (hm, M_SET_MOVEHERE, FALSE);

   if (!ptp->rc || (TASKDATA(ptp)->fs.Type != ftREADWRITE))
      EnableMenu (hm, M_SET_REPHERE, FALSE);

   DisplayContextMenu (hm, TASKDATA(ptp)->mt.ptScreen, TASKDATA(ptp)->mt.hParent);
   Filesets_CancelDrag (hDlg);
}
Exemplo n.º 6
0
void Services_OnEndTask_Menu (LPTASKPACKET ptp)
{
   HMENU hm;
   if (!TASKDATA(ptp)->mt.lpi)
      hm = TaLocale_LoadMenu (MENU_SVC_NONE);
   else
      {
      TCHAR szName[ cchRESOURCE ];
      TASKDATA(ptp)->mt.lpi->GetServiceName (szName);
      if (!lstrcmpi (szName, TEXT("BOS")))
         hm = TaLocale_LoadMenu (MENU_SVC_BOS);
      else
         hm = TaLocale_LoadMenu (MENU_SVC);
      }

   if (hm != NULL)
      {
      if (TASKDATA(ptp)->mt.lpi == NULL)
         {
         HMENU hmView = GetSubMenu (hm, 0);

         CheckMenuRadioItem (hmView,
                             M_VIEW_ONEICON, M_VIEW_STATUS,
                             (gr.ivSvc == ivTWOICONS) ? M_VIEW_TWOICONS :
                             (gr.ivSvc == ivONEICON)  ? M_VIEW_ONEICON : M_VIEW_STATUS,
                             MF_BYCOMMAND);
         }
      else // (TASKDATA(ptp)->mt.lpi)
         {
         if (!ptp->rc)
            {
            EnableMenu (hm, M_SVC_START,   FALSE);
            EnableMenu (hm, M_SVC_STOP,    FALSE);
            EnableMenu (hm, M_SVC_RESTART, FALSE);
            }
         else
            {
            if (TASKDATA(ptp)->cs.state != SERVICESTATE_STOPPED)
               EnableMenu (hm, M_SVC_START, FALSE);
            else if (TASKDATA(ptp)->cs.state != SERVICESTATE_RUNNING)
               EnableMenu (hm, M_SVC_STOP, FALSE);
            }
         }

      DisplayContextMenu (hm, TASKDATA(ptp)->mt.ptScreen, TASKDATA(ptp)->mt.hParent);
      }
}
Exemplo n.º 7
0
void Filesets_ShowPopupMenu (HWND hList, POINT ptList, POINT ptScreen)
{
   if (!ptScreen.x && !ptScreen.y)
      {
      RECT rWindow;
      GetWindowRect (hList, &rWindow);
      ptScreen.x = rWindow.left + (rWindow.right -rWindow.left)/2;
      ptScreen.y = rWindow.top + (rWindow.bottom -rWindow.top)/2;
      Filesets_ShowParticularPopupMenu (hList, ptScreen, NULL);
      }
   else if (FL_HitTestForHeaderBar (hList, ptList))
      {
      HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS);
      DisplayContextMenu (hm, ptScreen, hList);
      }
   else
      {
      LPIDENT lpi = Filesets_GetFocused (GetParent (hList), &ptList);
      if (lpi && (lpi != Filesets_GetSelected (GetParent (hList))))
         {
         lpi = NULL; // right-click on item other than highlighted one?
         }

      if (lpi && lpi->fIsFileset())
         {
         Filesets_ShowParticularPopupMenu (hList, ptScreen, lpi);
         }
      else if (lpi && lpi->fIsAggregate())
         {
         Aggregates_ShowParticularPopupMenu (hList, ptScreen, lpi);
         }
      else if (lpi && lpi->fIsServer())
         {
         Server_ShowParticularPopupMenu (hList, ptScreen, lpi);
         }
      else if (!lpi) // display the _NONE menu? (no menu if it's a cell ident)
         {
         Filesets_ShowParticularPopupMenu (hList, ptScreen, lpi);
         }
      }
}
void CEditTreeCtrl::OnContextMenu(CWnd* pWnd, CPoint point) 
{
	DisplayContextMenu(point);
}
Exemplo n.º 9
0
// Procedures principales du launcher
LRESULT CALLBACK Launcher_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
	int ResShell ;
	
	switch( uMsg ) {
		case WM_CREATE:
		MenuLauncher = InitLauncherMenu( "Launcher" ) ;
        
	// Initialisation de la structure NOTIFYICONDATA
	TrayIcone.cbSize = sizeof(TrayIcone);	// On alloue la taille nécessaire pour la structure
	TrayIcone.uID = IDI_PUTTY_LAUNCH ;	// On lui donne un ID
	TrayIcone.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE;	// On lui indique les champs valables
	// On lui dit qu'il devra "écouter" son environement (clique de souris, etc)
	TrayIcone.uCallbackMessage = KLWM_NOTIFYICON;
	TrayIcone.hIcon = LoadIcon((HINSTANCE) GetModuleHandle (NULL), MAKEINTRESOURCE(IDI_PUTTY_LAUNCH));
#ifdef FDJ
	TrayIcone.szTip[1024] = (TCHAR*)"PuTTY\0" ;			// Le tooltip par défaut, soit rien
#else
	//TrayIcone.szTip[1024] = "KiTTY That\'s all folks!\0" ;			// Le tooltip par défaut, soit rien
	strcpy( TrayIcone.szTip, "KiTTY That\'s all folks!\0" ) ;			// Le tooltip par défaut, soit rien
#endif
	TrayIcone.hWnd = hwnd ;
	ResShell = Shell_NotifyIcon(NIM_ADD, &TrayIcone);
	if( ResShell ) {
#ifdef FDJ
		strcpy( TrayIcone.szTip, "PuTTY\0" ) ;
#else
		strcpy( TrayIcone.szTip, "KiTTY That\'s all folks!\0" ) ;
#endif
		ResShell = Shell_NotifyIcon(NIM_MODIFY, &TrayIcone);
		if (IsWindowVisible(hwnd)) ShowWindow(hwnd, SW_HIDE);
		//SendMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
		return 1 ;
		}
	else return 0 ;
			break ;
	
		case KLWM_NOTIFYICON :
			switch (lParam)	{
				/*
				case WM_LBUTTONDBLCLK : 
					ShowWindow(hwnd, SW_SHOWNORMAL);
					SetForegroundWindow( hwnd ) ;
					int ResShell;
					ResShell = Shell_NotifyIcon(NIM_DELETE, &TrayIcone);
					if( ResShell ) return 1 ;
					else return 0 ;
				break ;
				*/
				case WM_RBUTTONUP:
					{
					if (wParam == IDI_PUTTY_LAUNCH) {
						RefreshMenuLauncher() ;
						DisplayContextMenu( hwnd, HideMenu ) ;
						}
					}
				break ;
				case WM_LBUTTONUP: 
					{
					if (wParam == IDI_PUTTY_LAUNCH) {
						RefreshMenuLauncher() ;
						DisplayContextMenu( hwnd, MenuLauncher ) ;
						}
					}
				break ;
				}
			break ;
	
		case WM_DESTROY: 
			ManageUnHideAll( hwnd ) ;
			PostQuitMessage( 0 ) ;
			break ;
		case WM_CLOSE:
			PostMessage(hwnd, WM_DESTROY,0,0) ;
			break ;
		case WM_COMMAND: {//Commandes du menu
			switch( LOWORD(wParam) ) {
				case IDM_ABOUT:
					MessageBox(hwnd,"     TTY Launcher\nSession launcher for TTY terminal emulator\n(c), 2009-2015","About", MB_OK ) ;
					break ;
				case IDM_QUIT:
					ResShell = Shell_NotifyIcon(NIM_DELETE, &TrayIcone) ;
					ManageUnHideAll( hwnd ) ;
					PostQuitMessage( 0 ) ;
					break ;
				case IDM_LAUNCHER:
					DestroyMenu( MenuLauncher ) ; 
					MenuLauncher = NULL ;
					MenuLauncher = InitLauncherMenu( "Launcher" ) ;
					Shell_NotifyIcon(NIM_DELETE, &TrayIcone);
					Shell_NotifyIcon(NIM_ADD, &TrayIcone);
					Shell_NotifyIcon(NIM_MODIFY, &TrayIcone);
					break ;
				case IDM_LAUNCHER+1:
					RunPuTTY( hwnd, "" ) ;
					break ;
				case IDM_LAUNCHER+2:
					RunPuTTY( hwnd, "-ed" ) ;
					break ;
				case IDM_LAUNCHER+3:
					ManageHideAll( hwnd ) ;
					RefreshMenuLauncher() ;
					break ;
				case IDM_LAUNCHER+4:
					ManageUnHideAll( hwnd ) ;
					RefreshMenuLauncher() ;
					break ;
				case IDM_LAUNCHER+5:
					RefreshMenuLauncher() ;
					break ;
				case IDM_LAUNCHER+6:
					IsUnique = abs( IsUnique -1 ) ;
					RefreshMenuLauncher() ;
					break ;
				case IDM_LAUNCHER+7:
					if( LauncherConfReload ) InitLauncherRegistry() ;
					RefreshMenuLauncher() ;
					break ;
				case IDM_GONEXT:
					ManageGoNext( hwnd ) ;
					break ;
				case IDM_GOPREVIOUS:
					ManageGoPrevious( hwnd ) ;
					break ;
				}
				int nb ;
				nb = LOWORD(wParam)-IDM_USERCMD ;
				if( ( nb >= 0 ) && ( nb<NB_MENU_MAX ) ) {
					if( SpecialMenu[nb]!= NULL )
					//if( strlen( SpecialMenu[nb] ) > 0 ) 
						{
						if( DirectoryBrowseFlag ) {
							char buffer[1024]="" ;
							GetMenuString( MenuLauncher, nb+IDM_USERCMD, buffer, 1024, MF_BYCOMMAND ) ;
							RunSession( hwnd, SpecialMenu[nb], buffer ) ;
							}
						else RunSession( hwnd, SpecialMenu[nb], SpecialMenu[nb] ) ;
						RefreshMenuLauncher() ;
						}
					break ;
					}
				nb = LOWORD(wParam)-IDM_GOHIDE ;
				if( ( nb >= 0 ) && ( nb<100 ) ) {
					if( !IsUnique )	ManageSwitch( nb ) ;
					else { 
						ManageHideAll( hwnd ) ; 
						ManageUnHideOne( TabWin[nb].hwnd ) ;
						}
					RefreshMenuLauncher() ;
					break ;
					}
				}
			break ;
		default: // Message par défaut
			return DefWindowProc(hwnd, uMsg, wParam, lParam);
		}
	return -1 ;
	}
Exemplo n.º 10
0
void Filesets_OnEndTask_Menu (HWND hDlg, LPTASKPACKET ptp)
{
   LPIDENT lpiFileset = (LPIDENT)(TASKDATA(ptp)->mt.lpi);

   HMENU hm;
   if (lpiFileset != NULL)
      hm = TaLocale_LoadMenu (MENU_SET);
   else
      hm = TaLocale_LoadMenu (MENU_SET_NONE);

   if (hm != NULL)
      {
      if (lpiFileset == NULL)
         {
         HMENU hmView = GetSubMenu (hm, 0);
         DWORD dwStyle = GetWindowLong (TASKDATA(ptp)->mt.hParent, GWL_STYLE);

         CheckMenuRadioItem (hmView,
                             M_SET_VIEW_REPORT, M_SET_VIEW_TREE,
                             ((dwStyle & FLS_VIEW_MASK) == FLS_VIEW_TREELIST) ? M_SET_VIEW_TREELIST :
                             ((dwStyle & FLS_VIEW_MASK) == FLS_VIEW_TREE)     ? M_SET_VIEW_TREE : M_SET_VIEW_REPORT,
                             MF_BYCOMMAND);

         CheckMenuRadioItem (hmView,
                             M_VIEW_ONEICON, M_VIEW_STATUS,
                             (gr.ivSet == ivTWOICONS) ? M_VIEW_TWOICONS :
                             (gr.ivSet == ivONEICON)  ? M_VIEW_ONEICON : M_VIEW_STATUS,
                             MF_BYCOMMAND);
         }
      else
         {
         if (!ptp->rc)
            {
            EnableMenu (hm, M_SET_REPLICATION, FALSE);
            EnableMenu (hm, M_SET_SETQUOTA,    FALSE);
            EnableMenu (hm, M_SET_RELEASE,     FALSE);
            EnableMenu (hm, M_SET_CLONE,       FALSE);
            EnableMenu (hm, M_SET_MOVETO,      FALSE);
            EnableMenu (hm, M_SET_DUMP,        FALSE);
            EnableMenu (hm, M_SET_RESTORE,     FALSE);
            }
         else
            {
            if (TASKDATA(ptp)->fs.Type == ftCLONE)
               {
               EnableMenu (hm, M_SET_REPLICATION, FALSE);
               EnableMenu (hm, M_SET_RELEASE,     FALSE);
               EnableMenu (hm, M_SET_CLONE,       FALSE);
               EnableMenu (hm, M_SET_MOVETO,      FALSE);
               }

            if (TASKDATA(ptp)->fs.Type != ftREADWRITE)
               {
               EnableMenu (hm, M_SET_CLONE, FALSE);
               EnableMenu (hm, M_SET_RELEASE, FALSE);
               EnableMenu (hm, M_SET_SETQUOTA, FALSE);
               EnableMenu (hm, M_SET_RESTORE, FALSE);
               }
            }
         }

      DisplayContextMenu (hm, TASKDATA(ptp)->mt.ptScreen, TASKDATA(ptp)->mt.hParent);
      }
}
Exemplo n.º 11
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.º 12
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.º 13
0
void Server_ShowParticularPopupMenu (HWND hParent, POINT ptScreen, LPIDENT lpiServer)
{
   HMENU hm;

   if (lpiServer == NULL)
      hm = TaLocale_LoadMenu (MENU_SVR_NONE);
   else
      hm = TaLocale_LoadMenu (MENU_SVR);

   if (hm != NULL)
      {
      if (lpiServer == NULL)
         {
         int lvs = (gr.fPreview && !gr.fVert) ? gr.diHorz.viewSvr.lvsView : gr.diVert.viewSvr.lvsView;
         HMENU hmView = GetSubMenu (hm, 0);

         CheckMenuRadioItem (hmView,
                             M_SVR_VIEW_LARGE, M_SVR_VIEW_REPORT,
                             ( (lvs == FLS_VIEW_SMALL) ? M_SVR_VIEW_SMALL :
                               (lvs == FLS_VIEW_LIST)  ? M_SVR_VIEW_REPORT :
                                                         M_SVR_VIEW_LARGE ),
                             MF_BYCOMMAND);

         ICONVIEW ivSvr = Display_GetServerIconView();

         CheckMenuRadioItem (hmView,
                             M_SVR_VIEW_ONEICON, M_SVR_VIEW_STATUS,
                             (ivSvr == ivTWOICONS) ? M_SVR_VIEW_TWOICONS :
                             (ivSvr == ivONEICON)  ? M_SVR_VIEW_ONEICON : M_SVR_VIEW_STATUS,
                             MF_BYCOMMAND);

         if (lvs != FLS_VIEW_LIST)
            {
            EnableMenu (hmView, M_SVR_VIEW_ONEICON,  FALSE);
            EnableMenu (hmView, M_SVR_VIEW_TWOICONS, FALSE);
            EnableMenu (hmView, M_SVR_VIEW_STATUS,   FALSE);
            }

         if (!PropCache_Search (pcSERVER, ANYVALUE))
            EnableMenu (hmView, M_SVR_CLOSEALL, FALSE);
         }
      else
         {
         BOOL fOpenNow = (BOOL)!!(PropCache_Search (pcSERVER, lpiServer));

         LPSERVER_PREF lpsp;
         if ( ((lpsp = (LPSERVER_PREF)lpiServer->GetUserParam()) == NULL) ||
              (lpsp->fIsMonitored) )
            {
            EnableMenu (hm, M_SVR_OPEN,  !fOpenNow);
            EnableMenu (hm, M_SVR_CLOSE,  fOpenNow);
            CheckMenu (hm, M_SVR_MONITOR, TRUE);
            }
         else
            {
            if (!fOpenNow)
               EnableMenu (hm, M_SVR_CLOSE, FALSE);
            if (fOpenNow || !gr.fOpenMonitors)
               EnableMenu (hm, M_SVR_OPEN, FALSE);

            CheckMenu (hm, M_SVR_MONITOR, FALSE);

            EnableMenu (hm, M_SVR_SECURITY,  FALSE);
            EnableMenu (hm, M_SALVAGE,  FALSE);
            EnableMenu (hm, M_SET_CLONE,  FALSE);
            EnableMenu (hm, M_SET_UNLOCK, FALSE);
            EnableMenu (hm, M_SYNCVLDB,   FALSE);
            }
         }

      DisplayContextMenu (hm, ptScreen, hParent);
      }
}