|
/********************************************************************\
created: 2001/05/14
created: 14:5:2001 15:27
filename: c:\my projects\todocached\sortingdialog.cpp
file path: c:\my projects\todocached
file base: sortingdialog
file ext: cpp
author: Alex Kucherenko
purpose:
\********************************************************************/
#include "stdafx.h"
#include "todocached.h"
#include "SortingDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSortingDialog dialog constructor
CSortingDialog::CSortingDialog( CWnd* pParent /*=NULL*/ )
: CDialog(CSortingDialog::IDD, pParent)
{
//{{AFX_DATA_INIT( CSortingDialog )
m_strAll = _T("");
m_strCurrent = _T("");
//}}AFX_DATA_INIT
}
//////////////////////////////////////////////////////////////////////////
//
void CSortingDialog::DoDataExchange( CDataExchange* pDX )
{
CDialog::DoDataExchange( pDX );
//{{AFX_DATA_MAP( CSortingDialog )
DDX_Control( pDX, IDC_CURRENT_STYLE, m_cCurrent );
DDX_Control( pDX, IDC_ALL_STULES, m_cAllStyles );
DDX_LBString( pDX, IDC_ALL_STULES, m_strAll );
DDX_LBString( pDX, IDC_CURRENT_STYLE, m_strCurrent );
//}}AFX_DATA_MAP
}
//////////////////////////////////////////////////////////////////////////
//
BEGIN_MESSAGE_MAP(CSortingDialog, CDialog)
//{{AFX_MSG_MAP( CSortingDialog )
ON_BN_CLICKED( IDC_BUTTON1, OnButton1 )
ON_BN_CLICKED( IDC_BUTTON2, OnButton2 )
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////
// Add sel to current List
void CSortingDialog::OnButton1()
{
// TODO: Add your control notification handler code here
UpdateData();
if( m_strAll != TEXT( "< None >" ) && !m_strAll.IsEmpty() )
{
CString tmpStr;
m_cCurrent.GetText( 0, tmpStr );
if( tmpStr == TEXT( "< None >" ) )
m_cCurrent.DeleteString( 0 );
m_cCurrent.AddString( m_strAll );
m_cAllStyles.DeleteString( m_cAllStyles.GetCurSel( ) );
if( m_cAllStyles.GetCount() == 0 )
m_cAllStyles.AddString( TEXT( "< None >" ) );
}
UpdateData( FALSE );
}
//////////////////////////////////////////////////////////////////////////
// Remove sel from current list
void CSortingDialog::OnButton2()
{
// TODO: Add your control notification handler code here
UpdateData();
if( m_strCurrent != TEXT( "< None >" ) && !m_strCurrent.IsEmpty() )
{
CString tmpStr;
m_cAllStyles.GetText( 0, tmpStr );
if( tmpStr == TEXT( "< None >" ) )
m_cAllStyles.DeleteString( 0 );
m_cAllStyles.AddString( m_strCurrent );
m_cCurrent.DeleteString( m_cCurrent.GetCurSel( ) );
if( m_cCurrent.GetCount() == 0 )
m_cCurrent.AddString( TEXT( "< None >" ) );
}
UpdateData( FALSE );
}
//////////////////////////////////////////////////////////////////////////
//
BOOL CSortingDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_cAllStyles.AddString( TEXT( "< None >" ) );
m_cCurrent.AddString( TEXT( "Project" ) );
m_cCurrent.AddString( TEXT( "File Name" ) );
m_cCurrent.AddString( TEXT( "KeyWord" ) );
m_cCurrent.AddString( TEXT( "Result String" ) );
// return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
return TRUE;
}
//:> End of file
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.