LRESULT CLineNumberEdit::OnSetText( WPARAM wParam, LPARAM lParam )
{
	// Default processing
	LRESULT retval = DefWindowProc( WM_SETTEXT, wParam, lParam );
	UpdateTopAndBottom();
	return retval;
}
Пример #2
0
void Cylindrical2dMesh::CreateHaloNodes()
{
    UpdateTopAndBottom();

    mTopHaloNodes.clear();
    mBottomHaloNodes.clear();

    unsigned num_halo_nodes = (unsigned)(floor(mWidth*2.0));
    double halo_node_separation = mWidth/((double)(num_halo_nodes));
    double y_top_coordinate = mTop + halo_node_separation;
    double y_bottom_coordinate = mBottom - halo_node_separation;

    c_vector<double, 2> location;
    for (unsigned i=0; i<num_halo_nodes; i++)
    {
       double x_coordinate = 0.5*halo_node_separation + (double)(i)*halo_node_separation;

       // Inserting top halo node in mesh
       location[0] = x_coordinate;
       location[1] = y_top_coordinate;
       unsigned new_node_index = MutableMesh<2,2>::AddNode(new Node<2>(0, location));
       mTopHaloNodes.push_back(new_node_index);

       location[1] = y_bottom_coordinate;
       new_node_index = MutableMesh<2,2>::AddNode(new Node<2>(0, location));
       mBottomHaloNodes.push_back(new_node_index);
    }
}
LRESULT CLineNumberEdit::OnLineScroll( WPARAM wParam, LPARAM lParam )
{
	// Default processing
	LRESULT retval = DefWindowProc( EM_LINESCROLL, wParam, lParam );
	UpdateTopAndBottom();
	return retval;
}
Пример #4
0
void CLineNumberEdit::OnVscroll() 
/* ============================================================
	Function :		CLineNumberEdit::OnVscroll
	Description :	Mapped to EN_VSCROLL. We update the line 
					numbers in the line number control
 
	Return :		void
	Parameters :	none

	Usage :			Called from Windows

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

	UpdateTopAndBottom();

}
Пример #5
0
LRESULT CLineNumberEdit::OnLineScroll( WPARAM wParam, LPARAM lParam ) 
/* ============================================================
	Function	:	CLineNumberEdit::OnLineScroll
	Description	:	Mapped to EM_LINESCROLL. We update the line 
					numbers in the line number control.
     
	Return		:	void
	Parameters	:	none
	Usage		:	Called from Windows
   ============================================================*/
{

	// Default processing
	LRESULT retval = DefWindowProc( EM_LINESCROLL, wParam, lParam );
	UpdateTopAndBottom();
	return retval;

}
Пример #6
0
void CLineNumberEdit::OnChange() 
/* ============================================================
	Function :		CLineNumberEdit::OnChange
	Description :	Mapped to EN_CHANGE. We must handle 
					EN_CHANGE to let the line-number control 
					reflect changes to the edit box content.
 
	Return :		void
	Parameters :	none

	Usage :			Called from Windows

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

	UpdateTopAndBottom();

}
Пример #7
0
void CLineNumberEdit::Prepare()
/* ============================================================
	Function :		CLineNumberEdit::Prepare
	Description :	Setting the edit rect for the control and 
					either create or move the line number 
					control. Also sets the top- and bottom 
					line numbers.
 
	Return :		void
	Parameters :	none

	Usage :			Must be called to (re)establish the edit 
					rect, must also be called as soon as the 
					control changes size.

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

	// Calc sizes
	int width = CalcLineNumberWidth();
	CRect rect;
	GetClientRect( &rect );
	CRect rectEdit( rect );
	rect.right = width;
	rectEdit.left = rect.right + 1;

	// Setting the edit rect and 
	// creating or moving child control
	SetRect( &rectEdit );
	if( m_line.m_hWnd )
		m_line.MoveWindow( 0, 0, width, rect.Height() );
	else
		m_line.Create(NULL,WS_CHILD | WS_VISIBLE | SS_NOTIFY, rect, this, 1 );

	GetRect( &rectEdit );

	// Update line number control data
	m_line.SetTopMargin( rectEdit.top );
	UpdateTopAndBottom();

}
Пример #8
0
void CLineNumberEdit::OnVScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar ) 
/* ============================================================
	Function :		CLineNumberEdit::OnVScroll
	Description :	Handles WM_VSCROLL. We handle WM_VSCROLL 
					in addition to the notification EN_VSCROLL, 
					to handle scrollbar dragging as well
 
	Return :		void
	Parameters :	UINT nSBCode			- From Windows
					UINT nPos				- From Windows
					CScrollBar* pScrollBar	- From Windows

	Usage :			Called from Windows

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

	CEdit::OnVScroll( nSBCode, nPos, pScrollBar );
	UpdateTopAndBottom();

}
Пример #9
0
LRESULT CLineNumberEdit::OnSetText( WPARAM wParam, LPARAM lParam )
/* ============================================================
	Function :		CLineNumberEdit::OnSetText
	Description :	Handles WM_SETTEXT. We must update the line 
					numbers in the line number control as well.
 
	Return :		LRESULT			- From Def proc
	Parameters :	WPARAM wParam	- From Windows
					LPARAM lParam	- From Windows

	Usage :			Called from Windows

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

	// Default processing
	LRESULT retval = DefWindowProc( WM_SETTEXT, wParam, lParam );
	UpdateTopAndBottom();
	return retval;

}
void CLineNumberEdit::Prepare()
{
	// Calc sizes
	int width = CalcLineNumberWidth();
	CRect rect;
	GetClientRect( &rect );
	CRect rectEdit( rect );
	rect.right = width;
	rectEdit.left = rect.right + 3;

	// Setting the edit rect and
	// creating or moving child control
	SetRect( &rectEdit );
	if( m_line.m_hWnd )
		m_line.MoveWindow( 0, 0, width, rect.Height() );
	else
		m_line.Create(NULL,WS_CHILD | WS_VISIBLE | SS_NOTIFY, rect, this, 1 );

	GetRect( &rectEdit );

	// Update line number control data
	m_line.SetTopMargin( rectEdit.top );
	UpdateTopAndBottom();
}
void CLineNumberEdit::OnChange()
{
	UpdateTopAndBottom();
}
void CLineNumberEdit::OnVScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar )
{
	CEdit::OnVScroll( nSBCode, nPos, pScrollBar );
	UpdateTopAndBottom();
}
void CLineNumberEdit::OnVscroll()
{
	UpdateTopAndBottom();
}