Beispiel #1
0
LRESULT COverlayPanel::rename(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	IOverlay *item = NULL;
	getHierarchy(NULL, NULL, &item);

	if (item)
	{
		rename(item);
	}

	return 1;
}
Beispiel #2
0
LRESULT COverlayPanel::visible(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	IOverlay *item = NULL;
	getHierarchy(NULL, NULL, &item);

	if (item)
	{
		LRESULT state = SendDlgItemMessage(IDC_CHECK_VISIBLE, BM_GETCHECK, (WPARAM)0, (LPARAM)0);
		item->put_Visible(state == BST_CHECKED);
		notifyObserver();
	}

	return 1;
}
Beispiel #3
0
LRESULT COverlayPanel::duplicate(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	IOverlay *item = NULL;
	ICompositeOverlay *parent = NULL;
	getHierarchy(NULL, &parent, &item);

	if (item)
	{
		duplicate(parent, item);
		SendDlgItemMessage(IDC_OVERLAY_LIST, TVM_SELECTITEM, (WPARAM)TVGN_CARET, 0);
		notifyObserver();
	}

	return 1;
}
Beispiel #4
0
LRESULT COverlayPanel::moveDown(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	IOverlay *item = NULL;
	ICompositeOverlay *parent = NULL, *superParent = NULL;
	getHierarchy(&superParent, &parent, &item);

	if (item)
	{
		down(superParent, parent, item);
		enable(item);
		notifyObserver();
	}
	else
		disable();

	return 1;
}
Beispiel #5
0
LRESULT COverlayPanel::add(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	char text[256];
	IOverlay *item = NULL;
	ICompositeOverlay *parent = NULL;
	getHierarchy(NULL, &parent, &item);
	*text = 0;
	GetDlgItemText(IDC_OVERLAY_TYPE, text, sizeof(text));
	if (item)
	{
		ICompositeOverlay *pCO = NULL;
		HRESULT hr = item->QueryInterface(IID_ICompositeOverlay, (void **)&pCO);
		if (SUCCEEDED(hr))
		{
			parent = (ICompositeOverlay*)item;
			pCO->Release();
		}
	}

	if (add(parent, text))
		notifyObserver();

	return 1;
}
void myOpenHierarchy::loadMeta(const vector<Metadata> &meta)
{
	ui.tableWidget_qi->clearContents();
	ui.tableWidget_qi->setColumnCount( 5 );
	ui.tableWidget_qi->setRowCount( meta.size() );
	
	int indexRow;
	QStringList temp_list;
	temp_list << "Attribute" << " SA " << " QI " << "  Quasi-Identifier's Hierarchy File  " << "Choose..";

	ui.tableWidget_qi->setHorizontalHeaderLabels( temp_list );

	QTableWidgetItem* p_item;
	myCheckBox *cbox;
	myCheckBox *cbox2;
	myLineEdit *ledit;
	myPushButton *pbutton;
	for(indexRow = 0; indexRow < meta.size(); indexRow++){		

		//set first column: attribute name
		p_item = new QTableWidgetItem;
		string value = meta[indexRow].m_strName;
		p_item->setText( value.c_str() );
		ui.tableWidget_qi->setItem( indexRow, 0, p_item );

		//set second column: CheckBox, third column: LineEdit, forth column: PushButton
		cbox = new myCheckBox();
		cbox2 = new myCheckBox();
		ledit = new myLineEdit();
		pbutton = new myPushButton();

		ui.tableWidget_qi->setCellWidget( indexRow, 1, cbox2 );
		ui.tableWidget_qi->setCellWidget( indexRow, 2, cbox );
		ledit->setDisabled(true);
		ui.tableWidget_qi->setCellWidget( indexRow, 3, ledit );
		pbutton->setText("Browse..");
		pbutton->setDisabled(true);
		ui.tableWidget_qi->setCellWidget( indexRow, 4, pbutton );

		//connect checkbox QI to enable lineedit and pushbutton
		connect( ui.tableWidget_qi->cellWidget( indexRow, 2 ), SIGNAL( clicked( bool ) ), ui.tableWidget_qi->cellWidget( indexRow, 3 ), SLOT( setEnabled( bool ) ) );
		connect( ui.tableWidget_qi->cellWidget( indexRow, 2 ), SIGNAL( clicked( bool ) ), ui.tableWidget_qi->cellWidget( indexRow, 4 ), SLOT( setEnabled( bool ) ) );

		//connect checkbox QI to disable checkbox SA
		connect( ui.tableWidget_qi->cellWidget( indexRow, 2 ), SIGNAL( clicked( bool ) ), ui.tableWidget_qi->cellWidget( indexRow, 1 ), SLOT( setMyChecked( bool ) ) );

		//connect pushbutton to get hierarchy file
		connect( ui.tableWidget_qi->cellWidget( indexRow, 4 ), SIGNAL( clicked() ), ui.tableWidget_qi->cellWidget( indexRow, 3 ), SLOT( getHierarchy() ) );

		//connect checkbox SA to disable checkbox QI, lineedit, pushbutton at the same line;
		connect( ui.tableWidget_qi->cellWidget( indexRow, 1 ), SIGNAL( clicked( bool ) ), ui.tableWidget_qi->cellWidget( indexRow, 2 ), SLOT( setMyChecked( bool ) ) );
		connect( ui.tableWidget_qi->cellWidget( indexRow, 1 ), SIGNAL( clicked( bool ) ), ui.tableWidget_qi->cellWidget( indexRow, 3 ), SLOT( setMyClear( bool ) ) );
		connect( ui.tableWidget_qi->cellWidget( indexRow, 1 ), SIGNAL( clicked( bool ) ), ui.tableWidget_qi->cellWidget( indexRow, 3 ), SLOT( setMyDisabled( bool ) ) );
		connect( ui.tableWidget_qi->cellWidget( indexRow, 1 ), SIGNAL( clicked( bool ) ), ui.tableWidget_qi->cellWidget( indexRow, 4 ), SLOT( setMyDisabled( bool ) ) );
	}

	//connect sa checkbox to exclude each other
	for(indexRow = 0; indexRow < meta.size(); indexRow++){		

		int indexRow2;
		for(indexRow2 = 0; indexRow2 < meta.size(); indexRow2++){

			if(indexRow == indexRow2)
				continue;

			connect( ui.tableWidget_qi->cellWidget( indexRow, 1 ), SIGNAL( clicked( bool ) ), ui.tableWidget_qi->cellWidget( indexRow2, 1 ), SLOT( setMyChecked( bool ) ) );
		}
	}

	//connect pushbutton_clear to clear all
	connect( ui.pushButton_clear, SIGNAL( clicked() ), this, SLOT( clear() ) );

	ui.tableWidget_qi->resizeColumnsToContents();
}