OSDN Git Service

051de430402563d35646ebb3240396c2393b870a
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / BrowseRefsDlg.cpp
1 // BrowseRefsDlg.cpp : implementation file\r
2 //\r
3 \r
4 #include "stdafx.h"\r
5 #include "TortoiseProc.h"\r
6 #include "BrowseRefsDlg.h"\r
7 #include "LogDlg.h"\r
8 #include "AddRemoteDlg.h"\r
9 #include "AppUtils.h"\r
10 #include "Settings\SettingGitRemote.h"\r
11 #include "SinglePropSheetDlg.h"\r
12 #include "MessageBox.h"\r
13 \r
14 // CBrowseRefsDlg dialog\r
15 \r
16 IMPLEMENT_DYNAMIC(CBrowseRefsDlg, CResizableStandAloneDialog)\r
17 \r
18 CBrowseRefsDlg::CBrowseRefsDlg(CString cmdPath, CWnd* pParent /*=NULL*/)\r
19 :       CResizableStandAloneDialog(CBrowseRefsDlg::IDD, pParent),\r
20         m_cmdPath(cmdPath)\r
21 {\r
22 \r
23 }\r
24 \r
25 CBrowseRefsDlg::~CBrowseRefsDlg()\r
26 {\r
27 }\r
28 \r
29 void CBrowseRefsDlg::DoDataExchange(CDataExchange* pDX)\r
30 {\r
31         CDialog::DoDataExchange(pDX);\r
32         DDX_Control(pDX, IDC_TREE_REF,                  m_RefTreeCtrl);\r
33         DDX_Control(pDX, IDC_LIST_REF_LEAFS,    m_ListRefLeafs);\r
34 }\r
35 \r
36 \r
37 BEGIN_MESSAGE_MAP(CBrowseRefsDlg, CResizableStandAloneDialog)\r
38         ON_BN_CLICKED(IDOK, &CBrowseRefsDlg::OnBnClickedOk)\r
39         ON_NOTIFY(TVN_SELCHANGED, IDC_TREE_REF, &CBrowseRefsDlg::OnTvnSelchangedTreeRef)\r
40         ON_WM_CONTEXTMENU()\r
41 END_MESSAGE_MAP()\r
42 \r
43 \r
44 // CBrowseRefsDlg message handlers\r
45 \r
46 void CBrowseRefsDlg::OnBnClickedOk()\r
47 {\r
48         OnOK();\r
49 }\r
50 \r
51 BOOL CBrowseRefsDlg::OnInitDialog()\r
52 {\r
53         CResizableStandAloneDialog::OnInitDialog();\r
54 \r
55         AddAnchor(IDC_TREE_REF, TOP_LEFT, BOTTOM_LEFT);\r
56         AddAnchor(IDC_LIST_REF_LEAFS, TOP_LEFT, BOTTOM_RIGHT);\r
57 \r
58         m_ListRefLeafs.SetExtendedStyle(m_ListRefLeafs.GetExtendedStyle()|LVS_EX_FULLROWSELECT);\r
59         m_ListRefLeafs.InsertColumn(0,L"Name",0,150);\r
60         m_ListRefLeafs.InsertColumn(1,L"Date Last Commit",0,100);\r
61         m_ListRefLeafs.InsertColumn(2,L"Last Commit",0,300);\r
62         m_ListRefLeafs.InsertColumn(3,L"Hash",0,80);\r
63 \r
64         AddAnchor(IDOK,BOTTOM_RIGHT);\r
65         AddAnchor(IDCANCEL,BOTTOM_RIGHT);\r
66 \r
67         Refresh(true);\r
68 \r
69 \r
70         return TRUE;\r
71 }\r
72 \r
73 CShadowTree* CShadowTree::GetNextSub(CString& nameLeft, bool bCreateIfNotExist)\r
74 {\r
75         int posSlash=nameLeft.Find('/');\r
76         CString nameSub;\r
77         if(posSlash<0)\r
78         {\r
79                 nameSub=nameLeft;\r
80                 nameLeft.Empty();//Nothing left\r
81         }\r
82         else\r
83         {\r
84                 nameSub=nameLeft.Left(posSlash);\r
85                 nameLeft=nameLeft.Mid(posSlash+1);\r
86         }\r
87         if(nameSub.IsEmpty())\r
88                 return NULL;\r
89 \r
90         if(!bCreateIfNotExist && m_ShadowTree.find(nameSub)==m_ShadowTree.end())\r
91                 return NULL;\r
92 \r
93         CShadowTree& nextNode=m_ShadowTree[nameSub];\r
94         nextNode.m_csRefName=nameSub;\r
95         nextNode.m_pParent=this;\r
96         return &nextNode;\r
97 }\r
98 \r
99 typedef std::map<CString,CString> MAP_STRING_STRING;\r
100 \r
101 void CBrowseRefsDlg::Refresh(bool bSelectCurHead)\r
102 {\r
103 //      m_RefMap.clear();\r
104 //      g_Git.GetMapHashToFriendName(m_RefMap);\r
105                 \r
106         CString selectRef;\r
107         if(bSelectCurHead)\r
108         {\r
109                 g_Git.Run(L"git symbolic-ref HEAD",&selectRef,CP_UTF8);\r
110                 selectRef.Trim(L"\r\n\t ");\r
111         }\r
112         else\r
113         {\r
114                 POSITION pos=m_ListRefLeafs.GetFirstSelectedItemPosition();\r
115                 //List ctrl selection?\r
116                 if(pos)\r
117                 {\r
118                         CShadowTree* pTree=(CShadowTree*)m_ListRefLeafs.GetItemData(\r
119                                         m_ListRefLeafs.GetNextSelectedItem(pos));\r
120                         selectRef=pTree->GetRefName();\r
121                 }\r
122                 else\r
123                 {\r
124                         //Tree ctrl selection?\r
125                         HTREEITEM hTree=m_RefTreeCtrl.GetSelectedItem();\r
126                         if(hTree!=NULL)\r
127                         {\r
128                                 CShadowTree* pTree=(CShadowTree*)m_RefTreeCtrl.GetItemData(hTree);\r
129                                 selectRef=pTree->GetRefName();\r
130                         }\r
131                 }\r
132         }\r
133 \r
134         m_RefTreeCtrl.DeleteAllItems();\r
135         m_ListRefLeafs.DeleteAllItems();\r
136         m_TreeRoot.m_ShadowTree.clear();\r
137         m_TreeRoot.m_csRefName="refs";\r
138 //      m_TreeRoot.m_csShowName="Refs";\r
139         m_TreeRoot.m_hTree=m_RefTreeCtrl.InsertItem(L"Refs",NULL,NULL);\r
140         m_RefTreeCtrl.SetItemData(m_TreeRoot.m_hTree,(DWORD_PTR)&m_TreeRoot);\r
141 \r
142         CString allRefs;\r
143         g_Git.Run(L"git for-each-ref --format="\r
144                           L"%(refname)%04"\r
145                           L"%(objectname)%04"\r
146                           L"%(authordate:relative)%04"\r
147                           L"%(subject)%04"\r
148                           L"%(authorname)",\r
149                           &allRefs,CP_UTF8);\r
150 \r
151         int linePos=0;\r
152         CString singleRef;\r
153 \r
154         MAP_STRING_STRING refMap;\r
155 \r
156         //First sort on ref name\r
157         while(!(singleRef=allRefs.Tokenize(L"\r\n",linePos)).IsEmpty())\r
158         {\r
159                 int valuePos=0;\r
160                 CString refName=singleRef.Tokenize(L"\04",valuePos);\r
161                 CString refRest=singleRef.Mid(valuePos);\r
162                 refMap[refName]=refRest;\r
163         }\r
164 \r
165 \r
166 \r
167 //      for(MAP_HASH_NAME::iterator iterRef=m_RefMap.begin();iterRef!=m_RefMap.end();++iterRef)\r
168 //              for(STRING_VECTOR::iterator iterRefName=iterRef->second.begin();iterRefName!=iterRef->second.end();++iterRefName)\r
169 //                      refName[*iterRefName]=iterRef->first;\r
170 \r
171         //Populate ref tree\r
172         for(MAP_STRING_STRING::iterator iterRefMap=refMap.begin();iterRefMap!=refMap.end();++iterRefMap)\r
173         {\r
174                 CShadowTree& treeLeaf=GetTreeNode(iterRefMap->first,NULL,true);\r
175                 CString values=iterRefMap->second;\r
176 \r
177                 int valuePos=0;\r
178                 treeLeaf.m_csRefHash= values.Tokenize(L"\04",valuePos);\r
179                 treeLeaf.m_csDate=    values.Tokenize(L"\04",valuePos);\r
180                 treeLeaf.m_csSubject= values.Tokenize(L"\04",valuePos);\r
181                 treeLeaf.m_csAuthor=  values.Tokenize(L"\04",valuePos);\r
182         }\r
183 \r
184 \r
185         if(selectRef.IsEmpty() || !SelectRef(selectRef))\r
186                 //Probably not on a branch. Select root node.\r
187                 m_RefTreeCtrl.Expand(m_TreeRoot.m_hTree,TVE_EXPAND);\r
188 \r
189 }\r
190 \r
191 bool CBrowseRefsDlg::SelectRef(CString refName)\r
192 {\r
193         if(wcsnicmp(refName,L"refs/",5)!=0)\r
194                 return false; // Not a ref name\r
195 \r
196         CShadowTree& treeLeafHead=GetTreeNode(refName,NULL,false);\r
197         if(treeLeafHead.m_hTree != NULL)\r
198         {\r
199                 //Not a leaf. Select tree node and return\r
200                 m_RefTreeCtrl.Select(treeLeafHead.m_hTree,TVGN_CARET);\r
201                 return true;\r
202         }\r
203 \r
204         if(treeLeafHead.m_pParent==NULL)\r
205                 return false; //Weird... should not occur.\r
206 \r
207         //This is the current head.\r
208         m_RefTreeCtrl.Select(treeLeafHead.m_pParent->m_hTree,TVGN_CARET);\r
209 \r
210         for(int indexPos = 0; indexPos < m_ListRefLeafs.GetItemCount(); ++indexPos)\r
211         {\r
212                 CShadowTree* pCurrShadowTree = (CShadowTree*)m_ListRefLeafs.GetItemData(indexPos);\r
213                 if(pCurrShadowTree == &treeLeafHead)\r
214                 {\r
215                         m_ListRefLeafs.SetItemState(indexPos,LVIS_SELECTED,LVIS_SELECTED);\r
216                         m_ListRefLeafs.EnsureVisible(indexPos,FALSE);\r
217                 }\r
218         }\r
219 \r
220         return true;\r
221 }\r
222 \r
223 CShadowTree& CBrowseRefsDlg::GetTreeNode(CString refName, CShadowTree* pTreePos, bool bCreateIfNotExist)\r
224 {\r
225         if(pTreePos==NULL)\r
226         {\r
227                 if(wcsnicmp(refName,L"refs/",5)==0)\r
228                         refName=refName.Mid(5);\r
229                 pTreePos=&m_TreeRoot;\r
230         }\r
231         if(refName.IsEmpty())\r
232                 return *pTreePos;//Found leaf\r
233 \r
234         CShadowTree* pNextTree=pTreePos->GetNextSub(refName,bCreateIfNotExist);\r
235         if(pNextTree==NULL)\r
236         {\r
237                 //Should not occur when all ref-names are valid and bCreateIfNotExist is true.\r
238                 ASSERT(!bCreateIfNotExist);\r
239                 return *pTreePos;\r
240         }\r
241 \r
242         if(!refName.IsEmpty())\r
243         {\r
244                 //When the refName is not empty, this node is not a leaf, so lets add it to the tree control.\r
245                 //Leafs are for the list control.\r
246                 if(pNextTree->m_hTree==NULL)\r
247                 {\r
248                         //New tree. Create node in control.\r
249                         pNextTree->m_hTree=m_RefTreeCtrl.InsertItem(pNextTree->m_csRefName,pTreePos->m_hTree,NULL);\r
250                         m_RefTreeCtrl.SetItemData(pNextTree->m_hTree,(DWORD_PTR)pNextTree);\r
251                 }\r
252         }\r
253 \r
254         return GetTreeNode(refName, pNextTree, bCreateIfNotExist);\r
255 }\r
256 \r
257 \r
258 void CBrowseRefsDlg::OnTvnSelchangedTreeRef(NMHDR *pNMHDR, LRESULT *pResult)\r
259 {\r
260         LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);\r
261         *pResult = 0;\r
262 \r
263         FillListCtrlForTreeNode(pNMTreeView->itemNew.hItem);\r
264 }\r
265 \r
266 void CBrowseRefsDlg::FillListCtrlForTreeNode(HTREEITEM treeNode)\r
267 {\r
268         m_ListRefLeafs.DeleteAllItems();\r
269 \r
270         CShadowTree* pTree=(CShadowTree*)(m_RefTreeCtrl.GetItemData(treeNode));\r
271         if(pTree==NULL)\r
272         {\r
273                 ASSERT(FALSE);\r
274                 return;\r
275         }\r
276         FillListCtrlForShadowTree(pTree,L"",true);\r
277 }\r
278 \r
279 void CBrowseRefsDlg::FillListCtrlForShadowTree(CShadowTree* pTree, CString refNamePrefix, bool isFirstLevel)\r
280 {\r
281         if(pTree->IsLeaf())\r
282         {\r
283                 int indexItem=m_ListRefLeafs.InsertItem(m_ListRefLeafs.GetItemCount(),L"");\r
284 \r
285                 m_ListRefLeafs.SetItemData(indexItem,(DWORD_PTR)pTree);\r
286                 m_ListRefLeafs.SetItemText(indexItem,0,refNamePrefix+pTree->m_csRefName);\r
287                 m_ListRefLeafs.SetItemText(indexItem,1,pTree->m_csDate);\r
288                 m_ListRefLeafs.SetItemText(indexItem,2,pTree->m_csSubject);\r
289                 m_ListRefLeafs.SetItemText(indexItem,3,pTree->m_csRefHash);\r
290         }\r
291         else\r
292         {\r
293 \r
294                 CString csThisName;\r
295                 if(!isFirstLevel)\r
296                         csThisName=refNamePrefix+pTree->m_csRefName+L"/";\r
297                 for(CShadowTree::TShadowTreeMap::iterator itSubTree=pTree->m_ShadowTree.begin(); itSubTree!=pTree->m_ShadowTree.end(); ++itSubTree)\r
298                 {\r
299                         FillListCtrlForShadowTree(&itSubTree->second,csThisName,false);\r
300                 }\r
301         }\r
302 }\r
303 \r
304 bool CBrowseRefsDlg::ConfirmDeleteRef(CString completeRefName)\r
305 {\r
306         CString csMessage;\r
307         CString csTitle;\r
308 \r
309         UINT mbIcon=MB_ICONQUESTION;\r
310         csMessage=L"Are you sure you want to delete the ";\r
311         if(wcsncmp(completeRefName,L"refs/heads",10)==0)\r
312         {\r
313                 CString branchToDelete = completeRefName.Mid(11);\r
314                 csTitle.Format(L"Confirm deletion of branch %s", branchToDelete);\r
315                 csMessage += "branch:\r\n\r\n<b>";\r
316                 csMessage += branchToDelete;\r
317                 csMessage += "</b>";\r
318 \r
319                 //Check if branch is fully merged in HEAD\r
320                 CString branchHash = g_Git.GetHash(completeRefName);\r
321                 CString commonAncestor;\r
322                 CString cmd;\r
323                 cmd.Format(L"git.exe merge-base HEAD %s",completeRefName);\r
324                 g_Git.Run(cmd,&commonAncestor,CP_UTF8);\r
325 \r
326                 branchHash=branchHash.Left(40);\r
327                 commonAncestor=commonAncestor.Left(40);\r
328                 \r
329                 if(commonAncestor != branchHash)\r
330                 {\r
331                         csMessage += L"\r\n\r\n<b>Warning:\r\nThis branch is not fully merged into HEAD.</b>";\r
332                         mbIcon=MB_ICONWARNING;\r
333                 }\r
334         }\r
335         else if(wcsncmp(completeRefName,L"refs/tags",9)==0)\r
336         {\r
337                 CString tagToDelete = completeRefName.Mid(10);\r
338                 csTitle.Format(L"Confirm deletion of tag %s", tagToDelete);\r
339                 csMessage += "tag:\r\n\r\n<b>";\r
340                 csMessage += tagToDelete;\r
341                 csMessage += "</b>";\r
342         }\r
343 \r
344         return CMessageBox::Show(m_hWnd,csMessage,csTitle,MB_YESNO|mbIcon)==IDYES;\r
345 \r
346 }\r
347 \r
348 \r
349 bool CBrowseRefsDlg::DoDeleteRef(CString completeRefName, bool bForce)\r
350 {\r
351         if(wcsncmp(completeRefName,L"refs/heads",10)==0)\r
352         {\r
353                 CString branchToDelete = completeRefName.Mid(11);\r
354                 CString cmd;\r
355                 cmd.Format(L"git.exe branch -%c %s",bForce?L'D':L'd',branchToDelete);\r
356                 CString resultDummy;\r
357                 if(g_Git.Run(cmd,&resultDummy,CP_UTF8)!=0)\r
358                 {\r
359                         CString errorMsg;\r
360                         errorMsg.Format(L"Could not delete branch %s. Message from git:\r\n\r\n%s",branchToDelete,resultDummy);\r
361                         CMessageBox::Show(m_hWnd,errorMsg,L"Error deleting branch",MB_OK|MB_ICONERROR);\r
362                         return false;\r
363                 }\r
364         }\r
365         else if(wcsncmp(completeRefName,L"refs/tags",9)==0)\r
366         {\r
367                 CString tagToDelete = completeRefName.Mid(10);\r
368                 CString cmd;\r
369                 cmd.Format(L"git.exe tag -d %s",tagToDelete);\r
370                 CString resultDummy;\r
371                 if(g_Git.Run(cmd,&resultDummy,CP_UTF8)!=0)\r
372                 {\r
373                         CString errorMsg;\r
374                         errorMsg.Format(L"Could not delete tag %s. Message from git:\r\n\r\n%s",tagToDelete,resultDummy);\r
375                         CMessageBox::Show(m_hWnd,errorMsg,L"Error deleting tag",MB_OK|MB_ICONERROR);\r
376                         return false;\r
377                 }\r
378         }\r
379         return true;\r
380 }\r
381 \r
382 void CBrowseRefsDlg::OnContextMenu(CWnd* pWndFrom, CPoint point)\r
383 {\r
384         if(pWndFrom==&m_RefTreeCtrl)       OnContextMenu_RefTreeCtrl(point);\r
385         else if(pWndFrom==&m_ListRefLeafs) OnContextMenu_ListRefLeafs(point);\r
386 }\r
387 \r
388 void CBrowseRefsDlg::OnContextMenu_RefTreeCtrl(CPoint point)\r
389 {\r
390         CPoint clientPoint=point;\r
391         m_RefTreeCtrl.ScreenToClient(&clientPoint);\r
392 \r
393         HTREEITEM hTreeItem=m_RefTreeCtrl.HitTest(clientPoint);\r
394         if(hTreeItem!=NULL)\r
395                 m_RefTreeCtrl.Select(hTreeItem,TVGN_CARET);\r
396 \r
397         ShowContextMenu(point,hTreeItem,VectorPShadowTree());\r
398 }\r
399 \r
400 \r
401 void CBrowseRefsDlg::OnContextMenu_ListRefLeafs(CPoint point)\r
402 {\r
403         std::vector<CShadowTree*> selectedLeafs;\r
404         selectedLeafs.reserve(m_ListRefLeafs.GetSelectedCount());\r
405         POSITION pos=m_ListRefLeafs.GetFirstSelectedItemPosition();\r
406         while(pos)\r
407         {\r
408                 selectedLeafs.push_back(\r
409                         (CShadowTree*)m_ListRefLeafs.GetItemData(\r
410                                 m_ListRefLeafs.GetNextSelectedItem(pos)));\r
411         }\r
412 \r
413         ShowContextMenu(point,m_RefTreeCtrl.GetSelectedItem(),selectedLeafs);\r
414 }\r
415 \r
416 void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPShadowTree& selectedLeafs)\r
417 {\r
418         CMenu popupMenu;\r
419         popupMenu.CreatePopupMenu();\r
420 \r
421         if(selectedLeafs.size()==1)\r
422         {\r
423                 popupMenu.AppendMenu(MF_STRING,eCmd_ViewLog,L"View log");\r
424                 if(selectedLeafs[0]->IsFrom(L"refs/heads"))\r
425                         popupMenu.AppendMenu(MF_STRING,eCmd_DeleteBranch,L"Delete Branch");\r
426                 else if(selectedLeafs[0]->IsFrom(L"refs/tags"))\r
427                         popupMenu.AppendMenu(MF_STRING,eCmd_DeleteTag,L"Delete Tag");\r
428 \r
429 //              CShadowTree* pTree = (CShadowTree*)m_ListRefLeafs.GetItemData(pNMHDR->idFrom);\r
430 //              if(pTree==NULL)\r
431 //                      return;\r
432         }\r
433 \r
434         if(hTreePos!=NULL)\r
435         {\r
436                 CShadowTree* pTree=(CShadowTree*)m_RefTreeCtrl.GetItemData(hTreePos);\r
437                 if(pTree->IsFrom(L"refs/remotes"))\r
438                 {\r
439 //                      popupMenu.AppendMenu(MF_STRING,eCmd_AddRemote,L"Add Remote");\r
440                         popupMenu.AppendMenu(MF_STRING,eCmd_ManageRemotes,L"Manage Remotes");\r
441                 }\r
442                 else if(pTree->IsFrom(L"refs/heads"))\r
443                         popupMenu.AppendMenu(MF_STRING,eCmd_CreateBranch,L"Create Branch");\r
444                 else if(pTree->IsFrom(L"refs/tags"))\r
445                         popupMenu.AppendMenu(MF_STRING,eCmd_CreateTag,L"Create Tag");\r
446         }\r
447 \r
448 \r
449         eCmd cmd=(eCmd)popupMenu.TrackPopupMenuEx(TPM_LEFTALIGN|TPM_RETURNCMD, point.x, point.y, this, 0);\r
450         switch(cmd)\r
451         {\r
452         case eCmd_ViewLog:\r
453                 {\r
454                         CLogDlg dlg;\r
455                         dlg.SetStartRef(selectedLeafs[0]->m_csRefHash);\r
456                         dlg.DoModal();\r
457                 }\r
458                 break;\r
459         case eCmd_DeleteBranch:\r
460                 {\r
461                         if(ConfirmDeleteRef(selectedLeafs[0]->GetRefName()))\r
462                                 DoDeleteRef(selectedLeafs[0]->GetRefName(), true);\r
463                         Refresh();\r
464                 }\r
465                 break;\r
466         case eCmd_DeleteTag:\r
467                 {\r
468                         if(ConfirmDeleteRef(selectedLeafs[0]->GetRefName()))\r
469                                 DoDeleteRef(selectedLeafs[0]->GetRefName(), true);\r
470                         Refresh();\r
471                 }\r
472                 break;\r
473         case eCmd_AddRemote:\r
474                 {\r
475                         CAddRemoteDlg(this).DoModal();\r
476                         Refresh();\r
477                 }\r
478                 break;\r
479         case eCmd_ManageRemotes:\r
480                 {\r
481                         CSinglePropSheetDlg(L"Git Remote Settings",new CSettingGitRemote(m_cmdPath),this).DoModal();\r
482 //                      CSettingGitRemote W_Remotes(m_cmdPath);\r
483 //                      W_Remotes.DoModal();\r
484                         Refresh();\r
485                 }\r
486                 break;\r
487         case eCmd_CreateBranch:\r
488                 {\r
489                         CAppUtils::CreateBranchTag(false);\r
490                         Refresh();\r
491                 }\r
492                 break;\r
493         case eCmd_CreateTag:\r
494                 {\r
495                         CAppUtils::CreateBranchTag(true);\r
496                         Refresh();\r
497                 }\r
498                 break;\r
499         }\r
500 }\r
501 \r
502 BOOL CBrowseRefsDlg::PreTranslateMessage(MSG* pMsg)\r
503 {\r
504         if (pMsg->message == WM_KEYDOWN)\r
505         {\r
506                 switch (pMsg->wParam)\r
507                 {\r
508 /*              case VK_RETURN:\r
509                         {\r
510                                 if (GetAsyncKeyState(VK_CONTROL)&0x8000)\r
511                                 {\r
512                                         if ( GetDlgItem(IDOK)->IsWindowEnabled() )\r
513                                         {\r
514                                                 PostMessage(WM_COMMAND, IDOK);\r
515                                         }\r
516                                         return TRUE;\r
517                                 }\r
518                         }\r
519                         break;\r
520 */              case VK_F5:\r
521                         {\r
522                                 Refresh();\r
523                         }\r
524                         break;\r
525                 }\r
526         }\r
527 \r
528 \r
529         return CResizableStandAloneDialog::PreTranslateMessage(pMsg);\r
530 }\r