2010 -> 2011

明天开始,我就迈向了公元2011年。

首先要感谢祖国和人民,然后要感谢生我养我的父母,再者要感谢陪伴我度过日日夜夜的亲爱的老婆,还要感谢每一个认识我的人……没有你们,我不可能走到今天。

过去的一年。

还清商业贷款。经过我和老婆的努力奋斗,房子的商业贷款终于提前还清了,剩下的公积金贷款,每个月自动扣公积金就好了,也不用着急了。这个算是我过去一年最大的收获,今后的压力会相对小很多。

技术提升。学到了J2EE的很多知识。J2EE是在是博大精深,我只是接触了八个多月,还没有达到精通,就被迫做Andorid开发了。对于J2EE,只能说是熟练。但是,对于做项目来说,基本够用了,能够在公司里接触J2EE的开发,我还是比较满足的。学到了Android开发的很多知识。我以前一直以来都是做Java的嵌入式开发的,所以,对于新介入的Android领域,除了API需要熟悉以外,开发起来还是游刃有余的。

过去的一年,也有好多需要反省的地方。一个是,运动少了,身体明显不如以前了,总是感觉很疲劳,去医院越来越频繁,这个让我很担心。一个是,目前的公司是做产品的,没有我想要进入的技术领域。还有就是最令我头痛的英语,因为没有环境,感觉学习的速度小于遗忘的速度,恐怕将来英语会把我堵在好多外企的门外。

未来的一年。

身体最重要,身体是革命的本钱。平时一定多注意,多保养,多运动。

努力去寻找一个技术领域。做管理,在哪里都一样,可是这不是我的目标。做技术,我觉得最好能够找到一个技术领域去专研,这是我的目标。

多读书,少看电视。

英语,还要补。

加上注释,不要分隔/**************************************************************************** ** ** This file is part of the LibreCAD project, a 2D CAD program ** ** Copyright (C) 2010-2011 R. van Twisk (librecad@rvt.dds.nl) ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. ** ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file gpl-2.0.txt included in the ** packaging of this file. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ** ** This copyright notice MUST APPEAR in all copies of the script! ** **********************************************************************/ #include "qg_blockwidget.h" #include <QToolTip> #include <QToolButton> #include <QMenu> #include <QBoxLayout> #include <QLabel> /** * Constructor. */ QG_BlockWidget::QG_BlockWidget(QG_ActionHandler* ah, QWidget* parent, const char* name, Qt::WFlags f) : QWidget(parent, name, f), pxmVisible(":/ui/visibleblock.png"), pxmHidden(":/ui/hiddenblock.png"), pxmAdd(":/ui/blockadd.png"), pxmRemove(":/ui/blockremove.png"), pxmAttributes(":/ui/blockattributes.png"), pxmEdit(":/ui/blockedit.png"), pxmInsert(":/ui/blockinsert.png"), pxmDefreezeAll(":/ui/visibleblock.png"), pxmFreezeAll(":/ui/hiddenblock.png") { actionHandler = ah; blockList = NULL; lastBlock = NULL; listBox = new Q3ListBox(this, "blockbox"); listBox->setDragSelect(false); listBox->setMultiSelection(false); listBox->setSmoothScrolling(true); listBox->setFocusPolicy(Qt::NoFocus); QVBoxLayout* lay = new QVBoxLayout(this); lay->setSpacing ( 0 ); /* QLabel* caption = new QLabel(tr("Block List"), this, "caption"); caption->setAlignment(Qt::AlignCenter); caption->setPaletteBackgroundColor(black); caption->setPaletteForegroundColor(white); */ QHBoxLayout* layButtons = new QHBoxLayout(); QHBoxLayout* layButtons2 = new QHBoxLayout(); QToolButton* but; // show all blocks: but = new QToolButton(this); but->setPixmap(pxmDefreezeAll); but->setMinimumSize(QSize(22,22)); QToolTip::add(but, tr("Show all blocks")); connect(but, SIGNAL(clicked()), actionHandler, SLOT(slotBlocksDefreezeAll())); layButtons->addWidget(but); // hide all blocks: but = new QToolButton(this); but->setPixmap(pxmFreezeAll); but->setMinimumSize(QSize(22,22)); QToolTip::add(but, tr("Hide all blocks")); connect(but, SIGNAL(clicked()), actionHandler, SLOT(slotBlocksFreezeAll())); layButtons->addWidget(but); // add block: but = new QToolButton(this); but->setPixmap(pxmAdd); but->setMinimumSize(QSize(22,22)); QToolTip::add(but, tr("Add a block")); connect(but, SIGNAL(clicked()), actionHandler, SLOT(slotBlocksAdd())); layButtons->addWidget(but); // remove block: but = new QToolButton(this); but->setPixmap(pxmRemove); but->setMinimumSize(QSize(22,22)); QToolTip::add(but, tr("Remove the active block")); connect(but, SIGNAL(clicked()), actionHandler, SLOT(slotBlocksRemove())); layButtons->addWidget(but); // edit attributes: but = new QToolButton(this); but->setPixmap(pxmAttributes); but->setMinimumSize(QSize(22,22)); QToolTip::add(but, tr("Rename the active block")); connect(but, SIGNAL(clicked()), actionHandler, SLOT(slotBlocksAttributes())); layButtons->addWidget(but); // edit block: but = new QToolButton(this); but->setPixmap(pxmEdit); but->setMinimumSize(QSize(22,22)); QToolTip::add(but, tr("Edit the active block\n" "in a separate window")); connect(but, SIGNAL(clicked()), actionHandler, SLOT(slotBlocksEdit())); layButtons2->addWidget(but); // insert block: but = new QToolButton(this); but->setPixmap(pxmInsert); but->setMinimumSize(QSize(22,22)); QToolTip::add(but, tr("Insert the active block")); connect(but, SIGNAL(clicked()), actionHandler, SLOT(slotBlocksInsert())); layButtons2->addWidget(but); //lay->addWidget(caption); lay->addLayout(layButtons); lay->addLayout(layButtons2); lay->addWidget(listBox); //connect(listBox, SIGNAL(doubleClicked(QListBoxItem*)), // actionHandler, SLOT(slotBlocksToggleView())); connect(listBox, SIGNAL(highlighted(const QString&)), this, SLOT(slotActivated(const QString&))); connect(listBox, SIGNAL(mouseButtonClicked(int, Q3ListBoxItem*, const QPoint&)), this, SLOT(slotMouseButtonClicked(int, Q3ListBoxItem*, const QPoint&))); //boxLayout()->addWidget(listBox); } /** * Destructor */ QG_BlockWidget::~QG_BlockWidget() { delete listBox; } /** * Updates the block box from the blocks in the graphic. */ void QG_BlockWidget::update() { RS_DEBUG->print("QG_BlockWidget::update()"); int yPos = listBox->contentsY(); RS_Block* activeBlock; if (blockList!=NULL) { activeBlock = blockList->getActive(); } else { activeBlock = NULL; } listBox->clear(); if (blockList==NULL) { RS_DEBUG->print("QG_BlockWidget::update(): blockList is NULL"); return; } for (uint i=0; i<blockList->count(); ++i) { RS_Block* blk = blockList->at(i); if (!blk->isFrozen()) { listBox->insertItem(pxmVisible, blk->getName()); } else { listBox->insertItem(pxmHidden, blk->getName()); } } listBox->sort(); RS_Block* b = lastBlock; highlightBlock(activeBlock); lastBlock = b; listBox->setContentsPos(0, yPos); //highlightBlock(blockList->getActiveBlock()); //listBox->setContentsPos(0, yPos); RS_DEBUG->print("QG_BlockWidget::update() done"); } /** * Highlights (activates) the given block and makes it * the active block in the blocklist. */ void QG_BlockWidget::highlightBlock(RS_Block* block) { RS_DEBUG->print("QG_BlockWidget::highlightBlock()"); if (block==NULL || listBox==NULL) { return; } blockList->activate(block); QString name = block->getName(); for (int i=0; i<(int)listBox->count(); ++i) { if (listBox->text(i)==name) { listBox->setCurrentItem(i); break; } } } /** * Toggles the view of the given block. This is usually called when * an item is double clicked. */ /* void QG_BlockWidget::slotToggleView(QListBoxItem* item) { RS_DEBUG->print("QG_BlockWidget::slotToggleView()"); if (item==NULL || blockList==NULL) { return; } int index = listBox->index(item); RS_Block* block = blockList->find(item->text()); if (block!=NULL) { blockList->toggleBlock(item->text()); if (!block->isFrozen()) { listBox->changeItem(pxmVisible, item->text(), index); } else { listBox->changeItem(*pxmHidden, item->text(), index); } } } */ /** * Called when the user activates (highlights) a block. */ void QG_BlockWidget::slotActivated(const QString& blockName) { RS_DEBUG->print("QG_BlockWidget::slotActivated(): %s", blockName.latin1()); if (blockList==NULL) { return; } lastBlock = blockList->getActive(); blockList->activate(blockName); } /** * Called for every mouse click. */ void QG_BlockWidget::slotMouseButtonClicked(int /*button*/, Q3ListBoxItem* item, const QPoint& pos) { QPoint p = mapFromGlobal(pos); RS_Block* b = lastBlock; if (p.x()<23) { actionHandler->slotBlocksToggleView(); highlightBlock(b); } else { if (item!=NULL && blockList!=NULL) { lastBlock = blockList->find(item->text()); } } } /** * Shows a context menu for the block widget. Launched with a right click. */ void QG_BlockWidget::contextMenuEvent(QContextMenuEvent *e) { //QListBoxItem* item = listBox->selectedItem(); QMenu* contextMenu = new QMenu(this); QLabel* caption = new QLabel(tr("Block Menu"), this); caption->setPaletteBackgroundColor(RS_Color(0,0,0)); caption->setPaletteForegroundColor(RS_Color(255,255,255)); caption->setAlignment( Qt::AlignCenter ); // RVT_PORT contextMenu->insertItem( caption ); contextMenu->insertItem( tr("&Defreeze all Blocks"), actionHandler, SLOT(slotBlocksDefreezeAll()), 0); contextMenu->insertItem( tr("&Freeze all Blocks"), actionHandler, SLOT(slotBlocksFreezeAll()), 0); contextMenu->insertItem( tr("&Add Block"), actionHandler, SLOT(slotBlocksAdd()), 0); contextMenu->insertItem( tr("&Remove Block"), actionHandler, SLOT(slotBlocksRemove()), 0); contextMenu->insertItem( tr("&Rename Block"), actionHandler, SLOT(slotBlocksAttributes()), 0); contextMenu->insertItem( tr("&Edit Block"), actionHandler, SLOT(slotBlocksEdit()), 0); contextMenu->insertItem( tr("&Insert Block"), actionHandler, SLOT(slotBlocksInsert()), 0); contextMenu->insertItem( tr("&Toggle Visibility"), actionHandler, SLOT(slotBlocksToggleView()), 0); contextMenu->insertItem( tr("&Create New Block"), actionHandler, SLOT(slotBlocksCreate()), 0); contextMenu->exec(QCursor::pos()); delete contextMenu; e->accept(); } /** * Escape releases focus. */ void QG_BlockWidget::keyPressEvent(QKeyEvent* e) { switch (e->key()) { case Qt::Key_Escape: emit escape(); break; default: QWidget::keyPressEvent(e); break; } }
07-04
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值