X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fwidgets%2Fblockwidget.cpp;h=813bebf64f2a2669244357fe7f05c3ca492013ed;hb=af32602b9d8075080d5805143f1cd47fc10672e1;hp=ff518bd7bc1616bd80109b047190241644621e92;hpb=e5a77a32dbe17d9534d3099f1fd3fdacba199516;p=architektonas diff --git a/src/widgets/blockwidget.cpp b/src/widgets/blockwidget.cpp index ff518bd..813bebf 100644 --- a/src/widgets/blockwidget.cpp +++ b/src/widgets/blockwidget.cpp @@ -24,7 +24,7 @@ /** * Constructor. */ -QG_BlockWidget::QG_BlockWidget(QG_ActionHandler * ah, QWidget * parent, const char * name, Qt::WFlags f): +BlockWidget::BlockWidget(ActionHandler * ah, QWidget * parent, const char * name, Qt::WFlags f): // QWidget(parent, name, f), QWidget(parent, f), pxmVisible(":/res/visibleblock.xpm"), @@ -150,18 +150,18 @@ QG_BlockWidget::QG_BlockWidget(QG_ActionHandler * ah, QWidget * parent, const ch /** * Destructor */ -QG_BlockWidget::~QG_BlockWidget() +BlockWidget::~BlockWidget() { delete listBox; } -void QG_BlockWidget::setBlockList(RS_BlockList * blockList) +void BlockWidget::setBlockList(RS_BlockList * blockList) { this->blockList = blockList; update(); } -RS_BlockList * QG_BlockWidget::getBlockList() +RS_BlockList * BlockWidget::getBlockList() { return blockList; } @@ -169,9 +169,9 @@ RS_BlockList * QG_BlockWidget::getBlockList() /** * Updates the block box from the blocks in the graphic. */ -void QG_BlockWidget::update() +void BlockWidget::update() { - RS_DEBUG->print("QG_BlockWidget::update()"); + RS_DEBUG->print("BlockWidget::update()"); #warning "!!!" // int yPos = listBox->contentsY(); @@ -185,7 +185,7 @@ void QG_BlockWidget::update() if (!blockList) { - RS_DEBUG->print("QG_BlockWidget::update(): blockList is NULL"); + RS_DEBUG->print("BlockWidget::update(): blockList is NULL"); return; } @@ -212,16 +212,16 @@ void QG_BlockWidget::update() //highlightBlock(blockList->getActiveBlock()); //listBox->setContentsPos(0, yPos); - RS_DEBUG->print("QG_BlockWidget::update() done"); + RS_DEBUG->print("BlockWidget::update() done"); } /** * Highlights (activates) the given block and makes it * the active block in the blocklist. */ -void QG_BlockWidget::highlightBlock(RS_Block * block) +void BlockWidget::highlightBlock(RS_Block * block) { - RS_DEBUG->print("QG_BlockWidget::highlightBlock()"); + RS_DEBUG->print("BlockWidget::highlightBlock()"); if (!block || !listBox) return; @@ -241,22 +241,22 @@ void QG_BlockWidget::highlightBlock(RS_Block * block) } } -/*virtual*/ void QG_BlockWidget::blockAdded(RS_Block *) +/*virtual*/ void BlockWidget::blockAdded(RS_Block *) { update(); } -/*virtual*/ void QG_BlockWidget::blockEdited(RS_Block *) +/*virtual*/ void BlockWidget::blockEdited(RS_Block *) { update(); } -/*virtual*/ void QG_BlockWidget::blockRemoved(RS_Block *) +/*virtual*/ void BlockWidget::blockRemoved(RS_Block *) { update(); } -/*virtual*/ void QG_BlockWidget::blockToggled(RS_Block *) +/*virtual*/ void BlockWidget::blockToggled(RS_Block *) { update(); } @@ -266,8 +266,8 @@ void QG_BlockWidget::highlightBlock(RS_Block * block) * an item is double clicked. */ /* -void QG_BlockWidget::slotToggleView(QListBoxItem* item) { - RS_DEBUG->print("QG_BlockWidget::slotToggleView()"); +void BlockWidget::slotToggleView(QListBoxItem* item) { + RS_DEBUG->print("BlockWidget::slotToggleView()"); if (item==NULL || blockList==NULL) { return; @@ -291,11 +291,11 @@ void QG_BlockWidget::slotToggleView(QListBoxItem* item) { /** * Called when the user activates (highlights) a block. */ -//void QG_BlockWidget::slotActivated(const QString & blockName) -void QG_BlockWidget::slotActivated(void) +//void BlockWidget::slotActivated(const QString & blockName) +void BlockWidget::slotActivated(void) { QString blockName = listBox->currentItem()->text(); - RS_DEBUG->print("QG_BlockWidget::slotActivated(): %s", blockName.toLatin1().data()); + RS_DEBUG->print("BlockWidget::slotActivated(): %s", blockName.toLatin1().data()); if (!blockList) return; @@ -307,12 +307,13 @@ void QG_BlockWidget::slotActivated(void) /** * Called for every mouse click. */ -//void QG_BlockWidget::slotMouseButtonClicked(int /*button*/, Q3ListBoxItem* item, const QPoint& pos) -void QG_BlockWidget::slotMouseButtonClicked(QListWidgetItem * item) +//void BlockWidget::slotMouseButtonClicked(int /*button*/, Q3ListBoxItem* item, const QPoint& pos) +void BlockWidget::slotMouseButtonClicked(QListWidgetItem * item) { QPoint p = mapFromGlobal(QCursor::pos()); RS_Block * b = lastBlock; +//This is crap. We need to fix this so it's not so shitty. if (p.x() < 23) { actionHandler->slotBlocksToggleView(); @@ -328,7 +329,7 @@ void QG_BlockWidget::slotMouseButtonClicked(QListWidgetItem * item) /** * Shows a context menu for the block widget. Launched with a right click. */ -void QG_BlockWidget::contextMenuEvent(QContextMenuEvent * e) +void BlockWidget::contextMenuEvent(QContextMenuEvent * e) { #if 0 //QListBoxItem* item = listBox->selectedItem(); @@ -359,7 +360,7 @@ void QG_BlockWidget::contextMenuEvent(QContextMenuEvent * e) /** * Escape releases focus. */ -void QG_BlockWidget::keyPressEvent(QKeyEvent * e) +void BlockWidget::keyPressEvent(QKeyEvent * e) { switch (e->key()) {