#include "CalamariWindow.h" #include "DiffWidget.h" #include <QAction> #include <QCheckBox> #include <QComboBox> #include <QLayout> #include <QToolBar> #include <math.h> CalamariWindow::CalamariWindow(QWidget *parent, Qt::WFlags flags, char* file1, char* file2, char* file3) : QMainWindow(parent, flags) { diffWidget = new DiffWidget( file1, file2 ); setCentralWidget( diffWidget ); initDiffToolbar(); zoomFactor = 0; diffWidget->setScale( 0 ); } CalamariWindow::~CalamariWindow() { } void CalamariWindow::setAutoSize( bool a ) { if ( a ) { diffWidget->setScale( 0 ); } else { diffWidget->setScale( pow( 2.0, zoomFactor ) ); } } void CalamariWindow::setZoom( int index ) { zoomFactor = zoomList->itemData( index ).toInt(); double scale = pow( 2.0, zoomFactor ); diffWidget->setScale( scale ); } void CalamariWindow::initDiffToolbar() { QToolBar* tbar = addToolBar( "CALAMARI diff toolbar" ); zoomList = new QComboBox; QAction* za = tbar->addWidget( zoomList ); int d; int off = 3; zoomList->setInsertPolicy( QComboBox::InsertAtBottom ); for ( int z = -3 ; z <= 3 ; z++ ) { if ( z < 0 ) { d = pow( 2, -z ); zoomList->insertItem( z + off, "1/" + QString::number( d ) + " x", z ); } else { d = pow( 2, z ); zoomList->insertItem( z + off, QString::number( d ) + " x", z ); } } zoomList->setCurrentIndex( 0 + off ); connect( zoomList, SIGNAL(activated(int)), this, SLOT(setZoom(int)) ); QCheckBox* asize = new QCheckBox( "Fit to window" ); tbar->addWidget( asize ); connect( asize, SIGNAL( toggled(bool) ), this, SLOT( setAutoSize(bool) ) ); connect( asize, SIGNAL( toggled(bool) ), zoomList, SLOT( setDisabled(bool) ) ); asize->setChecked( true ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#14 | 6281 | Sam Stafford | CALAMARI now builds with VS2005 and Qt 4.3.3. | ||
#13 | 5539 | Sam Stafford | Kick off another window to merge alpha channels, if present. | ||
#12 | 5534 | Sam Stafford |
A brand new help file, a bit of cosmetic sprucing, one critical bug fix, and a partridge in a pear tree. |
||
#11 | 5527 | Sam Stafford |
Diff options in merge mode, and an "export stencils" command for people who like that sort of thing. Also, a fresh build. |
||
#10 | 5524 | Sam Stafford | Eraser and spraypaint tools, and "Save" command. | ||
#9 | 5520 | Sam Stafford |
Configurable brush sizes, complete with procedurally generated icons. Spiffy. |
||
#8 | 5519 | Sam Stafford |
Added the paintbrush tool. Now we're getting somewhere. |
||
#7 | 5516 | Sam Stafford | The M is for Merge. | ||
#6 | 5515 | Sam Stafford |
A little more groundwork for merging. Color options are now saved automatically, and may include alpha channels (semitransparent stencils are nifty). |
||
#5 | 5512 | Sam Stafford | UI reshuffling - pushed stencil-related options into a dialog. | ||
#4 | 5511 | Sam Stafford | Continued infrastructure work. | ||
#3 | 5505 | Sam Stafford | Add "diff stencil". | ||
#2 | 5502 | Sam Stafford |
Status bar with handy information, and infrastructure to allow ImageProjectors to have frames. |
||
#1 | 5501 | Sam Stafford |
Codename CALAMARI. Built with Qt 4.1.3 - needs QtCore4.dll and QtGui4.dll to run. |