FilterByOwnerDlg.cpp. #1

  • //
  • guest/
  • YourUncleBob/
  • p4win/
  • main/
  • gui/
  • FilterByOwnerDlg.cpp.
  • View
  • Commits
  • Open Download .zip Download (2 KB)
// FilterByOwnerDlg.cpp : implementation file
//

#include "stdafx.h"
#include "P4win.h"
#include "FilterByOwnerDlg.h"
#include "MainFrm.h"


// CFilterByOwnerDlg dialog

IMPLEMENT_DYNAMIC(CFilterByOwnerDlg, CDialog)
CFilterByOwnerDlg::CFilterByOwnerDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CFilterByOwnerDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFilterByOwnerDlg)
	m_Owner = GET_P4REGPTR()->GetLabelFilterByOwner();
	m_IncBlank = GET_P4REGPTR()->GetLabelFilterIncBlank();
	//}}AFX_DATA_INIT
	m_bShowIncBlanks = FALSE;
}

CFilterByOwnerDlg::~CFilterByOwnerDlg()
{
}

void CFilterByOwnerDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFilterByOwnerDlg)
	DDX_Radio(pDX, IDC_RADIO1, m_NotUser);
	DDX_Text(pDX, IDC_OWNER, m_Owner);
	DDV_MaxChars(pDX, m_Owner, 1024);
	DDX_Check(pDX, IDC_INCBLANK, m_IncBlank);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFilterByOwnerDlg, CDialog)
	//{{AFX_MSG_MAP(CFilterByOwnerDlg)
	ON_BN_CLICKED(IDC_BROWSE, OnBrowseUsers)
	ON_BN_CLICKED(IDC_RADIO1, OnOwner)
	ON_BN_CLICKED(IDC_RADIO2, OnOwner)
	//}}AFX_MSG_MAP
	ON_MESSAGE(WM_BROWSECALLBACK2, OnBrowseUsersCallBack)
END_MESSAGE_MAP()


// CFilterByOwnerDlg message handlers
BOOL CFilterByOwnerDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

	if (!m_bShowIncBlanks)
	{
		GetDlgItem(IDC_INCBLANK)->EnableWindow(FALSE);
		GetDlgItem(IDC_INCBLANK)->ShowWindow(SW_HIDE);
	}

	if (m_Owner.IsEmpty())
		m_Owner = GET_P4REGPTR()->GetP4User();
	OnOwner();
	UpdateData(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CFilterByOwnerDlg::OnOK() 
{
	UpdateData();
    CDialog::OnOK();
}

void CFilterByOwnerDlg::OnBrowseUsers()
{
	::SendMessage(MainFrame()->UserWnd(), WM_FETCHOBJECTLIST, 
					(WPARAM)(this->m_hWnd), WM_BROWSECALLBACK2);
}

LRESULT CFilterByOwnerDlg::OnBrowseUsersCallBack(WPARAM wParam, LPARAM lParam)
{
	UpdateData(TRUE);
	CString *str = (CString *)lParam;
	m_Owner = *str;
	UpdateData(FALSE);
	return 0;
}

void CFilterByOwnerDlg::OnOwner()
{
	UpdateData( );
	BOOL b = m_NotUser;
	GetDlgItem(IDC_OWNER)->EnableWindow(b);
	GetDlgItem(IDC_BROWSE)->EnableWindow(b);
	if (b)
		GotoDlgCtrl(GetDlgItem(IDC_OWNER));
}
# Change User Description Committed
#1 19924 YourUncleBob Populate -o //guest/perforce_software/p4win/...
//guest/YourUncleBob/p4win/.....
//guest/perforce_software/p4win/main/gui/FilterByOwnerDlg.cpp
#1 16169 perforce_software Move files to follow new path scheme for branches.
//guest/perforce_software/p4win/gui/FilterByOwnerDlg.cpp
#1 8562 Matt Attaway These feet never stop running.

Initial commit of the P4Win source code.  To the best of our knowledge this
compiles and runs using the 2013.3 P4 API and VS 2010. Expect a few changes
as we refine the build process. Please post any build issues to the forums.