⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chscwiz.h

📁 Windows上的MUD客户端程序
💻 H
字号:
/*----------------------------------------------------------------------------
                        _                              _ _       
        /\             | |                            | (_)      
       /  \   _ __   __| |_ __ ___  _ __ ___   ___  __| |_  __ _ 
      / /\ \ | '_ \ / _` | '__/ _ \| '_ ` _ \ / _ \/ _` | |/ _` |
     / ____ \| | | | (_| | | | (_) | | | | | |  __/ (_| | | (_| |
    /_/    \_\_| |_|\__,_|_|  \___/|_| |_| |_|\___|\__,_|_|\__,_|

    The contents of this file are subject to the Andromedia Public
	License Version 1.0 (the "License"); you may not use this file
	except in compliance with the License. You may obtain a copy of
	the License at http://www.andromedia.com/APL/

    Software distributed under the License is distributed on an
	"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
	implied. See the License for the specific language governing
	rights and limitations under the License.

    The Original Code is Pueblo client code, released November 4, 1998.

    The Initial Developer of the Original Code is Andromedia Incorporated.
	Portions created by Andromedia are Copyright (C) 1998 Andromedia
	Incorporated.  All Rights Reserved.

	Andromedia Incorporated                         415.365.6700
	818 Mission Street - 2nd Floor                  415.365.6701 fax
	San Francisco, CA 94103

    Contributor(s):
	--------------------------------------------------------------------------
	   Chaco team:  Dan Greening, Glenn Crocker, Jim Doubek,
	                Coyote Lussier, Pritham Shetty.

					Wrote and designed original codebase.

------------------------------------------------------------------------------

	Contains the interface for the ChShortcutWizard class, which is
	a Wizard for creating a desktop shortcut file.

----------------------------------------------------------------------------*/

// $Header: /home/cvs/chaco/modules/client/msw/ChWorld/ChSCWiz.h,v 2.12 1996/09/12 19:10:04 pritham Exp $

#if !defined( _CHSCWIZ_H )
#define _CHSCWIZ_H

#if !defined(CH_PUEBLO_PLUGIN)
#include "resource.h"
#else
#include "vwrres.h"
#endif

#include <ChWizard.h>


class ChShortcutWizard;


/*----------------------------------------------------------------------------
	ChShortcutWizName class
----------------------------------------------------------------------------*/

class ChShortcutWizName : public ChWizardPage
{
	DECLARE_DYNCREATE( ChShortcutWizName )

	public:
		enum { constNameLimit = 30 };

	public:
		ChShortcutWizName();
		~ChShortcutWizName();

		inline const string& GetPath() { return m_strPath; }
		inline const string& GetName() { return m_strName; }
		inline string GetFilePath()
				{
					string	strFilePath( GetPath() );

					strFilePath += "\\" + GetFilename();

					return strFilePath;
				}
		inline void SetName( const string& strName )
				{
					m_strName = strName;
				}
		inline void SetPath( const string& strPath )
				{
					m_strPath = strPath;
				}

		virtual bool OnInitPage();			/* Called when this page gets
												the focus */
		virtual bool OnNext();

		const string& GetFilename();
											// Dialog Data
		//{{AFX_DATA(ChShortcutWizName)
		enum { IDD = IDD_SHORTCUT_WIZ_NAME };
		CButton	m_checkCurrWorld;
		CEdit	m_editName;
		CString	m_strName;
		BOOL	m_boolCurrWorld;
		//}}AFX_DATA
											/* ClassWizard generate virtual
												function overrides */
		//{{AFX_VIRTUAL(ChShortcutWizName)
		protected:
		virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
		//}}AFX_VIRTUAL

	protected:
		void GetMangledFilename( string& strFilename );
		void StripChars( string& strData, const string& strChars );

	protected:
											// Generated message map functions
		//{{AFX_MSG(ChShortcutWizName)
	//}}AFX_MSG

	protected:
		ChShortcutWizard*		m_pWiz;
		string					m_strPath;
		string					m_strFilename;

	DECLARE_MESSAGE_MAP()
};


/*----------------------------------------------------------------------------
	ChShortcutWizServer class
----------------------------------------------------------------------------*/

class ChShortcutWizServer : public ChWizardPage
{
	DECLARE_DYNCREATE( ChShortcutWizServer )

	public:
		enum { constHostLimit = 64, constPortLimit = 4 };

	public:
		ChShortcutWizServer();
		~ChShortcutWizServer();

		virtual bool OnInitPage();			/* Called when this page gets
												the focus */
		virtual bool OnNext();

		inline void Get( string& strHost, chint16& sPort,
									ChWorldType& type ) const
				{
					strHost = m_strHost;
					sPort = (chint16)m_iPort;
					type = m_type;
				}
		inline void Set( const string& strHost, chint16 sPort,
							const ChWorldType& type )
				{
					m_strHost = strHost;
					m_iPort = sPort;
					m_type = type;
				}
											// Dialog Data
		//{{AFX_DATA(ChShortcutWizServer)
		enum { IDD = IDD_SHORTCUT_WIZ_SERVER };
		CEdit	m_editPort;
		CEdit	m_editHost;
		CComboBox	m_comboTypes;
		CString	m_strType;
		CString	m_strHost;
		int		m_iPort;
		//}}AFX_DATA
											/* ClassWizard generate virtual
												function overrides */
		//{{AFX_VIRTUAL(ChShortcutWizServer)
		protected:
		virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
		//}}AFX_VIRTUAL

	protected:
											// Generated message map functions
		//{{AFX_MSG(ChShortcutWizServer)
		//}}AFX_MSG

	protected:
		ChWorldType		m_type;

	DECLARE_MESSAGE_MAP()
};


/*----------------------------------------------------------------------------
	ChShortcutWizUsername class
----------------------------------------------------------------------------*/

class ChShortcutWizUsername : public ChWizardPage
{
	DECLARE_DYNCREATE( ChShortcutWizUsername )

	public:
		enum { constUsernameLimit = 30, constPasswordLimit = 30 };

	public:
		ChShortcutWizUsername();
		~ChShortcutWizUsername();

		virtual bool OnInitPage();			/* Called when this page gets
												the focus */

		inline void GetAccount( string& strUsername, string& strPassword,
								ChLoginType& loginType )
				{
					strUsername = m_strUsername;
					strPassword = m_strPassword;
					loginType = m_loginType;
				}
		inline void Set( const string& strUsername, const string& strPassword,
							ChLoginType loginType )
				{
					m_strUsername = strUsername;
					m_strPassword = strPassword;
					m_loginType = loginType;
				}
											// Dialog Data
		//{{AFX_DATA(ChShortcutWizUsername)
		enum { IDD = IDD_SHORTCUT_WIZ_USERNAME };
		CButton	m_staticLoginStyle;
		CButton	m_radioMudLogin;
		CButton	m_radioConnectLogin;
		CEdit	m_editPassword;
		CEdit	m_editUsername;
		CString	m_strPassword;
		CString	m_strUsername;
		int		m_iLoginStyle;
		//}}AFX_DATA
											/* ClassWizard generate virtual
												function overrides */
		//{{AFX_VIRTUAL(ChShortcutWizUsername)
		protected:
		virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
		//}}AFX_VIRTUAL

	protected:
											// Generated message map functions
		//{{AFX_MSG(ChShortcutWizUsername)
		afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
		//}}AFX_MSG

	protected:
		ChWorldType		m_type;
		ChLoginType		m_loginType;

	DECLARE_MESSAGE_MAP()
};


/*----------------------------------------------------------------------------
	ChShortcutWizOptions class
----------------------------------------------------------------------------*/

class ChShortcutWizOptions : public ChWizardPage
{
	DECLARE_DYNCREATE( ChShortcutWizOptions )

	public:
		ChShortcutWizOptions();
		~ChShortcutWizOptions();

		inline const string& GetGroupName() { return m_strGroup; }

		virtual bool OnInitPage();			/* Called when this page gets
												the focus */

											// Dialog Data
		//{{AFX_DATA(ChShortcutWizOptions)
		enum { IDD = IDD_SHORTCUT_WIZ_OPTIONS };
		CComboBox	m_comboShortcutFolder;
		CStatic	m_staticShortcutMsg;
		CString	m_strGroup;
		//}}AFX_DATA
											/* ClassWizard generate virtual
												function overrides */
		//{{AFX_VIRTUAL(ChShortcutWizOptions)
		protected:
		virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
		//}}AFX_VIRTUAL

	protected:
		void SetupForProgman();

	protected:
											// Generated message map functions
		//{{AFX_MSG(ChShortcutWizOptions)
			// NOTE: the ClassWizard will add member functions here
		//}}AFX_MSG

		DECLARE_MESSAGE_MAP()
};


/*----------------------------------------------------------------------------
	ChShortcutWizFinish class
----------------------------------------------------------------------------*/

class ChShortcutWizFinish : public ChWizardPage
{
	DECLARE_DYNCREATE( ChShortcutWizFinish )

	public:
		ChShortcutWizFinish();
		~ChShortcutWizFinish();

		virtual bool OnInitPage();			/* Called when this page gets
												the focus */

											// Dialog Data
		//{{AFX_DATA(ChShortcutWizFinish)
		enum { IDD = IDD_SHORTCUT_WIZ_FINISH };
		CStatic	m_staticFinishSysMsg;
		CStatic	m_staticFinishMsg;
		//}}AFX_DATA
											/* ClassWizard generate virtual
												function overrides */
		//{{AFX_VIRTUAL(ChShortcutWizFinish)
		protected:
		virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
		//}}AFX_VIRTUAL

	protected:
											// Generated message map functions
		//{{AFX_MSG(ChShortcutWizFinish)
			// NOTE: the ClassWizard will add member functions here
		//}}AFX_MSG

		DECLARE_MESSAGE_MAP()
};


/*----------------------------------------------------------------------------
	ChShortcutWizard class
----------------------------------------------------------------------------*/

class ChShortcutWizard : public ChWizard
{
	DECLARE_DYNAMIC( ChShortcutWizard )

	public:
		ChShortcutWizard( CWnd* pParentWnd = 0 );
		virtual ~ChShortcutWizard();

		inline void GetAccount( string& strUsername, string& strPassword,
								ChLoginType& loginType )
				{
					m_usernamePage.GetAccount( strUsername, strPassword,
												loginType );
				}
		inline void GetData( string& strGroupName, string& strName )
				{
					strGroupName = m_optionsPage.GetGroupName();
					strName = m_namePage.GetName();
				}
		inline void GetData( string& strPath, string& strFilepath,
								string& strGroupName, string& strName )
				{
					strPath = m_namePage.GetPath();
					strFilepath = m_namePage.GetFilePath();
					strGroupName = m_optionsPage.GetGroupName();
					strName = m_namePage.GetName();
				}
		inline void GetServer( string& strHost, chint16& sPort,
									ChWorldType& type )
				{
					m_serverPage.Get( strHost, sPort, type );
				}

		inline void SetAccount( const string& strUsername,
								const string& strPassword,
								ChLoginType loginType )
				{
					m_usernamePage.Set( strUsername, strPassword, loginType );
				}
		inline void SetName( const string& strName )
				{
					m_namePage.SetName( strName );
				}
		inline void SetPath( const string& strPath )
				{
					m_namePage.SetPath( strPath );
				}
		inline void SetServer( const string& strHost, chint16 sPort,
								const ChWorldType& type )
				{
					m_serverPage.Set( strHost, sPort, type );
				}
		inline bool UseCurrWorld() { return m_boolUseCurrWorld; }
		inline bool EnableUseCurrWorld() { return m_boolEnableCurrWorld; }
		inline void SetUseCurrWorld( bool boolUseCurrWorld = true )
				{
					m_boolEnableCurrWorld =
						m_boolUseCurrWorld = boolUseCurrWorld;
				}

		virtual chint32 OnBack();
		virtual chint32 OnNext();
											/* ClassWizard generated virtual
												function overrides */
		//{{AFX_VIRTUAL(ChShortcutWizard)
		//}}AFX_VIRTUAL

	protected:
		void AddPages();

	protected:
		//{{AFX_MSG(ChShortcutWizard)
		//}}AFX_MSG

	protected:
		ChShortcutWizName		m_namePage;
		ChShortcutWizServer		m_serverPage;
		ChShortcutWizUsername	m_usernamePage;
		ChShortcutWizOptions	m_optionsPage;
		ChShortcutWizFinish		m_finishPage;

		bool					m_boolUseCurrWorld;
		bool					m_boolEnableCurrWorld;

		DECLARE_MESSAGE_MAP()
};


#endif	// !defined( _CHSCWIZ_H )

// Local Variables: ***
// tab-width:4 ***
// End: ***

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -