- visual_java_demo.zip
- bcgcb453d.dll
- bcgcb453d.exp
- bcgcb453d.lib
- edtlibd.dll
- edtlibd.exp
- edtlibd.lib
- file0
- USRIMGS.BMP
- VisualJava.exe
- visual_java_src.zip
- BATCH
- CLEAN.BAT
- MAKEBIN.BAT
- MAKEHELP.BAT
- RELEASE.BAT
- RELUSE.BAT
- USE.BAT
- BCGLIB
- CEXPAND.REG
- codetemplates__1.txt
- DISTRIB
- EDITPAD.TIP
- USRIMGS.BMP
- EDITPAD.DSP
- EDITPAD.DSW
- EDTLIB
- README.TXT
- VisualJava
- visual_java_demo1.zip
- bcgcb453d.dll
- bcgcb453d.exp
- bcgcb453d.lib
- edtlibd.dll
- edtlibd.exp
- edtlibd.lib
- USRIMGS.BMP
- VisualJava.exe
|
// FileOpenDlgEx.cpp : implementation file
//
#include "stdafx.h"
#include "VisualJava.h"
#include "FileOpenDlgEx.h"
#include <dlgs.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFileOpenDlgEx
IMPLEMENT_DYNAMIC(CFileOpenDlgEx, CFileDialog)
CFileOpenDlgEx::CFileOpenDlgEx(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
m_ofn.Flags |= OFN_EXPLORER|OFN_ENABLETEMPLATE;
m_ofn.lpTemplateName = MAKEINTRESOURCE (CFileOpenDlgEx::IDD);
m_szBigBuffer[0]='\0';
m_ofn.lpstrFile = m_szBigBuffer;
if (dwFlags & OFN_ALLOWMULTISELECT)
{
// MFC only provides a 260 character buffer for lpstrFile
// This is not sufficient when you may be expecting a large number of files.
m_ofn.nMaxFile = sizeof(m_szBigBuffer);
if (lpszFileName != NULL)
lstrcpyn(m_szBigBuffer, lpszFileName, sizeof(m_szBigBuffer));
}
else
m_ofn.nMaxFile = _MAX_PATH;
}
BEGIN_MESSAGE_MAP(CFileOpenDlgEx, CFileDialog)
//{{AFX_MSG_MAP(CFileOpenDlgEx)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CFileOpenDlgEx::DoDataExchange(CDataExchange* pDX)
{
CFileDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAppType)
// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Text(pDX,IDC_COMBO_FORMAT, m_szpFormat);
//}}AFX_DATA_MAP
}
BOOL CFileOpenDlgEx::OnInitDialog()
{
CFileDialog::OnInitDialog();
if(m_ofn.Flags & OFN_HIDEREADONLY)
{
GetDlgItem(IDC_COMBO_FORMAT)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_OPENAS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_FOLDER)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_STATIC_FOLDER)->SetWindowText(m_folder);
}
else
{
CComboBox* wndCombo = (CComboBox*)GetDlgItem(IDC_COMBO_FORMAT);
wndCombo->AddString("Auto");
wndCombo->AddString("Text");
wndCombo->AddString("Binary");
wndCombo->AddString("Resource");
wndCombo->SetCurSel(0);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFileOpenDlgEx::HideReadOnly(CString szpMsg)
{
m_folder = szpMsg;
m_ofn.Flags |= OFN_HIDEREADONLY;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.