Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
84 lines
1.6 KiB
C++
84 lines
1.6 KiB
C++
// ListBoxEx.cpp : implementation file
|
|
//
|
|
|
|
#include "ListBoxEx.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CListBoxEx
|
|
|
|
CListBoxEx::CListBoxEx()
|
|
{
|
|
}
|
|
|
|
CListBoxEx::~CListBoxEx()
|
|
{
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CListBoxEx, CListBox)
|
|
//{{AFX_MSG_MAP(CListBoxEx)
|
|
ON_WM_LBUTTONDBLCLK()
|
|
ON_WM_KEYDOWN()
|
|
//}}AFX_MSG_MAP
|
|
ON_REGISTERED_MESSAGE(END_EDIT, OnEndEditMessage )
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CListBoxEx message handlers
|
|
|
|
void CListBoxEx::OnLButtonDblClk(UINT nFlags, CPoint point)
|
|
{
|
|
// TODO: Add your message handler code here and/or call default
|
|
CListBox::OnLButtonDblClk(nFlags, point);
|
|
|
|
int CurSel = GetCurSel();
|
|
|
|
if(CurSel >= 0)
|
|
EditLabel(CurSel);
|
|
}
|
|
|
|
void CListBoxEx::EditLabel(int Index_In)
|
|
{
|
|
CRect EditRect;
|
|
CString ItemText;
|
|
|
|
GetText(Index_In, ItemText);
|
|
GetItemRect(Index_In, EditRect);
|
|
EditRect.bottom += 5;
|
|
|
|
DWORD dwStyle = WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL;
|
|
|
|
CEdit *pEdit;
|
|
pEdit = new CInPlaceEdit(Index_In, 0, ItemText);
|
|
pEdit->Create(dwStyle, EditRect, this, IDC_IBEDIT);
|
|
}
|
|
|
|
LRESULT CListBoxEx::OnEndEditMessage(WPARAM wParam, LPARAM lParam)
|
|
{
|
|
int Index = (int)wParam;
|
|
char *Text = (char *)lParam;
|
|
|
|
DeleteString(Index);
|
|
InsertString(Index, Text);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
void CListBoxEx::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
|
|
{
|
|
// TODO: Add your message handler code here and/or call default
|
|
if(nChar == VK_DELETE)
|
|
{
|
|
DeleteString(GetCurSel());
|
|
}
|
|
|
|
CListBox::OnKeyDown(nChar, nRepCnt, nFlags);
|
|
}
|