Пример #1
0
void CLineNumberEdit::UseSystemColours( BOOL bUseEnabled /*= TRUE*/, BOOL bUseDisabled /*= TRUE*/ )
/* ============================================================
	Function :		CLineNumberEdit::UseSystemColours
	Description :	Sets the Use*SystemColours flags.
 
	Return :		void
	Parameters :	BOOL bEnabled	-	flag if to use enabled 
										system colours
					BOOL bDisabled	-	flag if to use disabled 
										system colours

	Usage :			Called to change colours in the edit box

   ============================================================*/
{

    m_bUseEnabledSystemColours = bUseEnabled;
    m_bUseDisabledSystemColours = bUseDisabled;
    BOOL bEnable = TRUE;
    if (::IsWindow(m_hWnd))
        bEnable = IsWindowEnabled();

    SetWindowColour( bEnable );

}
void CLineNumberEdit::OnSysColorChange()
{
	CEdit::OnSysColorChange();

	// update the CStatic with the new colours
	SetWindowColour( IsWindowEnabled() );
}
CLineNumberEdit::CLineNumberEdit()
{
	m_hWnd = NULL;
	m_line.m_hWnd = NULL;
	m_zero.cx = 0;
	m_zero.cy = 0;
	m_format = _T( "%03i" );
	m_LineDelta = 1;

	// Could default m_maxval to 99,999, but may cause problems
	// if m_format is changed and m_maxval is not...
	m_maxval = 998;

	// Setting up so by defult the original hard-coded colour
	// scheme is used when enabled and the system colours are
	// used when disabled.
	m_bUseEnabledSystemColours = FALSE;
	m_bUseDisabledSystemColours = TRUE;
	m_EnabledFgCol = RGB( 0, 0, 0 );
	m_EnabledBgCol = RGB( 200, 200, 200 );
	m_DisabledFgCol = GetSysColor( COLOR_GRAYTEXT );
	m_DisabledBgCol = GetSysColor( COLOR_3DFACE );

	SetWindowColour();
}
void CLineNumberEdit::UseSystemColours( BOOL bUseEnabled /*= TRUE*/, BOOL bUseDisabled /*= TRUE*/ )
{
	m_bUseEnabledSystemColours = bUseEnabled;
	m_bUseDisabledSystemColours = bUseDisabled;
	BOOL bEnable = TRUE;
	if (::IsWindow(m_hWnd))
		bEnable = IsWindowEnabled();

	SetWindowColour( bEnable );
}
Пример #5
0
void CLineNumberEdit::OnEnable( BOOL bEnable ) 
/* ============================================================
	Function :		CLineNumberEdit::OnEnable
	Description :	Handles WM_ENABLE. Calls to set colours.
 
	Return :		void
	Parameters :	BOOL bEnable - From Windows

	Usage :			Called from Windows.

   ============================================================*/
{

	CEdit::OnEnable( bEnable );
    SetWindowColour( bEnable );

}
Пример #6
0
void CLineNumberEdit::OnSysColorChange() 
/* ============================================================
	Function :		CLineNumberEdit::OnSysColorChange
	Description :	Handles WM_SYSCOLORCHANGE. User has changed
					the system colours, want to refresh.
 
	Return :		void
	Parameters :	void

	Usage :			Called from Windows

   ============================================================*/
{

	CEdit::OnSysColorChange();

    // update the CStatic with the new colours
    SetWindowColour( IsWindowEnabled() );

}
Пример #7
0
/////////////////////////////////////////////////////////////////////////////
// CLineNumberEdit
CLineNumberEdit::CLineNumberEdit()
/* ============================================================
	Function :		CLineNumberEdit::CLineNumberEdit
	Description :	constructor
     
	Return :		void
	Parameters :	none

	Usage :			

   ============================================================*/
{

	m_hWnd = NULL;
	m_line.m_hWnd = NULL;
	m_zero.cx = 0;
	m_zero.cy = 0;
	m_format = _T( "Ек %03i Пе" );
	m_LineDelta = 0;

	// Could default m_maxval to 99,999, but may cause problems 
	// if m_format is changed and m_maxval is not...
	m_maxval = 0;

	// Setting up so by defult the original hard-coded colour 
	// scheme is used when enabled and the system colours are 
	// used when disabled.
	m_bUseEnabledSystemColours = FALSE;
	m_bUseDisabledSystemColours = TRUE;
	m_EnabledFgCol = RGB( 0, 0, 0 );
	m_EnabledBgCol = RGB( 255, 255, 248 );
	m_DisabledFgCol = GetSysColor( COLOR_GRAYTEXT );
	m_DisabledBgCol = GetSysColor( COLOR_3DFACE );

	SetWindowColour();

}
void CLineNumberEdit::OnEnable( BOOL bEnable )
{
	CEdit::OnEnable( bEnable );
	SetWindowColour( bEnable );
}