1 // TortoiseIDiff - an image diff viewer in TortoiseSVN
3 // Copyright (C) 2006-2013 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "TortoiseIDiff.h"
23 #include "MainWindow.h"
25 #include "TaskbarUUID.h"
27 #pragma comment(lib, "comctl32.lib")
29 tstring
CMainWindow::leftpicpath
;
30 tstring
CMainWindow::leftpictitle
;
32 tstring
CMainWindow::rightpicpath
;
33 tstring
CMainWindow::rightpictitle
;
35 const UINT TaskBarButtonCreated
= RegisterWindowMessage(L
"TaskbarButtonCreated");
37 bool CMainWindow::RegisterAndCreateWindow()
41 // Fill in the window class structure with default parameters
42 wcx
.cbSize
= sizeof(WNDCLASSEX
);
43 wcx
.style
= CS_HREDRAW
| CS_VREDRAW
;
44 wcx
.lpfnWndProc
= CWindow::stWinMsgHandler
;
47 wcx
.hInstance
= hResource
;
48 wcx
.hCursor
= LoadCursor(NULL
, IDC_SIZEWE
);
49 ResString
clsname(hResource
, IDS_APP_TITLE
);
50 wcx
.lpszClassName
= clsname
;
51 wcx
.hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_TORTOISEIDIFF
));
52 wcx
.hbrBackground
= (HBRUSH
)(COLOR_3DFACE
+1);
53 if (selectionPaths
.empty())
54 wcx
.lpszMenuName
= MAKEINTRESOURCE(IDC_TORTOISEIDIFF
);
56 wcx
.lpszMenuName
= MAKEINTRESOURCE(IDC_TORTOISEIDIFF2
);
57 wcx
.hIconSm
= LoadIcon(wcx
.hInstance
, MAKEINTRESOURCE(IDI_TORTOISEIDIFF
));
58 if (RegisterWindow(&wcx
))
60 if (Create(WS_OVERLAPPEDWINDOW
| WS_CLIPCHILDREN
| WS_VISIBLE
, NULL
))
69 void CMainWindow::PositionChildren(RECT
* clientrect
/* = NULL */)
72 if (clientrect
== NULL
)
74 SendMessage(hwndTB
, TB_AUTOSIZE
, 0, 0);
75 GetWindowRect(hwndTB
, &tbRect
);
76 LONG tbHeight
= tbRect
.bottom
-tbRect
.top
-1;
77 HDWP hdwp
= BeginDeferWindowPos(3);
78 if (bOverlap
&& selectionPaths
.empty())
80 SetWindowPos(picWindow1
, NULL
, clientrect
->left
, clientrect
->top
+tbHeight
, clientrect
->right
-clientrect
->left
, clientrect
->bottom
-clientrect
->top
-tbHeight
, SWP_SHOWWINDOW
);
86 if (selectionPaths
.size() != 3)
90 child
.left
= clientrect
->left
;
91 child
.top
= clientrect
->top
+tbHeight
;
92 child
.right
= clientrect
->right
;
93 child
.bottom
= nSplitterPos
-(SPLITTER_BORDER
/2);
94 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow1
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
95 child
.top
= nSplitterPos
+(SPLITTER_BORDER
/2);
96 child
.bottom
= clientrect
->bottom
;
97 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow2
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
101 // three image windows
103 child
.left
= clientrect
->left
;
104 child
.top
= clientrect
->top
+tbHeight
;
105 child
.right
= clientrect
->right
;
106 child
.bottom
= nSplitterPos
-(SPLITTER_BORDER
/2);
107 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow1
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
108 child
.top
= nSplitterPos
+(SPLITTER_BORDER
/2);
109 child
.bottom
= nSplitterPos2
-(SPLITTER_BORDER
/2);
110 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow2
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
111 child
.top
= nSplitterPos2
+(SPLITTER_BORDER
/2);
112 child
.bottom
= clientrect
->bottom
;
113 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow3
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
118 if (selectionPaths
.size() != 3)
122 child
.left
= clientrect
->left
;
123 child
.top
= clientrect
->top
+tbHeight
;
124 child
.right
= nSplitterPos
-(SPLITTER_BORDER
/2);
125 child
.bottom
= clientrect
->bottom
;
126 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow1
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
127 child
.left
= nSplitterPos
+(SPLITTER_BORDER
/2);
128 child
.right
= clientrect
->right
;
129 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow2
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
133 // three image windows
135 child
.left
= clientrect
->left
;
136 child
.top
= clientrect
->top
+tbHeight
;
137 child
.right
= nSplitterPos
-(SPLITTER_BORDER
/2);
138 child
.bottom
= clientrect
->bottom
;
139 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow1
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
140 child
.left
= nSplitterPos
+(SPLITTER_BORDER
/2);
141 child
.right
= nSplitterPos2
-(SPLITTER_BORDER
/2);
142 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow2
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
143 child
.left
= nSplitterPos2
+(SPLITTER_BORDER
/2);
144 child
.right
= clientrect
->right
;
145 if (hdwp
) hdwp
= DeferWindowPos(hdwp
, picWindow3
, NULL
, child
.left
, child
.top
, child
.right
-child
.left
, child
.bottom
-child
.top
, SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
149 if (hdwp
) EndDeferWindowPos(hdwp
);
150 picWindow1
.SetTransparentColor(transparentColor
);
151 picWindow2
.SetTransparentColor(transparentColor
);
152 picWindow3
.SetTransparentColor(transparentColor
);
153 InvalidateRect(*this, NULL
, FALSE
);
156 LRESULT CALLBACK
CMainWindow::WinMsgHandler(HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
158 if (uMsg
== TaskBarButtonCreated
)
160 SetUUIDOverlayIcon(hwnd
);
167 picWindow1
.RegisterAndCreateWindow(hwnd
);
168 picWindow2
.RegisterAndCreateWindow(hwnd
);
169 if (selectionPaths
.empty())
171 picWindow1
.SetPic(leftpicpath
, leftpictitle
, true);
172 picWindow2
.SetPic(rightpicpath
, rightpictitle
, false);
174 picWindow1
.SetOtherPicWindow(&picWindow2
);
175 picWindow2
.SetOtherPicWindow(&picWindow1
);
179 picWindow3
.RegisterAndCreateWindow(hwnd
);
181 picWindow1
.SetPic(selectionPaths
[FileTypeMine
], selectionTitles
[FileTypeMine
], false);
182 picWindow2
.SetPic(selectionPaths
[FileTypeBase
], selectionTitles
[FileTypeBase
], false);
183 picWindow3
.SetPic(selectionPaths
[FileTypeTheirs
], selectionTitles
[FileTypeTheirs
], false);
186 picWindow1
.SetSelectionMode(!selectionPaths
.empty());
187 picWindow2
.SetSelectionMode(!selectionPaths
.empty());
188 picWindow3
.SetSelectionMode(!selectionPaths
.empty());
191 // center the splitter
193 GetClientRect(hwnd
, &rect
);
194 if (selectionPaths
.size() != 3)
196 nSplitterPos
= (rect
.right
-rect
.left
)/2;
201 nSplitterPos
= (rect
.right
-rect
.left
)/3;
202 nSplitterPos2
= (rect
.right
-rect
.left
)*2/3;
205 PositionChildren(&rect
);
206 picWindow1
.FitImageInWindow();
207 picWindow2
.FitImageInWindow();
208 picWindow3
.FitImageInWindow();
213 return DoCommand(LOWORD(wParam
), lParam
);
222 ::GetClientRect(*this, &rect
);
223 hdc
= BeginPaint(hwnd
, &ps
);
224 SetBkColor(hdc
, GetSysColor(COLOR_3DFACE
));
225 ::ExtTextOut(hdc
, 0, 0, ETO_OPAQUE
, &rect
, NULL
, 0, NULL
);
229 case WM_GETMINMAXINFO
:
231 MINMAXINFO
* mmi
= (MINMAXINFO
*)lParam
;
232 mmi
->ptMinTrackSize
.x
= WINDOW_MINWIDTH
;
233 mmi
->ptMinTrackSize
.y
= WINDOW_MINHEIGHT
;
240 GetClientRect(hwnd
, &rect
);
244 GetWindowRect(hwndTB
, &tbRect
);
245 LONG tbHeight
= tbRect
.bottom
-tbRect
.top
-1;
246 if (selectionPaths
.size() != 3)
248 nSplitterPos
= (rect
.bottom
-rect
.top
)/2+tbHeight
;
253 nSplitterPos
= (rect
.bottom
-rect
.top
)/3+tbHeight
;
254 nSplitterPos2
= (rect
.bottom
-rect
.top
)*2/3+tbHeight
;
259 if (selectionPaths
.size() != 3)
261 nSplitterPos
= (rect
.right
-rect
.left
)/2;
266 nSplitterPos
= (rect
.right
-rect
.left
)/3;
267 nSplitterPos2
= (rect
.right
-rect
.left
)*2/3;
270 PositionChildren(&rect
);
275 if ((HWND
)wParam
== *this)
279 GetClientRect(*this, &rect
);
281 ScreenToClient(*this, &pt
);
282 if (PtInRect(&rect
, pt
))
286 HCURSOR hCur
= LoadCursor(NULL
, MAKEINTRESOURCE(IDC_SIZENS
));
291 HCURSOR hCur
= LoadCursor(NULL
, MAKEINTRESOURCE(IDC_SIZEWE
));
297 return DefWindowProc(hwnd
, uMsg
, wParam
, lParam
);
301 Splitter_OnLButtonDown(hwnd
, uMsg
, wParam
, lParam
);
304 Splitter_OnLButtonUp(hwnd
, uMsg
, wParam
, lParam
);
306 case WM_CAPTURECHANGED
:
307 Splitter_CaptureChanged();
310 Splitter_OnMouseMove(hwnd
, uMsg
, wParam
, lParam
);
314 // find out if the mouse cursor is over one of the views, and if
315 // it is, pass the mouse wheel message to that view
317 DWORD ptW
= GetMessagePos();
318 pt
.x
= GET_X_LPARAM(ptW
);
319 pt
.y
= GET_Y_LPARAM(ptW
);
321 GetWindowRect(picWindow1
, &rect
);
322 if (PtInRect(&rect
, pt
))
324 picWindow1
.OnMouseWheel(GET_KEYSTATE_WPARAM(wParam
), GET_WHEEL_DELTA_WPARAM(wParam
));
328 GetWindowRect(picWindow2
, &rect
);
329 if (PtInRect(&rect
, pt
))
331 picWindow2
.OnMouseWheel(GET_KEYSTATE_WPARAM(wParam
), GET_WHEEL_DELTA_WPARAM(wParam
));
335 GetWindowRect(picWindow3
, &rect
);
336 if (PtInRect(&rect
, pt
))
338 picWindow3
.OnMouseWheel(GET_KEYSTATE_WPARAM(wParam
), GET_WHEEL_DELTA_WPARAM(wParam
));
346 // find out if the mouse cursor is over one of the views, and if
347 // it is, pass the mouse wheel message to that view
349 DWORD ptW
= GetMessagePos();
350 pt
.x
= GET_X_LPARAM(ptW
);
351 pt
.y
= GET_Y_LPARAM(ptW
);
353 GetWindowRect(picWindow1
, &rect
);
354 if (PtInRect(&rect
, pt
))
356 picWindow1
.OnMouseWheel(GET_KEYSTATE_WPARAM(wParam
)|MK_SHIFT
, GET_WHEEL_DELTA_WPARAM(wParam
));
360 GetWindowRect(picWindow2
, &rect
);
361 if (PtInRect(&rect
, pt
))
363 picWindow2
.OnMouseWheel(GET_KEYSTATE_WPARAM(wParam
)|MK_SHIFT
, GET_WHEEL_DELTA_WPARAM(wParam
));
367 GetWindowRect(picWindow3
, &rect
);
368 if (PtInRect(&rect
, pt
))
370 picWindow3
.OnMouseWheel(GET_KEYSTATE_WPARAM(wParam
)|MK_SHIFT
, GET_WHEEL_DELTA_WPARAM(wParam
));
378 LPNMHDR pNMHDR
= (LPNMHDR
)lParam
;
379 if (pNMHDR
->code
== TTN_GETDISPINFO
)
383 lpttt
= (LPTOOLTIPTEXT
) lParam
;
384 lpttt
->hinst
= hResource
;
386 // Specify the resource identifier of the descriptive
387 // text for the given button.
388 TCHAR stringbuf
[MAX_PATH
] = {0};
390 mii
.cbSize
= sizeof(MENUITEMINFO
);
391 mii
.fMask
= MIIM_TYPE
;
392 mii
.dwTypeData
= stringbuf
;
393 mii
.cch
= _countof(stringbuf
);
394 GetMenuItemInfo(GetMenu(*this), (UINT
)lpttt
->hdr
.idFrom
, FALSE
, &mii
);
395 _tcscpy_s(lpttt
->lpszText
, 80, stringbuf
);
400 bWindowClosed
= TRUE
;
404 ImageList_Destroy(hToolbarImgList
);
405 ::DestroyWindow(m_hwnd
);
408 return DefWindowProc(hwnd
, uMsg
, wParam
, lParam
);
414 LRESULT
CMainWindow::DoCommand(int id
, LPARAM lParam
)
422 picWindow1
.SetPic(leftpicpath
, _T(""), true);
423 picWindow2
.SetPic(rightpicpath
, _T(""), false);
426 picWindow1
.SetSecondPic(picWindow2
.GetPic(), rightpictitle
, rightpicpath
);
430 picWindow1
.SetSecondPic();
433 GetClientRect(*this, &rect
);
434 PositionChildren(&rect
);
435 picWindow1
.FitImageInWindow();
436 picWindow2
.FitImageInWindow();
440 case ID_VIEW_IMAGEINFO
:
442 bShowInfo
= !bShowInfo
;
443 HMENU hMenu
= GetMenu(*this);
444 UINT uCheck
= MF_BYCOMMAND
;
445 uCheck
|= bShowInfo
? MF_CHECKED
: MF_UNCHECKED
;
446 CheckMenuItem(hMenu
, ID_VIEW_IMAGEINFO
, uCheck
);
448 picWindow1
.ShowInfo(bShowInfo
);
449 picWindow2
.ShowInfo(bShowInfo
);
450 picWindow3
.ShowInfo(bShowInfo
);
452 // change the state of the toolbar button
454 tbi
.cbSize
= sizeof(TBBUTTONINFO
);
455 tbi
.dwMask
= TBIF_STATE
;
456 tbi
.fsState
= bShowInfo
? TBSTATE_CHECKED
| TBSTATE_ENABLED
: TBSTATE_ENABLED
;
457 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_IMAGEINFO
, (LPARAM
)&tbi
);
460 case ID_VIEW_OVERLAPIMAGES
:
462 bOverlap
= !bOverlap
;
463 HMENU hMenu
= GetMenu(*this);
464 UINT uCheck
= MF_BYCOMMAND
;
465 uCheck
|= bOverlap
? MF_CHECKED
: MF_UNCHECKED
;
466 CheckMenuItem(hMenu
, ID_VIEW_OVERLAPIMAGES
, uCheck
);
467 uCheck
|= (m_BlendType
== CPicWindow::BLEND_ALPHA
) ? MF_CHECKED
: MF_UNCHECKED
;
468 CheckMenuItem(hMenu
, ID_VIEW_BLENDALPHA
, uCheck
);
470 // change the state of the toolbar button
472 tbi
.cbSize
= sizeof(TBBUTTONINFO
);
473 tbi
.dwMask
= TBIF_STATE
;
474 tbi
.fsState
= bOverlap
? TBSTATE_CHECKED
| TBSTATE_ENABLED
: TBSTATE_ENABLED
;
475 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_OVERLAPIMAGES
, (LPARAM
)&tbi
);
477 tbi
.fsState
= (m_BlendType
== CPicWindow::BLEND_ALPHA
) ? TBSTATE_CHECKED
: 0;
479 tbi
.fsState
|= TBSTATE_ENABLED
;
482 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_BLENDALPHA
, (LPARAM
)&tbi
);
487 tbi
.fsState
= bVertical
? TBSTATE_ENABLED
| TBSTATE_CHECKED
: TBSTATE_ENABLED
;
488 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_ARRANGEVERTICAL
, (LPARAM
)&tbi
);
492 bLinkedPositions
= true;
493 picWindow1
.LinkPositions(bLinkedPositions
);
494 picWindow2
.LinkPositions(bLinkedPositions
);
495 tbi
.fsState
= TBSTATE_CHECKED
;
498 tbi
.fsState
= bLinkedPositions
? TBSTATE_ENABLED
| TBSTATE_CHECKED
: TBSTATE_ENABLED
;
499 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_LINKIMAGESTOGETHER
, (LPARAM
)&tbi
);
501 ShowWindow(picWindow2
, bOverlap
? SW_HIDE
: SW_SHOW
);
505 picWindow1
.StopTimer();
506 picWindow2
.StopTimer();
507 picWindow1
.SetSecondPic(picWindow2
.GetPic(), rightpictitle
, rightpicpath
,
508 picWindow2
.GetHPos(), picWindow2
.GetVPos());
509 picWindow1
.SetBlendAlpha(m_BlendType
, 0.5f
);
513 picWindow1
.SetSecondPic();
515 picWindow1
.SetOverlapMode(bOverlap
);
516 picWindow2
.SetOverlapMode(bOverlap
);
520 GetClientRect(*this, &rect
);
521 PositionChildren(&rect
);
526 case ID_VIEW_BLENDALPHA
:
528 if (m_BlendType
== CPicWindow::BLEND_ALPHA
)
529 m_BlendType
= CPicWindow::BLEND_XOR
;
531 m_BlendType
= CPicWindow::BLEND_ALPHA
;
533 HMENU hMenu
= GetMenu(*this);
534 UINT uCheck
= MF_BYCOMMAND
;
535 uCheck
|= (m_BlendType
== CPicWindow::BLEND_ALPHA
) ? MF_CHECKED
: MF_UNCHECKED
;
536 CheckMenuItem(hMenu
, ID_VIEW_BLENDALPHA
, uCheck
);
538 // change the state of the toolbar button
540 tbi
.cbSize
= sizeof(TBBUTTONINFO
);
541 tbi
.dwMask
= TBIF_STATE
;
542 tbi
.fsState
= (m_BlendType
== CPicWindow::BLEND_ALPHA
) ? TBSTATE_CHECKED
| TBSTATE_ENABLED
: TBSTATE_ENABLED
;
543 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_BLENDALPHA
, (LPARAM
)&tbi
);
544 picWindow1
.SetBlendAlpha(m_BlendType
, picWindow1
.GetBlendAlpha());
548 case ID_VIEW_TRANSPARENTCOLOR
:
550 static COLORREF customColors
[16] = {0};
552 memset(&ccDlg
, 0, sizeof(ccDlg
));
553 ccDlg
.lStructSize
= sizeof(ccDlg
);
554 ccDlg
.hwndOwner
= m_hwnd
;
555 ccDlg
.rgbResult
= transparentColor
;
556 ccDlg
.lpCustColors
= customColors
;
557 ccDlg
.Flags
= CC_RGBINIT
| CC_FULLOPEN
;
558 if(ChooseColor(&ccDlg
))
560 transparentColor
= ccDlg
.rgbResult
;
561 picWindow1
.SetTransparentColor(transparentColor
);
562 picWindow2
.SetTransparentColor(transparentColor
);
563 picWindow3
.SetTransparentColor(transparentColor
);
564 // The color picker takes the focus and we don't get it back.
565 ::SetFocus(picWindow1
);
569 case ID_VIEW_FITIMAGEWIDTHS
:
571 bFitWidths
= !bFitWidths
;
572 picWindow1
.FitWidths(bFitWidths
);
573 picWindow2
.FitWidths(bFitWidths
);
574 picWindow3
.FitWidths(bFitWidths
);
576 HMENU hMenu
= GetMenu(*this);
577 UINT uCheck
= MF_BYCOMMAND
;
578 uCheck
|= bFitWidths
? MF_CHECKED
: MF_UNCHECKED
;
579 CheckMenuItem(hMenu
, ID_VIEW_FITIMAGEWIDTHS
, uCheck
);
581 // change the state of the toolbar button
583 tbi
.cbSize
= sizeof(TBBUTTONINFO
);
584 tbi
.dwMask
= TBIF_STATE
;
585 tbi
.fsState
= bFitWidths
? TBSTATE_CHECKED
| TBSTATE_ENABLED
: TBSTATE_ENABLED
;
586 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_FITIMAGEWIDTHS
, (LPARAM
)&tbi
);
589 case ID_VIEW_FITIMAGEHEIGHTS
:
591 bFitHeights
= !bFitHeights
;
592 picWindow1
.FitHeights(bFitHeights
);
593 picWindow2
.FitHeights(bFitHeights
);
594 picWindow3
.FitHeights(bFitHeights
);
596 HMENU hMenu
= GetMenu(*this);
597 UINT uCheck
= MF_BYCOMMAND
;
598 uCheck
|= bFitHeights
? MF_CHECKED
: MF_UNCHECKED
;
599 CheckMenuItem(hMenu
, ID_VIEW_FITIMAGEHEIGHTS
, uCheck
);
601 // change the state of the toolbar button
603 tbi
.cbSize
= sizeof(TBBUTTONINFO
);
604 tbi
.dwMask
= TBIF_STATE
;
605 tbi
.fsState
= bFitHeights
? TBSTATE_CHECKED
| TBSTATE_ENABLED
: TBSTATE_ENABLED
;
606 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_FITIMAGEHEIGHTS
, (LPARAM
)&tbi
);
609 case ID_VIEW_LINKIMAGESTOGETHER
:
611 bLinkedPositions
= !bLinkedPositions
;
612 picWindow1
.LinkPositions(bLinkedPositions
);
613 picWindow2
.LinkPositions(bLinkedPositions
);
614 picWindow3
.LinkPositions(bLinkedPositions
);
616 HMENU hMenu
= GetMenu(*this);
617 UINT uCheck
= MF_BYCOMMAND
;
618 uCheck
|= bLinkedPositions
? MF_CHECKED
: MF_UNCHECKED
;
619 CheckMenuItem(hMenu
, ID_VIEW_LINKIMAGESTOGETHER
, uCheck
);
621 // change the state of the toolbar button
623 tbi
.cbSize
= sizeof(TBBUTTONINFO
);
624 tbi
.dwMask
= TBIF_STATE
;
625 tbi
.fsState
= bLinkedPositions
? TBSTATE_CHECKED
| TBSTATE_ENABLED
: TBSTATE_ENABLED
;
626 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_LINKIMAGESTOGETHER
, (LPARAM
)&tbi
);
630 picWindow1
.SetBlendAlpha(m_BlendType
, 0.0f
);
632 case ID_VIEW_ALPHA255
:
633 picWindow1
.SetBlendAlpha(m_BlendType
, 1.0f
);
635 case ID_VIEW_ALPHA127
:
636 picWindow1
.SetBlendAlpha(m_BlendType
, 0.5f
);
638 case ID_VIEW_ALPHATOGGLE
:
639 picWindow1
.ToggleAlpha();
641 case ID_VIEW_FITIMAGESINWINDOW
:
643 picWindow1
.FitImageInWindow();
644 picWindow2
.FitImageInWindow();
645 picWindow3
.FitImageInWindow();
648 case ID_VIEW_ORININALSIZE
:
650 picWindow1
.SetZoom(100, false);
651 picWindow2
.SetZoom(100, false);
652 picWindow3
.SetZoom(100, false);
653 picWindow1
.CenterImage();
654 picWindow2
.CenterImage();
655 picWindow3
.CenterImage();
660 picWindow1
.Zoom(true, false);
661 if ((!(bFitWidths
|| bFitHeights
))&&(!bOverlap
))
663 picWindow2
.Zoom(true, false);
664 picWindow3
.Zoom(true, false);
668 case ID_VIEW_ZOOMOUT
:
670 picWindow1
.Zoom(false, false);
671 if ((!(bFitWidths
|| bFitHeights
))&&(!bOverlap
))
673 picWindow2
.Zoom(false, false);
674 picWindow3
.Zoom(false, false);
678 case ID_VIEW_ARRANGEVERTICAL
:
680 bVertical
= !bVertical
;
682 GetClientRect(*this, &rect
);
686 GetWindowRect(hwndTB
, &tbRect
);
687 LONG tbHeight
= tbRect
.bottom
-tbRect
.top
-1;
688 if (selectionPaths
.size() != 3)
690 nSplitterPos
= (rect
.bottom
-rect
.top
)/2+tbHeight
;
695 nSplitterPos
= (rect
.bottom
-rect
.top
)/3+tbHeight
;
696 nSplitterPos2
= (rect
.bottom
-rect
.top
)*2/3+tbHeight
;
701 if (selectionPaths
.size() != 3)
703 nSplitterPos
= (rect
.right
-rect
.left
)/2;
708 nSplitterPos
= (rect
.right
-rect
.left
)/3;
709 nSplitterPos2
= (rect
.right
-rect
.left
)*2/3;
712 HMENU hMenu
= GetMenu(*this);
713 UINT uCheck
= MF_BYCOMMAND
;
714 uCheck
|= bVertical
? MF_CHECKED
: MF_UNCHECKED
;
715 CheckMenuItem(hMenu
, ID_VIEW_ARRANGEVERTICAL
, uCheck
);
716 // change the state of the toolbar button
718 tbi
.cbSize
= sizeof(TBBUTTONINFO
);
719 tbi
.dwMask
= TBIF_STATE
;
720 tbi
.fsState
= bVertical
? TBSTATE_CHECKED
| TBSTATE_ENABLED
: TBSTATE_ENABLED
;
721 SendMessage(hwndTB
, TB_SETBUTTONINFO
, ID_VIEW_ARRANGEVERTICAL
, (LPARAM
)&tbi
);
723 PositionChildren(&rect
);
728 CAboutDlg
dlg(*this);
729 dlg
.DoModal(hInst
, IDD_ABOUT
, *this);
732 case SELECTBUTTON_ID
:
734 HWND hSource
= (HWND
)lParam
;
735 if (picWindow1
== hSource
)
737 if (!selectionResult
.empty())
738 CopyFile(selectionPaths
[FileTypeMine
].c_str(), selectionResult
.c_str(), FALSE
);
739 PostQuitMessage(FileTypeMine
);
741 if (picWindow2
== hSource
)
743 if (!selectionResult
.empty())
744 CopyFile(selectionPaths
[FileTypeBase
].c_str(), selectionResult
.c_str(), FALSE
);
745 PostQuitMessage(FileTypeBase
);
747 if (picWindow3
== hSource
)
749 if (!selectionResult
.empty())
750 CopyFile(selectionPaths
[FileTypeTheirs
].c_str(), selectionResult
.c_str(), FALSE
);
751 PostQuitMessage(FileTypeTheirs
);
756 ::PostQuitMessage(0);
766 void CMainWindow::DrawXorBar(HDC hdc
, int x1
, int y1
, int width
, int height
)
768 static WORD _dotPatternBmp
[8] =
770 0x0055, 0x00aa, 0x0055, 0x00aa,
771 0x0055, 0x00aa, 0x0055, 0x00aa
775 HBRUSH hbr
, hbrushOld
;
777 hbm
= CreateBitmap(8, 8, 1, 1, _dotPatternBmp
);
778 hbr
= CreatePatternBrush(hbm
);
780 SetBrushOrgEx(hdc
, x1
, y1
, 0);
781 hbrushOld
= (HBRUSH
)SelectObject(hdc
, hbr
);
783 PatBlt(hdc
, x1
, y1
, width
, height
, PATINVERT
);
785 SelectObject(hdc
, hbrushOld
);
791 LRESULT
CMainWindow::Splitter_OnLButtonDown(HWND hwnd
, UINT
/*iMsg*/, WPARAM
/*wParam*/, LPARAM lParam
)
798 pt
.x
= (short)LOWORD(lParam
); // horizontal position of cursor
799 pt
.y
= (short)HIWORD(lParam
);
801 GetClientRect(hwnd
, &clientrect
);
802 GetWindowRect(hwnd
, &rect
);
804 ClientToScreen(hwnd
, &zero
);
805 OffsetRect(&clientrect
, zero
.x
-rect
.left
, zero
.y
-rect
.top
);
807 ClientToScreen(hwnd
, &pt
);
808 // find out which drag bar is used
810 if (!selectionPaths
.empty())
813 GetWindowRect(picWindow2
, &pic2Rect
);
816 if (pic2Rect
.bottom
<= pt
.y
)
821 if (pic2Rect
.right
<= pt
.x
)
826 //convert the mouse coordinates relative to the top-left of
831 //same for the window coordinates - make them relative to 0,0
832 OffsetRect(&rect
, -rect
.left
, -rect
.top
);
836 if (pt
.x
> rect
.right
-4)
840 if (pt
.y
> rect
.bottom
-4)
841 pt
.y
= rect
.bottom
-4;
847 hdc
= GetWindowDC(hwnd
);
849 DrawXorBar(hdc
, clientrect
.left
, pt
.y
+2, clientrect
.right
-clientrect
.left
-2, 4);
851 DrawXorBar(hdc
, pt
.x
+2, clientrect
.top
, 4, clientrect
.bottom
-clientrect
.top
-2);
852 ReleaseDC(hwnd
, hdc
);
860 void CMainWindow::Splitter_CaptureChanged()
865 LRESULT
CMainWindow::Splitter_OnLButtonUp(HWND hwnd
, UINT
/*iMsg*/, WPARAM
/*wParam*/, LPARAM lParam
)
872 pt
.x
= (short)LOWORD(lParam
); // horizontal position of cursor
873 pt
.y
= (short)HIWORD(lParam
);
875 if (bDragMode
== FALSE
)
878 GetClientRect(hwnd
, &clientrect
);
879 GetWindowRect(hwnd
, &rect
);
881 ClientToScreen(hwnd
, &zero
);
882 OffsetRect(&clientrect
, zero
.x
-rect
.left
, zero
.y
-rect
.top
);
884 ClientToScreen(hwnd
, &pt
);
888 OffsetRect(&rect
, -rect
.left
, -rect
.top
);
892 if (pt
.x
> rect
.right
-4)
896 if (pt
.y
> rect
.bottom
-4)
897 pt
.y
= rect
.bottom
-4;
899 hdc
= GetWindowDC(hwnd
);
901 DrawXorBar(hdc
, clientrect
.left
, oldy
+2, clientrect
.right
-clientrect
.left
-2, 4);
903 DrawXorBar(hdc
, oldx
+2, clientrect
.top
, 4, clientrect
.bottom
-clientrect
.top
-2);
904 ReleaseDC(hwnd
, hdc
);
911 //convert the splitter position back to screen coords.
912 GetWindowRect(hwnd
, &rect
);
916 //now convert into CLIENT coordinates
917 ScreenToClient(hwnd
, &pt
);
918 GetClientRect(hwnd
, &rect
);
919 #define MINWINSIZE 10
924 if (pt
.y
< (nSplitterPos
+MINWINSIZE
))
925 pt
.y
= nSplitterPos
+MINWINSIZE
;
926 nSplitterPos2
= pt
.y
;
930 if (pt
.y
> (nSplitterPos2
-MINWINSIZE
))
931 pt
.y
= nSplitterPos2
-MINWINSIZE
;
939 if (pt
.x
< (nSplitterPos
+MINWINSIZE
))
940 pt
.x
= nSplitterPos
+MINWINSIZE
;
941 nSplitterPos2
= pt
.x
;
945 if (pt
.x
> (nSplitterPos2
-MINWINSIZE
))
946 pt
.x
= nSplitterPos2
-MINWINSIZE
;
953 //position the child controls
954 PositionChildren(&rect
);
958 LRESULT
CMainWindow::Splitter_OnMouseMove(HWND hwnd
, UINT
/*iMsg*/, WPARAM wParam
, LPARAM lParam
)
966 if (bDragMode
== FALSE
)
969 pt
.x
= (short)LOWORD(lParam
); // horizontal position of cursor
970 pt
.y
= (short)HIWORD(lParam
);
972 GetClientRect(hwnd
, &clientrect
);
973 GetWindowRect(hwnd
, &rect
);
975 ClientToScreen(hwnd
, &zero
);
976 OffsetRect(&clientrect
, zero
.x
-rect
.left
, zero
.y
-rect
.top
);
978 //convert the mouse coordinates relative to the top-left of
980 ClientToScreen(hwnd
, &pt
);
984 //same for the window coordinates - make them relative to 0,0
985 OffsetRect(&rect
, -rect
.left
, -rect
.top
);
989 if (pt
.x
> rect
.right
-4)
993 if (pt
.y
> rect
.bottom
-4)
994 pt
.y
= rect
.bottom
-4;
996 if ((wParam
& MK_LBUTTON
) && ((bVertical
&& (pt
.y
!= oldy
)) || (!bVertical
&& (pt
.x
!= oldx
))))
998 hdc
= GetWindowDC(hwnd
);
1002 DrawXorBar(hdc
, clientrect
.left
, oldy
+2, clientrect
.right
-clientrect
.left
-2, 4);
1003 DrawXorBar(hdc
, clientrect
.left
, pt
.y
+2, clientrect
.right
-clientrect
.left
-2, 4);
1007 DrawXorBar(hdc
, oldx
+2, clientrect
.top
, 4, clientrect
.bottom
-clientrect
.top
-2);
1008 DrawXorBar(hdc
, pt
.x
+2, clientrect
.top
, 4, clientrect
.bottom
-clientrect
.top
-2);
1011 ReleaseDC(hwnd
, hdc
);
1020 bool CMainWindow::OpenDialog()
1022 return (DialogBox(hResource
, MAKEINTRESOURCE(IDD_OPEN
), *this, (DLGPROC
)OpenDlgProc
)==IDOK
);
1025 BOOL CALLBACK
CMainWindow::OpenDlgProc(HWND hwndDlg
, UINT message
, WPARAM wParam
, LPARAM
/*lParam*/)
1031 // center on the parent window
1032 HWND hParentWnd
= ::GetParent(hwndDlg
);
1033 RECT parentrect
, childrect
, centeredrect
;
1034 GetWindowRect(hParentWnd
, &parentrect
);
1035 GetWindowRect(hwndDlg
, &childrect
);
1036 centeredrect
.left
= parentrect
.left
+ ((parentrect
.right
-parentrect
.left
-childrect
.right
+childrect
.left
)/2);
1037 centeredrect
.right
= centeredrect
.left
+ (childrect
.right
-childrect
.left
);
1038 centeredrect
.top
= parentrect
.top
+ ((parentrect
.bottom
-parentrect
.top
-childrect
.bottom
+childrect
.top
)/2);
1039 centeredrect
.bottom
= centeredrect
.top
+ (childrect
.bottom
-childrect
.top
);
1040 SetWindowPos(hwndDlg
, NULL
, centeredrect
.left
, centeredrect
.top
, centeredrect
.right
-centeredrect
.left
, centeredrect
.bottom
-centeredrect
.top
, SWP_SHOWWINDOW
);
1042 if (!leftpicpath
.empty())
1043 SetDlgItemText(hwndDlg
, IDC_LEFTIMAGE
, leftpicpath
.c_str());
1048 switch (LOWORD(wParam
))
1050 case IDC_LEFTBROWSE
:
1052 TCHAR path
[MAX_PATH
] = {0};
1053 if (AskForFile(hwndDlg
, path
))
1055 SetDlgItemText(hwndDlg
, IDC_LEFTIMAGE
, path
);
1059 case IDC_RIGHTBROWSE
:
1061 TCHAR path
[MAX_PATH
] = {0};
1062 if (AskForFile(hwndDlg
, path
))
1064 SetDlgItemText(hwndDlg
, IDC_RIGHTIMAGE
, path
);
1070 TCHAR path
[MAX_PATH
] = {0};
1071 if (!GetDlgItemText(hwndDlg
, IDC_LEFTIMAGE
, path
, _countof(path
)))
1074 if (!GetDlgItemText(hwndDlg
, IDC_RIGHTIMAGE
, path
, _countof(path
)))
1076 rightpicpath
= path
;
1080 EndDialog(hwndDlg
, wParam
);
1087 bool CMainWindow::AskForFile(HWND owner
, TCHAR
* path
)
1089 OPENFILENAME ofn
= {0}; // common dialog box structure
1090 // Initialize OPENFILENAME
1091 ofn
.lStructSize
= sizeof(OPENFILENAME
);
1092 ofn
.hwndOwner
= owner
;
1093 ofn
.lpstrFile
= path
;
1094 ofn
.nMaxFile
= MAX_PATH
;
1095 ResString
sTitle(::hResource
, IDS_OPENIMAGEFILE
);
1096 ofn
.lpstrTitle
= sTitle
;
1097 ofn
.Flags
= OFN_DONTADDTORECENT
| OFN_FILEMUSTEXIST
| OFN_EXPLORER
;
1098 ofn
.hInstance
= ::hResource
;
1099 TCHAR filters
[] = _T("Images\0*.wmf;*.jpg;*jpeg;*.bmp;*.gif;*.png;*.ico;*.dib;*.emf\0All (*.*)\0*.*\0\0");
1100 ofn
.lpstrFilter
= filters
;
1101 ofn
.nFilterIndex
= 1;
1102 // Display the Open dialog box.
1103 if (GetOpenFileName(&ofn
)==FALSE
)
1110 bool CMainWindow::CreateToolbar()
1112 // Ensure that the common control DLL is loaded.
1113 INITCOMMONCONTROLSEX icex
;
1114 icex
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
1115 icex
.dwICC
= ICC_BAR_CLASSES
| ICC_WIN95_CLASSES
;
1116 InitCommonControlsEx(&icex
);
1118 hwndTB
= CreateWindowEx(0,
1121 WS_CHILD
| WS_BORDER
| WS_VISIBLE
| TBSTYLE_FLAT
| TBSTYLE_TOOLTIPS
,
1124 (HMENU
)IDC_TORTOISEIDIFF
,
1127 if (hwndTB
== INVALID_HANDLE_VALUE
)
1130 SendMessage(hwndTB
, TB_BUTTONSTRUCTSIZE
, (WPARAM
) sizeof(TBBUTTON
), 0);
1133 // create an imagelist containing the icons for the toolbar
1134 hToolbarImgList
= ImageList_Create(24, 24, ILC_COLOR32
| ILC_MASK
, 12, 4);
1135 if (hToolbarImgList
== NULL
)
1139 if (selectionPaths
.empty())
1141 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_OVERLAP
));
1142 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1143 tbb
[index
].idCommand
= ID_VIEW_OVERLAPIMAGES
;
1144 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1145 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1146 tbb
[index
].dwData
= 0;
1147 tbb
[index
++].iString
= 0;
1149 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_BLEND
));
1150 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1151 tbb
[index
].idCommand
= ID_VIEW_BLENDALPHA
;
1152 tbb
[index
].fsState
= 0;
1153 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1154 tbb
[index
].dwData
= 0;
1155 tbb
[index
++].iString
= 0;
1157 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_LINK
));
1158 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1159 tbb
[index
].idCommand
= ID_VIEW_LINKIMAGESTOGETHER
;
1160 tbb
[index
].fsState
= TBSTATE_ENABLED
| TBSTATE_CHECKED
;
1161 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1162 tbb
[index
].dwData
= 0;
1163 tbb
[index
++].iString
= 0;
1165 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_FITWIDTHS
));
1166 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1167 tbb
[index
].idCommand
= ID_VIEW_FITIMAGEWIDTHS
;
1168 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1169 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1170 tbb
[index
].dwData
= 0;
1171 tbb
[index
++].iString
= 0;
1173 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_FITHEIGHTS
));
1174 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1175 tbb
[index
].idCommand
= ID_VIEW_FITIMAGEHEIGHTS
;
1176 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1177 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1178 tbb
[index
].dwData
= 0;
1179 tbb
[index
++].iString
= 0;
1181 tbb
[index
].iBitmap
= 0;
1182 tbb
[index
].idCommand
= 0;
1183 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1184 tbb
[index
].fsStyle
= BTNS_SEP
;
1185 tbb
[index
].dwData
= 0;
1186 tbb
[index
++].iString
= 0;
1188 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_VERTICAL
));
1189 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1190 tbb
[index
].idCommand
= ID_VIEW_ARRANGEVERTICAL
;
1191 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1192 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1193 tbb
[index
].dwData
= 0;
1194 tbb
[index
++].iString
= 0;
1196 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_FITINWINDOW
));
1197 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1198 tbb
[index
].idCommand
= ID_VIEW_FITIMAGESINWINDOW
;
1199 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1200 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1201 tbb
[index
].dwData
= 0;
1202 tbb
[index
++].iString
= 0;
1204 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_ORIGSIZE
));
1205 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1206 tbb
[index
].idCommand
= ID_VIEW_ORININALSIZE
;
1207 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1208 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1209 tbb
[index
].dwData
= 0;
1210 tbb
[index
++].iString
= 0;
1212 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_ZOOMIN
));
1213 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1214 tbb
[index
].idCommand
= ID_VIEW_ZOOMIN
;
1215 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1216 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1217 tbb
[index
].dwData
= 0;
1218 tbb
[index
++].iString
= 0;
1220 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_ZOOMOUT
));
1221 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1222 tbb
[index
].idCommand
= ID_VIEW_ZOOMOUT
;
1223 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1224 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1225 tbb
[index
].dwData
= 0;
1226 tbb
[index
++].iString
= 0;
1228 tbb
[index
].iBitmap
= 0;
1229 tbb
[index
].idCommand
= 0;
1230 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1231 tbb
[index
].fsStyle
= BTNS_SEP
;
1232 tbb
[index
].dwData
= 0;
1233 tbb
[index
++].iString
= 0;
1235 hIcon
= LoadIcon(hResource
, MAKEINTRESOURCE(IDI_IMGINFO
));
1236 tbb
[index
].iBitmap
= ImageList_AddIcon(hToolbarImgList
, hIcon
);
1237 tbb
[index
].idCommand
= ID_VIEW_IMAGEINFO
;
1238 tbb
[index
].fsState
= TBSTATE_ENABLED
;
1239 tbb
[index
].fsStyle
= BTNS_BUTTON
;
1240 tbb
[index
].dwData
= 0;
1241 tbb
[index
++].iString
= 0;
1243 SendMessage(hwndTB
, TB_SETIMAGELIST
, 0, (LPARAM
)hToolbarImgList
);
1244 SendMessage(hwndTB
, TB_ADDBUTTONS
, (WPARAM
)index
, (LPARAM
) (LPTBBUTTON
) &tbb
);
1245 SendMessage(hwndTB
, TB_AUTOSIZE
, 0, 0);
1246 ShowWindow(hwndTB
, SW_SHOW
);
1250 void CMainWindow::SetSelectionImage( FileType ft
, const std::wstring
& path
, const std::wstring
& title
)
1252 selectionPaths
[ft
] = path
;
1253 selectionTitles
[ft
] = title
;