Ejemplo n.º 1
0
BOOL CDlgNetlist::OnInitDialog()
{
	CDialog::OnInitDialog();

	// make copy of netlist data so that it can be edited but user can still cancel
	// use global netlist_info so it can be sorted in the list control
	m_nl = &::nl;
	m_nlist->ExportNetListInfo( &::nl );

	m_list_ctrl.InsertColumn( COL_VIS,       "Vis",       LVCFMT_LEFT, 25 );
	m_list_ctrl.InsertColumn( COL_NAME,      "Name",      LVCFMT_LEFT, 140 );
	m_list_ctrl.InsertColumn( COL_PINS,      "Pins",      LVCFMT_LEFT, 40 );
	m_list_ctrl.InsertColumn( COL_WIDTH,     "Width",     LVCFMT_LEFT, 50 );
	m_list_ctrl.InsertColumn( COL_VIA_W,     "Via W",     LVCFMT_LEFT, 53 );
	m_list_ctrl.InsertColumn( COL_HOLE_W,    "Hole",      LVCFMT_LEFT, 53 );
	m_list_ctrl.InsertColumn( COL_CLEARANCE, "Clearance", LVCFMT_LEFT, 60 );

	// initialize netlist control
	m_item_selected = -1;
	m_sort_type = 0;
	m_visible_state = 1;
	DrawListCtrl();

	// initialize buttons
	m_button_edit.EnableWindow(FALSE);
	m_button_delete_single.EnableWindow(FALSE);
	m_button_nl_width.EnableWindow(FALSE);
	m_button_delete.EnableWindow(FALSE);

	return TRUE;
}
Ejemplo n.º 2
0
void CDlgNetlist::OnBnClickedButtonEdit()
{
	int n_sel = m_list_ctrl.GetSelectedCount();
	if( n_sel == 0 )
		AfxMessageBox( "You have no net selected" );
	else if( n_sel > 1 )
		AfxMessageBox( "You have more than one net selected" );
	else
	{
		POSITION pos = m_list_ctrl.GetFirstSelectedItemPosition();
		if( pos == NULL )
			ASSERT(0);

		int nItem = m_list_ctrl.GetNextSelectedItem(pos);
		int i = m_list_ctrl.GetItemData( nItem );

		// prepare and invoke dialog
		CFreePcbView * view = theApp.m_View;
		CFreePcbDoc * doc = theApp.m_Doc;
		CDlgEditNet dlg;
		dlg.Initialize( doc->m_nlist, &nl, i, m_plist, FALSE, ListView_GetCheckState( m_list_ctrl, nItem ),
						MIL, &(doc->m_w), &(doc->m_v_w), &(doc->m_v_h_w) );
		int ret = dlg.DoModal();
		if( ret == IDOK )
		{
			// implement edits into nl and update m_list_ctrl
			DrawListCtrl();
		}
	}
}
Ejemplo n.º 3
0
void CDlgNetlist::OnBnClickedButtonAdd()
{
	// prepare CDlgEditNet
	CFreePcbView * view = theApp.m_View;
	CFreePcbDoc * doc = theApp.m_Doc;
	CDlgEditNet dlg;
	dlg.Initialize( doc->m_nlist, &nl, -1, m_plist, TRUE, TRUE,
					MIL, &doc->m_w, &doc->m_v_w, &doc->m_v_h_w );
	// invoke dialog
	int ret = dlg.DoModal();
	if( ret == IDOK )
	{
		// net added, update m_list_ctrl
		DrawListCtrl();
	}
}
Ejemplo n.º 4
0
BOOL CDlgNetlist::OnInitDialog()
{
	CDialog::OnInitDialog();

	// make copy of netlist data so that it can be edited but user can still cancel
	// use global netlist_info so it can be sorted in the list control
	m_nl = &::nl;
	m_nlist->ExportNetListInfo( &::nl );

	// initialize netlist control
	m_item_selected = -1;
	m_sort_type = 0;
	m_visible_state = 1;
	DrawListCtrl();

	// initialize buttons
	m_button_edit.EnableWindow(FALSE);
	m_button_delete_single.EnableWindow(FALSE);
	m_button_nl_width.EnableWindow(FALSE);
	m_button_delete.EnableWindow(FALSE);
	return TRUE;  
}