forked from mcneel/rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLBPPreviewingFileDialog.h
72 lines (54 loc) · 2.05 KB
/
LBPPreviewingFileDialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#ifndef LBPEXPORT
#define LBPEXPORT
#endif
#if !defined LBPLIB_DISABLE_MFC_CONTROLS
class CLBPBitmapPreview;
class LBPEXPORT CLBPPreviewingFileDialog : public CFileDialog
{
public:
CLBPPreviewingFileDialog(BOOL bOpenFileDialog, LPCTSTR lpszDefExt=NULL, LPCTSTR lpszFileName=NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter=NULL, CWnd* pParentWnd=NULL);
virtual ~CLBPPreviewingFileDialog();
int PreviewSize(void) const;
void SetPreviewSize(int iSize);
virtual INT_PTR DoModal();
virtual bool ShowPreviewOn(void) const { return m_bShowPreview; }
virtual void SetShowPreviewOn(bool b) { m_bShowPreview = b; }
protected:
afx_msg void OnCheckPreview();
DECLARE_MESSAGE_MAP()
protected:
// Override these functions to provide custom resource support (ie - not LBPLibResources.dll)
virtual HINSTANCE ResourceInstance() const;
/* case 0: return IDD_LBP_PREVIEWING_FILE_DIALOG;
case 1: return IDC_CHECK_PREVIEW;
case 2: return IDC_STATIC_PREVIEW;
case 3: return IDC_PROGRESS1;
*/ virtual DWORD ResourceID(DWORD OriginalID) const;
protected:
// Override this to get the preview bitmap in a different way than using the shell.
virtual HBITMAP GetPreviewBitmap(const CSize& size, CProgressCtrl& progress);
protected:
virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
virtual void OnSize(UINT nType, int cx, int cy);
virtual void OnFileNameChange();
virtual void OnFolderChange();
virtual BOOL OnCommand(WPARAM wParam,LPARAM lParam);
IShellBrowser* GetBrowserInterface(void) const;
LPITEMIDLIST GetSelectionPidl(LPDATAOBJECT pDO);
HRESULT GetFolderViewObject(IFolderView** ppFV);
HRESULT GetSelectionObject(IDataObject** ppDO, bool bSelected);
HBITMAP ExtractThumbnailImage(const CSize& size, LPCITEMIDLIST pidl);
CButton& PreviewCheck(void) { return m_checkPreview; }
private:
CStatic m_static;
CButton m_checkPreview;
int m_iPreviewSize;
CProgressCtrl m_progress;
CLBPBitmapPreview* m_pPreview;
int m_iControls[4];
static bool m_bShowPreview;
};
#endif