home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 13
/
mediashare_13.zip
/
mediashare_13
/
ZIPPED
/
PROGRAM
/
WTJ9403.ZIP
/
WILDASS
/
SOURCE
/
XFILEDLG.H
< prev
Wrap
C/C++ Source or Header
|
1993-08-10
|
4KB
|
121 lines
// ///////////////////////////////////////////////////////////////////////////
// xfiledlg.h - real world common file dialog and derived classes
//
// classes that are defined within
// - XFileDlg
// |- XDirectoryDialog
//
// update: 07-Feb-1993 thomas woelfer
// 14-Feb-1993 thomas woelfer - final fixes
// 10-Mar-1993 thomas woelfer - 3d controls under nt too
// 08-Aug-1993 tw changed to work with morespace
// NT support removed
// ///////////////////////////////////////////////////////////////////////////
#ifndef _INC_XFILEDLG
#define _INC_XFILEDLG
#include <dlgs.h>
/* ************************************************************************ *\
* name: XFileDialog
*
* a real world file dialog using the common dialogs. the dialog may
* be resized to use the full screen estate height.
*
* further reference can be found in the winhelp felp file xfiledlg.hlp
*
* update: 07-Feb-1993 thomas woelfer
*
\* ************************************************************************ */
class XFileDialog : public CFileDialog
{
private:
int m_xLeft; // Left Border of "leftie" Controls in Dialog
// Used by StretchToFitLeft() memFxt
int m_cyOffset; // Offset for new vertical size
CString m_strDlgTitel; // initial Title of dialog
// Offset Control to fit new vert. size
void OffsetCtrlY( const int nID ) const;
// Stretch to new vert. size
void StretchToFitVerticaly( const int nID ) const;
public:
XFileDialog( const char* DlgTitel, // caption
BOOL bIsOpenDlg, // open/close flag
const char* szDefExt = "", // default extension
const char* szFileName = NULL , // default filename
DWORD dwFlags = OFN_HIDEREADONLY | // other flags
OFN_OVERWRITEPROMPT,
const char* szFilter = "all(*.*)|*.*||", // our default filter
CWnd* pParent = NULL )
: CFileDialog( bIsOpenDlg, szDefExt, szFileName, dwFlags, szFilter,
pParent )
{
m_strDlgTitel = DlgTitel;
}
BOOL OnInitDialog(); // that one does the resizing stuff
// this is only used for 3d ctls
// HBRUSH OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor );
// don`t need a message map without ctl3d
// DECLARE_MESSAGE_MAP();
protected:
void HideCtrl( const int nID ); // Hide a cntrl
// Stretch a control so it fits to the left side of the left side ctrls
void StretchToFitLeft( const int nID ) const;
void StretchToFitRight( const int nID ) const;
};
/* ************************************************************************ *\
* name: XDirectoryDialog
*
* directory picker dialog
*
* further reference can be found in the winhelp felp file xfiledlg.hlp
*
* update: 07-Feb-1993 thomas woelfer
*
\* ************************************************************************ */
class XDirectoryDialog : public XFileDialog // Directory select ...
{
public:
XDirectoryDialog( const char* DlgTitel )
: XFileDialog( DlgTitel, TRUE, "*" )
{}
CString GetPathName() const; // override this helper for ease of parsing
BOOL OnInitDialog()
{
VERIFY( XFileDialog::OnInitDialog());
HideCtrl( stc3 ); // Hide the stuff we dont want
HideCtrl( edt1 );
HideCtrl( lst1 );
HideCtrl( stc2 );
HideCtrl( cmb1 );
StretchToFitLeft( -1 ); // "Directories"
StretchToFitLeft( stc1 );
StretchToFitLeft( lst2 );
return TRUE;
}
};
#endif