亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? chwlistd.cpp

?? Windows上的MUD客戶端程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*----------------------------------------------------------------------------
                        _                              _ _       
        /\             | |                            | (_)      
       /  \   _ __   __| |_ __ ___  _ __ ___   ___  __| |_  __ _ 
      / /\ \ | '_ \ / _` | '__/ _ \| '_ ` _ \ / _ \/ _` | |/ _` |
     / ____ \| | | | (_| | | | (_) | | | | | |  __/ (_| | | (_| |
    /_/    \_\_| |_|\__,_|_|  \___/|_| |_| |_|\___|\__,_|_|\__,_|

    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.

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

	Implementation for the ChWorldListDlg class.

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

// $Header: /home/cvs/chaco/modules/client/msw/ChWorld/ChWListD.cpp,v 2.27 1996/09/12 19:10:10 pritham Exp $

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

#include <ChCore.h>
#include <ChUtil.h>

#include "ChWListD.h"


#ifdef _DEBUG
	#undef THIS_FILE
	static char BASED_CODE THIS_FILE[] = __FILE__;
#endif


/*----------------------------------------------------------------------------
	ChWorldListDlg class
----------------------------------------------------------------------------*/

ChWorldListDlg::ChWorldListDlg( ChCore* pCore, bool boolConnected, CWnd* pParent ) :
				ChDialog( 
#if defined( CH_PUEBLO_PLUGIN )
					(chparam)AfxGetInstanceHandle(), 
#else
					(chparam)ChWorldDLL.hModule, 
#endif
					ChWorldListDlg::IDD,
						pParent ),
				m_pCore( pCore ),
				m_boolConnected( boolConnected )
{
	//{{AFX_DATA_INIT(ChWorldListDlg)
	//}}AFX_DATA_INIT
}


void ChWorldListDlg::DoDataExchange( CDataExchange* pDX )
{
	CDialog::DoDataExchange( pDX );

	//{{AFX_DATA_MAP(ChWorldListDlg)
	DDX_Control(pDX, IDC_LIST_ADD, m_btnAdd);
	DDX_Control(pDX, IDC_LIST_EDIT, m_btnEdit);
	DDX_Control(pDX, IDC_LIST_DELETE, m_btnDelete);
	DDX_Control(pDX, IDC_LIST_CONNECT, m_btnConnect);
	DDX_Control(pDX, IDC_WORLD_LIST, m_listWorlds);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP( ChWorldListDlg, CDialog )
	//{{AFX_MSG_MAP( ChWorldListDlg )
	ON_BN_CLICKED(IDC_LIST_ADD, OnListAdd)
	ON_LBN_SELCHANGE(IDC_WORLD_LIST, OnSelchangeWorldList)
	ON_BN_CLICKED(IDC_LIST_DELETE, OnListDelete)
	ON_BN_CLICKED(IDC_LIST_CONNECT, OnListConnect)
	ON_BN_CLICKED(IDC_LIST_EDIT, OnListEdit)
	ON_BN_CLICKED(IDC_LIST_CREATE_SHORTCUT, OnListCreateShortcut)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/*----------------------------------------------------------------------------
	ChWorldListDlg protected methods
----------------------------------------------------------------------------*/
 
void ChWorldListDlg::Add( bool boolChange, const string& strName,
							const string& strDesc, const string& strHost,
							chint16 sPort, const ChWorldType& type,
							ChLoginType login, const string& strUsername,
							const string& strPassword,
							const string& strHomePage )
{
	if (!boolChange)
	{										// Add name to list box
		int		iIndex;

		iIndex = AddNameToList( strName, strUsername );

		if (LB_ERR != iIndex)
		{
			m_listWorlds.SetCurSel( iIndex );
			UpdateButtons();
		}
	}
											/* Add or change the item in the
												data structure */

	m_worldList.Add( strName, strDesc, strHost, sPort, type, login,
						strUsername, strPassword, strHomePage );
}


void ChWorldListDlg::UpdateButtons()
{
	bool		boolEnable;

	if (m_listWorlds.GetCurSel() != LB_ERR)
	{
		boolEnable = true;
	}
	else
	{
		boolEnable = false;
	}

	m_btnDelete.EnableWindow( boolEnable );
	m_btnEdit.EnableWindow( boolEnable );
											/* Only enable the connect button
												if we're not already
												connected */

	m_btnConnect.EnableWindow( boolEnable && !m_boolConnected );
}


void ChWorldListDlg::InstallWorldList()
{
	ChPosition	pos;

	pos = m_worldList.GetHead();

	while( pos )
	{
		ChWorldInfo*	pInfo;

		pInfo = m_worldList.GetData( pos );
		AddNameToList( pInfo->GetName(), pInfo->GetUsername() );
		m_worldList.GetNext( pos );
	}

	if (m_listWorlds.GetCount() > 0)
	{
		m_listWorlds.SetCurSel( 0 );
		OnSelchangeWorldList();
	}

	UpdateButtons();
}


void ChWorldListDlg::CreateShortcut()
{
	ChWorldInfo		info( GetName(), GetDesc(), GetHost(), GetPort(),
							GetType(), GetLoginType(), GetUsername(),
							GetPassword(), GetHomePage() );

	info.CreateShortcut( m_pCore );
}


int ChWorldListDlg::AddNameToList( const string& strName,
									const string& strUsername )
{
	string		strEntry( strName );

	if (!strUsername.IsEmpty())
	{
		strEntry += " ";
		strEntry += WORLD_NAME_SEPARATOR;
		strEntry += " " + strUsername;
	}

	return m_listWorlds.AddString( strEntry );
}


void ChWorldListDlg::ExtractName( const string& strListEntry, string& strName,
									string& strUsername )
{
	int		iLoc;

	if (-1 != (iLoc = strListEntry.Find( WORLD_NAME_SEPARATOR )))
	{
		strName = strListEntry.Left( iLoc - 1 );
		strUsername = strListEntry.Mid( iLoc + 2 );
	}
	else
	{
		strName = strListEntry;
		strUsername = "";
	}
}


/*----------------------------------------------------------------------------
	SyncDataFields

	This method will take the data for the currently selected item in
	the list and store this data in the dialog's data fields.
----------------------------------------------------------------------------*/

bool ChWorldListDlg::SyncDataFields()
{
	ChWorldInfo*	pInfo = GetCurrInfo();
	bool			boolSuccess;

	if (0 != pInfo)
	{
		m_strName = pInfo->GetName();
		m_strDesc = pInfo->GetDesc();
		m_strHost = pInfo->GetHost();
		m_strAddr = pInfo->GetAddr();
		m_sPort = pInfo->GetPort();
		m_type = pInfo->GetType();
		m_loginType = pInfo->GetLoginType();
		m_strUsername = pInfo->GetUsername();
		m_strPassword = pInfo->GetPassword();
		m_strHomePage = pInfo->GetHomePage();

		boolSuccess = true;
	}
	else
	{
		boolSuccess = false;
	}

	return boolSuccess;
}


ChWorldInfo* ChWorldListDlg::GetCurrInfo()
{
	ChWorldInfo	*pInfo;
	int			iSel;

	if (LB_ERR == (iSel = m_listWorlds.GetCurSel()))
	{
		pInfo = 0;
	}
	else
	{
		string		strItem;
		string		strName;
		string		strUsername;

		m_listWorlds.GetText( iSel, strItem );
		ExtractName( strItem, strName, strUsername );

		pInfo = m_worldList.FindName( strName, strUsername );
	}

	return pInfo;
}


void ChWorldListDlg::Delete( int iIndex )
{											/* Deletes an indexed item from
												the list */
	string		strEntry;
	string		strName;
	string		strUsername;
	int			iCount;

	m_listWorlds.GetText( iIndex, strEntry );
	ExtractName( strEntry, strName, strUsername );
	m_worldList.Remove( strName, strUsername );
	m_listWorlds.DeleteString( iIndex );

	iCount = m_listWorlds.GetCount();
	if (iCount > 0)
	{
		if (iIndex >= iCount)
		{
			iIndex = iCount - 1;
		}

		m_listWorlds.SetCurSel( iIndex );
	}
}


/*----------------------------------------------------------------------------
	ChWorldListDlg message handlers
----------------------------------------------------------------------------*/

bool ChWorldListDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	CenterWindow();

	InstallWorldList();
	UpdateButtons();

	if (m_listWorlds.GetCount() > 0 &&
		LB_ERR != m_listWorlds.GetCurSel())
	{
		m_listWorlds.SetFocus();
		m_listWorlds.SetCurSel( 0 );
	}
	else
	{
		m_btnAdd.SetFocus();
	}

	return false;
}


void ChWorldListDlg::OnOK() 
{
	CDialog::OnOK();

	m_worldList.Store();
}


void ChWorldListDlg::OnListCreateShortcut() 
{
	SyncDataFields();
	CreateShortcut();
}


void ChWorldListDlg::OnListConnect() 
{
	SyncDataFields();

	m_worldList.Store();
	EndDialog( IDC_LIST_CONNECT );
}


void ChWorldListDlg::OnListDelete() 
{
	int			iSel;

	if (LB_ERR != (iSel = m_listWorlds.GetCurSel()))
	{
		Delete( iSel );
	}
	
	UpdateButtons();
}


void ChWorldListDlg::OnListAdd()
{
	ChWorldListEdit		editDlg;
	int					iResult;

	iResult = editDlg.DoModal();

	if (IDOK == iResult)
	{
		ASSERT( variableLogin != editDlg.GetLoginType() );

		Add( false, editDlg.GetName(), editDlg.GetDesc(), editDlg.GetHost(),
				editDlg.GetPort(), editDlg.GetType(), editDlg.GetLoginType(),
				editDlg.GetUsername(), editDlg.GetPassword(),
				editDlg.GetHomePage() );
	}
	
	UpdateButtons();
}


void ChWorldListDlg::OnListEdit() 
{
	if (SyncDataFields())
	{
		string		strOldName = GetName();
		string		strOldUsername = GetUsername();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久九九影视网| 久久精品国产亚洲5555| 日韩精品91亚洲二区在线观看| 久久 天天综合| 欧美日本在线视频| 日韩毛片精品高清免费| 国产麻豆午夜三级精品| 欧美精品久久一区二区三区| 亚洲精品国产一区二区三区四区在线 | 99re热这里只有精品免费视频 | 毛片av中文字幕一区二区| 91香蕉视频在线| 久久精品水蜜桃av综合天堂| 日日骚欧美日韩| 91久久一区二区| 亚洲欧美日韩中文播放| 成人综合在线视频| 日本一区二区电影| 国产中文字幕精品| 欧美精品一区二区精品网| 午夜免费久久看| 欧美日韩三级在线| 亚洲国产另类精品专区| 欧美唯美清纯偷拍| 亚洲一区二区四区蜜桃| 色屁屁一区二区| 亚洲综合免费观看高清在线观看| 99久久精品国产一区| 国产精品欧美精品| av在线一区二区三区| 国产精品久久影院| 99视频超级精品| 1区2区3区欧美| 91麻豆精品秘密| 亚洲影视在线播放| 91精品久久久久久蜜臀| 蜜桃av一区二区| 精品久久一区二区| 国产精品77777| 亚洲色图清纯唯美| 欧美日韩免费观看一区三区| 天涯成人国产亚洲精品一区av| 51精品秘密在线观看| 美女一区二区久久| 久久久久99精品国产片| 成人久久18免费网站麻豆| 亚洲精选视频免费看| 精品视频123区在线观看| 日韩激情中文字幕| 国产欧美一区二区三区网站| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 色94色欧美sute亚洲线路二 | 一区二区免费看| 欧美色网一区二区| 精品一区二区三区不卡| 国产精品亲子乱子伦xxxx裸| 日本韩国欧美在线| 久久er99精品| 亚洲欧美日韩中文播放| 欧美一区二区国产| 成人av综合一区| 日本欧美大码aⅴ在线播放| 久久久久久久精| 91黄视频在线| 国产专区欧美精品| 一区二区三区欧美日韩| 精品国产一二三| 欧美视频一区二区三区在线观看| 韩国三级在线一区| 一区二区三区高清| 久久亚洲影视婷婷| 欧美视频三区在线播放| 国产凹凸在线观看一区二区| 亚洲成人先锋电影| 国产精品每日更新| 欧美一区二区视频免费观看| av一区二区三区在线| 麻豆精品一区二区三区| 一区二区三区中文字幕电影| 久久人人爽人人爽| 欧美亚洲高清一区二区三区不卡| 极品少妇xxxx精品少妇| 亚洲va天堂va国产va久| 国产精品天美传媒| 精品日韩99亚洲| 欧美无砖砖区免费| 91视频免费观看| 成人免费看黄yyy456| 麻豆91在线播放| 肉丝袜脚交视频一区二区| 欧美国产禁国产网站cc| 26uuu亚洲| 日韩三级视频在线看| 欧美日高清视频| 欧美三级在线看| 色欧美88888久久久久久影院| 国产91露脸合集magnet| 国产一区二区久久| 精品在线播放免费| 久久精品国产精品亚洲综合| 婷婷国产v国产偷v亚洲高清| 亚洲在线一区二区三区| 亚洲视频每日更新| 1000精品久久久久久久久| 国产日韩欧美麻豆| 久久亚洲二区三区| 久久久久久久网| 国产偷国产偷亚洲高清人白洁| 欧美成人video| 日韩一级黄色大片| 精品久久久久99| 久久影院电视剧免费观看| 欧美大片在线观看| 精品电影一区二区三区| 欧美精品一区二区精品网| 精品电影一区二区三区| 国产偷v国产偷v亚洲高清| 国产午夜精品一区二区| 国产精品久久久久久久久久久免费看| 精品国产三级电影在线观看| 久久精品亚洲精品国产欧美| 中文字幕欧美国产| 日韩理论在线观看| 亚洲国产欧美在线| 欧美a一区二区| 国产成人免费在线视频| 91猫先生在线| 欧美人与禽zozo性伦| 日韩精品综合一本久道在线视频| 精品国精品国产尤物美女| 国产欧美一区二区三区网站| 亚洲摸摸操操av| 日韩在线一区二区| 国产麻豆视频精品| 97精品超碰一区二区三区| 欧美性大战久久久久久久| 欧美一区二区在线观看| 久久免费午夜影院| 亚洲免费观看在线视频| 婷婷中文字幕一区三区| 国内精品久久久久影院色| 91一区二区在线观看| 欧美高清性hdvideosex| 久久久久久久久久久久久夜| 18欧美乱大交hd1984| 免费人成精品欧美精品| 成人精品免费网站| 欧美一区二区三区婷婷月色| 国产欧美日韩久久| 午夜国产精品一区| 国产高清久久久| 91精品国产综合久久福利软件| 国产欧美日韩在线看| 亚洲主播在线观看| 国产二区国产一区在线观看| 欧美日韩午夜在线| 国产精品丝袜91| 美女网站一区二区| 91久久精品网| 久久精品视频在线免费观看| 天堂va蜜桃一区二区三区 | 国产在线视视频有精品| 欧美怡红院视频| 国产精品毛片大码女人| 日本强好片久久久久久aaa| 91看片淫黄大片一级在线观看| 精品少妇一区二区三区在线视频| 亚洲一区二区三区小说| 国产精品亚洲第一| 欧美一级黄色录像| 一区二区三区欧美| 99精品视频中文字幕| 久久色在线视频| 美女高潮久久久| 欧美天天综合网| 一级日本不卡的影视| 成人av在线观| 国产婷婷一区二区| 九九**精品视频免费播放| 欧美精品在线一区二区| 一区二区三区久久久| 成人激情免费视频| 欧美激情中文字幕一区二区| 精品一区二区三区影院在线午夜 | 另类调教123区| 欧美日韩在线免费视频| 亚洲精品水蜜桃| 日本不卡一二三区黄网| 91精品国产综合久久精品麻豆| 亚洲午夜免费视频| 色94色欧美sute亚洲线路一ni| 1000精品久久久久久久久| 99精品1区2区| 一区二区三区欧美视频| 色哟哟日韩精品| 亚洲国产精品久久人人爱| 欧美色窝79yyyycom| 丝瓜av网站精品一区二区 | 中文一区一区三区高中清不卡| 国内精品伊人久久久久av影院|