Style reconciliation.
This commit is contained in:
+36
-1
@@ -24,7 +24,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Default Constructor
|
||||||
|
///
|
||||||
BarcodeStyle::BarcodeStyle ()
|
BarcodeStyle::BarcodeStyle ()
|
||||||
: mId( "" ),
|
: mId( "" ),
|
||||||
mName( "" ),
|
mName( "" ),
|
||||||
@@ -39,6 +41,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor From Data
|
||||||
|
///
|
||||||
BarcodeStyle::BarcodeStyle ( const QString& id,
|
BarcodeStyle::BarcodeStyle ( const QString& id,
|
||||||
const QString& name,
|
const QString& name,
|
||||||
bool canText,
|
bool canText,
|
||||||
@@ -61,60 +66,90 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// ID Property Getter
|
||||||
|
///
|
||||||
const QString& BarcodeStyle::id() const
|
const QString& BarcodeStyle::id() const
|
||||||
{
|
{
|
||||||
return mId;
|
return mId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Name Property Getter
|
||||||
|
///
|
||||||
const QString& BarcodeStyle::name() const
|
const QString& BarcodeStyle::name() const
|
||||||
{
|
{
|
||||||
return mName;
|
return mName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Text Property Getter
|
||||||
|
///
|
||||||
bool BarcodeStyle::canText() const
|
bool BarcodeStyle::canText() const
|
||||||
{
|
{
|
||||||
return mCanText;
|
return mCanText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Text Optional Property Getter
|
||||||
|
///
|
||||||
bool BarcodeStyle::textOptional() const
|
bool BarcodeStyle::textOptional() const
|
||||||
{
|
{
|
||||||
return mTextOptional;
|
return mTextOptional;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Checksum Property Getter
|
||||||
|
///
|
||||||
bool BarcodeStyle::canChecksum() const
|
bool BarcodeStyle::canChecksum() const
|
||||||
{
|
{
|
||||||
return mCanChecksum;
|
return mCanChecksum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Checksum Optional Property Getter
|
||||||
|
///
|
||||||
bool BarcodeStyle::checksumOptional() const
|
bool BarcodeStyle::checksumOptional() const
|
||||||
{
|
{
|
||||||
return mChecksumOptional;
|
return mChecksumOptional;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Default Digits Property Getter
|
||||||
|
///
|
||||||
const QString& BarcodeStyle::defaultDigits() const
|
const QString& BarcodeStyle::defaultDigits() const
|
||||||
{
|
{
|
||||||
return mDefaultDigits;
|
return mDefaultDigits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Freeform Property Getter
|
||||||
|
///
|
||||||
bool BarcodeStyle::canFreeform() const
|
bool BarcodeStyle::canFreeform() const
|
||||||
{
|
{
|
||||||
return mCanFreeform;
|
return mCanFreeform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Prefered N Property Getter
|
||||||
|
///
|
||||||
int BarcodeStyle::preferedN() const
|
int BarcodeStyle::preferedN() const
|
||||||
{
|
{
|
||||||
return mPreferedN;
|
return mPreferedN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Generate Example Digits
|
||||||
|
///
|
||||||
QString BarcodeStyle::exampleDigits( int n ) const
|
QString BarcodeStyle::exampleDigits( int n ) const
|
||||||
{
|
{
|
||||||
if ( mCanFreeform )
|
if ( mCanFreeform )
|
||||||
|
|||||||
+17
-1
@@ -27,9 +27,15 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
class BarcodeStyle
|
///
|
||||||
|
/// Barcode Style Type
|
||||||
|
///
|
||||||
|
struct BarcodeStyle
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
BarcodeStyle ();
|
BarcodeStyle ();
|
||||||
|
|
||||||
@@ -44,6 +50,9 @@ namespace glabels
|
|||||||
int preferedN );
|
int preferedN );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
const QString& id() const;
|
const QString& id() const;
|
||||||
|
|
||||||
const QString& name() const;
|
const QString& name() const;
|
||||||
@@ -63,9 +72,16 @@ namespace glabels
|
|||||||
int preferedN() const;
|
int preferedN() const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
QString exampleDigits( int n ) const;
|
QString exampleDigits( int n ) const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
QString mId;
|
QString mId;
|
||||||
QString mName;
|
QString mName;
|
||||||
|
|||||||
+2
-2
@@ -27,10 +27,10 @@ set (glabels_qobject_headers
|
|||||||
LabelModel.h
|
LabelModel.h
|
||||||
LabelModelObject.h
|
LabelModelObject.h
|
||||||
LabelModelBoxObject.h
|
LabelModelBoxObject.h
|
||||||
MainWindow.h
|
|
||||||
TemplatePicker.h
|
|
||||||
NewLabelDialog.h
|
NewLabelDialog.h
|
||||||
|
MainWindow.h
|
||||||
SimplePreview.h
|
SimplePreview.h
|
||||||
|
TemplatePicker.h
|
||||||
View.h
|
View.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+45
-18
@@ -24,30 +24,45 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Default Constructor
|
||||||
|
///
|
||||||
ColorNode::ColorNode()
|
ColorNode::ColorNode()
|
||||||
: mFieldFlag(false), mColor(QColor::fromRgba(0x00000000)), mKey("")
|
: mFieldFlag(false), mColor(QColor::fromRgba(0x00000000)), mKey("")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor From Data
|
||||||
|
///
|
||||||
ColorNode::ColorNode( bool fieldFlag, const QColor& color, const QString& key )
|
ColorNode::ColorNode( bool fieldFlag, const QColor& color, const QString& key )
|
||||||
: mFieldFlag(fieldFlag), mColor(color), mKey(key)
|
: mFieldFlag(fieldFlag), mColor(color), mKey(key)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor From Color
|
||||||
|
///
|
||||||
ColorNode::ColorNode( const QColor& color )
|
ColorNode::ColorNode( const QColor& color )
|
||||||
: mFieldFlag(false), mColor(color), mKey("")
|
: mFieldFlag(false), mColor(color), mKey("")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor From Key
|
||||||
|
///
|
||||||
ColorNode::ColorNode( const QString& key )
|
ColorNode::ColorNode( const QString& key )
|
||||||
: mFieldFlag(true), mColor(QColor::fromRgba(0x00000000)), mKey(key)
|
: mFieldFlag(true), mColor(QColor::fromRgba(0x00000000)), mKey(key)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// == Operator
|
||||||
|
///
|
||||||
bool ColorNode::operator==( const ColorNode& cn )
|
bool ColorNode::operator==( const ColorNode& cn )
|
||||||
{
|
{
|
||||||
return ( (mFieldFlag == cn.mFieldFlag) &&
|
return ( (mFieldFlag == cn.mFieldFlag) &&
|
||||||
@@ -56,6 +71,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// != Operator
|
||||||
|
///
|
||||||
bool ColorNode::operator!=( const ColorNode& cn )
|
bool ColorNode::operator!=( const ColorNode& cn )
|
||||||
{
|
{
|
||||||
return ( (mFieldFlag != cn.mFieldFlag) ||
|
return ( (mFieldFlag != cn.mFieldFlag) ||
|
||||||
@@ -64,6 +82,33 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Field Flag Property Getter
|
||||||
|
///
|
||||||
|
bool ColorNode::fieldFlag( void ) const
|
||||||
|
{
|
||||||
|
return mFieldFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Color Property Getter
|
||||||
|
///
|
||||||
|
const QColor& ColorNode::color( void ) const
|
||||||
|
{
|
||||||
|
return mColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Key Property
|
||||||
|
///
|
||||||
|
const QString& ColorNode::key( void ) const
|
||||||
|
{
|
||||||
|
return mKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if TODO
|
#if TODO
|
||||||
QColor ColorNode::expand( MergeRecord? record )
|
QColor ColorNode::expand( MergeRecord? record )
|
||||||
{
|
{
|
||||||
@@ -102,23 +147,5 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
bool ColorNode::fieldFlag( void ) const
|
|
||||||
{
|
|
||||||
return mFieldFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const QColor& ColorNode::color( void ) const
|
|
||||||
{
|
|
||||||
return mColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const QString& ColorNode::key( void ) const
|
|
||||||
{
|
|
||||||
return mKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+43
-13
@@ -28,9 +28,15 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
class ColorNode
|
///
|
||||||
|
/// Color Node Type
|
||||||
|
///
|
||||||
|
struct ColorNode
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
ColorNode();
|
ColorNode();
|
||||||
|
|
||||||
@@ -40,27 +46,51 @@ namespace glabels
|
|||||||
|
|
||||||
ColorNode( const QString& key );
|
ColorNode( const QString& key );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Operators
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
bool operator==( const ColorNode& cn );
|
bool operator==( const ColorNode& cn );
|
||||||
|
|
||||||
bool operator!=( const ColorNode& cn );
|
bool operator!=( const ColorNode& cn );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// Field Flag Property
|
||||||
|
//
|
||||||
|
bool fieldFlag( void ) const;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Color Property
|
||||||
|
//
|
||||||
|
const QColor& color( void ) const;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Key Property
|
||||||
|
//
|
||||||
|
const QString& key( void ) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Methods
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
#if TODO
|
#if TODO
|
||||||
QColor expand( MergeRecord? record );
|
QColor expand( MergeRecord? record );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// field flag property
|
/////////////////////////////////
|
||||||
bool fieldFlag( void ) const;
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
|
|
||||||
// color property
|
|
||||||
const QColor& color( void ) const;
|
|
||||||
|
|
||||||
|
|
||||||
// key property
|
|
||||||
const QString& key( void ) const;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool mFieldFlag;
|
bool mFieldFlag;
|
||||||
QColor mColor;
|
QColor mColor;
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Open a New Label Dialog
|
||||||
|
///
|
||||||
void File::newLabel( QWidget *parent )
|
void File::newLabel( QWidget *parent )
|
||||||
{
|
{
|
||||||
NewLabelDialog newDialog( parent );
|
NewLabelDialog newDialog( parent );
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File Actions
|
||||||
|
///
|
||||||
namespace File
|
namespace File
|
||||||
{
|
{
|
||||||
void newLabel( QWidget *parent );
|
void newLabel( QWidget *parent );
|
||||||
|
|||||||
@@ -28,12 +28,18 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Display Help Contents
|
||||||
|
///
|
||||||
void Help::displayContents( QWidget *parent )
|
void Help::displayContents( QWidget *parent )
|
||||||
{
|
{
|
||||||
std::cout << "TODO: Help::displayContents" << std::endl;
|
std::cout << "TODO: Help::displayContents" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Display Help->About Dialog
|
||||||
|
///
|
||||||
void Help::displayAbout( QWidget *parent )
|
void Help::displayAbout( QWidget *parent )
|
||||||
{
|
{
|
||||||
QMessageBox aboutBox( QMessageBox::NoIcon,
|
QMessageBox aboutBox( QMessageBox::NoIcon,
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Help Actions
|
||||||
|
///
|
||||||
namespace Help
|
namespace Help
|
||||||
{
|
{
|
||||||
void displayContents( QWidget *parent );
|
void displayContents( QWidget *parent );
|
||||||
|
|||||||
+46
-4
@@ -27,6 +27,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Glabels Icons
|
||||||
|
///
|
||||||
namespace Icons
|
namespace Icons
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -40,6 +43,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Barcode : public QIcon
|
class Barcode : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -50,6 +54,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Box : public QIcon
|
class Box : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -60,6 +65,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Ellipse : public QIcon
|
class Ellipse : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -70,6 +76,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Image : public QIcon
|
class Image : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -80,6 +87,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Line : public QIcon
|
class Line : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -90,6 +98,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Text : public QIcon
|
class Text : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -100,6 +109,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Merge : public QIcon
|
class Merge : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -110,6 +120,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ObjectProperties : public QIcon
|
class ObjectProperties : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -120,6 +131,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignLeft : public QIcon
|
class AlignLeft : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -129,6 +141,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignHCenter : public QIcon
|
class AlignHCenter : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -138,6 +151,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignRight : public QIcon
|
class AlignRight : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -147,6 +161,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignBottom : public QIcon
|
class AlignBottom : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -156,6 +171,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignVCenter : public QIcon
|
class AlignVCenter : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -165,6 +181,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignTop : public QIcon
|
class AlignTop : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -174,6 +191,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class CenterHoriz : public QIcon
|
class CenterHoriz : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -183,6 +201,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class CenterVert : public QIcon
|
class CenterVert : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -192,6 +211,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FlipHoriz : public QIcon
|
class FlipHoriz : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -201,6 +221,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FlipVert : public QIcon
|
class FlipVert : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -210,6 +231,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class RotateLeft : public QIcon
|
class RotateLeft : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -219,6 +241,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class RotateRight : public QIcon
|
class RotateRight : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -228,6 +251,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class OrderBottom : public QIcon
|
class OrderBottom : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -237,6 +261,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class OrderTop : public QIcon
|
class OrderTop : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -246,6 +271,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignTextBottom : public QIcon
|
class AlignTextBottom : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -255,6 +281,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignTextMiddle : public QIcon
|
class AlignTextMiddle : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -264,6 +291,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AlignTextTop : public QIcon
|
class AlignTextTop : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -273,6 +301,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class BucketFill : public QIcon
|
class BucketFill : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -283,6 +312,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Pencil : public QIcon
|
class Pencil : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -293,6 +323,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Glabels : public QIcon
|
class Glabels : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -307,10 +338,10 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
///
|
||||||
* Fallback Icons. These are fallbacks for icons that would normally come from the current theme,
|
/// Fallback Icons. These are fallbacks for icons that would normally come from the current theme,
|
||||||
* if supported. These icons are copied from the mate-icon-theme (GPL-v3 or CC-BY-SA-v3).
|
/// if supported. These icons are copied from the mate-icon-theme (GPL-v3 or CC-BY-SA-v3).
|
||||||
*/
|
///
|
||||||
namespace Fallback
|
namespace Fallback
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -323,6 +354,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class EditCut : public QIcon
|
class EditCut : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -332,6 +364,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class EditPaste : public QIcon
|
class EditPaste : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -341,6 +374,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FileNew : public QIcon
|
class FileNew : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -350,6 +384,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FileOpen : public QIcon
|
class FileOpen : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -359,6 +394,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FilePrint : public QIcon
|
class FilePrint : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -368,6 +404,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FileSave : public QIcon
|
class FileSave : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -377,6 +414,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FileSaveAs : public QIcon
|
class FileSaveAs : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -386,6 +424,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ZoomBestFit : public QIcon
|
class ZoomBestFit : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -395,6 +434,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ZoomIn : public QIcon
|
class ZoomIn : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -404,6 +444,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ZoomOriginal : public QIcon
|
class ZoomOriginal : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -413,6 +454,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ZoomOut : public QIcon
|
class ZoomOut : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
+160
-40
@@ -29,17 +29,17 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
///
|
||||||
* Default constructor.
|
/// Default constructor.
|
||||||
*/
|
///
|
||||||
LabelModel::LabelModel() : mModified(true), mTmplate(0), mRotate(false)
|
LabelModel::LabelModel() : mModified(true), mTmplate(0), mRotate(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
///
|
||||||
* Add object.
|
/// Add object.
|
||||||
*/
|
///
|
||||||
void LabelModel::addObject( LabelModelObject* object )
|
void LabelModel::addObject( LabelModelObject* object )
|
||||||
{
|
{
|
||||||
object->setParent( this );
|
object->setParent( this );
|
||||||
@@ -55,6 +55,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Object Changed Slot
|
||||||
|
///
|
||||||
void LabelModel::onObjectChanged()
|
void LabelModel::onObjectChanged()
|
||||||
{
|
{
|
||||||
mModified = true;
|
mModified = true;
|
||||||
@@ -64,6 +67,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Object Moved Slot
|
||||||
|
///
|
||||||
void LabelModel::onObjectMoved()
|
void LabelModel::onObjectMoved()
|
||||||
{
|
{
|
||||||
mModified = true;
|
mModified = true;
|
||||||
@@ -73,6 +79,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Delete Object
|
||||||
|
///
|
||||||
void LabelModel::deleteObject( LabelModelObject* object )
|
void LabelModel::deleteObject( LabelModelObject* object )
|
||||||
{
|
{
|
||||||
object->unselect();
|
object->unselect();
|
||||||
@@ -87,9 +96,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
///
|
||||||
* Select object.
|
/// Select Object
|
||||||
*/
|
///
|
||||||
void LabelModel::selectObject( LabelModelObject* object )
|
void LabelModel::selectObject( LabelModelObject* object )
|
||||||
{
|
{
|
||||||
object->select();
|
object->select();
|
||||||
@@ -98,9 +107,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
///
|
||||||
* Unselect object.
|
/// Unselect Object
|
||||||
*/
|
///
|
||||||
void LabelModel::unselectObject( LabelModelObject* object )
|
void LabelModel::unselectObject( LabelModelObject* object )
|
||||||
{
|
{
|
||||||
object->unselect();
|
object->unselect();
|
||||||
@@ -109,9 +118,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
///
|
||||||
* Select all objects.
|
/// Select All Objects
|
||||||
*/
|
///
|
||||||
void LabelModel::selectAll()
|
void LabelModel::selectAll()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -123,9 +132,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
///
|
||||||
* Unselect object all objects.
|
/// Unselect All Objects
|
||||||
*/
|
///
|
||||||
void LabelModel::unselectAll()
|
void LabelModel::unselectAll()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -137,6 +146,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Select Region
|
||||||
|
///
|
||||||
void LabelModel::selectRegion( const LabelRegion ®ion )
|
void LabelModel::selectRegion( const LabelRegion ®ion )
|
||||||
{
|
{
|
||||||
double rX1 = std::min( region.x1(), region.x2() );
|
double rX1 = std::min( region.x1(), region.x2() );
|
||||||
@@ -161,6 +173,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Is Selection Empty?
|
||||||
|
///
|
||||||
bool LabelModel::isSelectionEmpty()
|
bool LabelModel::isSelectionEmpty()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -175,6 +190,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Is Selection Atomic?
|
||||||
|
///
|
||||||
bool LabelModel::isSelectionAtomic()
|
bool LabelModel::isSelectionAtomic()
|
||||||
{
|
{
|
||||||
int nSelected = 0;
|
int nSelected = 0;
|
||||||
@@ -195,6 +213,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Get List of Selected Objects
|
||||||
|
///
|
||||||
QList<LabelModelObject*> LabelModel::getSelection()
|
QList<LabelModelObject*> LabelModel::getSelection()
|
||||||
{
|
{
|
||||||
QList<LabelModelObject*> selectedList;
|
QList<LabelModelObject*> selectedList;
|
||||||
@@ -210,6 +231,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Get First Object in Selection List
|
||||||
|
///
|
||||||
LabelModelObject* LabelModel::getFirstSelectedObject()
|
LabelModelObject* LabelModel::getFirstSelectedObject()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -222,6 +246,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Any Objects in Selection Accept Text Properties?
|
||||||
|
///
|
||||||
bool LabelModel::canSelectionText()
|
bool LabelModel::canSelectionText()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -236,6 +263,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Any Objects in Selection Accept Fill Property?
|
||||||
|
///
|
||||||
bool LabelModel::canSelectionFill()
|
bool LabelModel::canSelectionFill()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -250,6 +280,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Any Objects in Selection Accept Line Color Property?
|
||||||
|
///
|
||||||
bool LabelModel::canSelectionLineColor()
|
bool LabelModel::canSelectionLineColor()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -264,6 +297,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Any Objects in Selection Accept Line Width Property?
|
||||||
|
///
|
||||||
bool LabelModel::canSelectionLineWidth()
|
bool LabelModel::canSelectionLineWidth()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -278,6 +314,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Delete Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::deleteSelection()
|
void LabelModel::deleteSelection()
|
||||||
{
|
{
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
@@ -294,6 +333,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Raise Selected Objects To Top
|
||||||
|
///
|
||||||
void LabelModel::raiseSelectionToTop()
|
void LabelModel::raiseSelectionToTop()
|
||||||
{
|
{
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
@@ -303,7 +345,7 @@ namespace glabels
|
|||||||
mObjectList.removeOne( object );
|
mObjectList.removeOne( object );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move to end of list, representing top most object. */
|
/// Move to end of list, representing top most object.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
mObjectList.push_back( object );
|
mObjectList.push_back( object );
|
||||||
@@ -316,6 +358,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Lower Selected Objects To Bottom
|
||||||
|
///
|
||||||
void LabelModel::lowerSelectionToBottom()
|
void LabelModel::lowerSelectionToBottom()
|
||||||
{
|
{
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
@@ -325,7 +370,7 @@ namespace glabels
|
|||||||
mObjectList.removeOne( object );
|
mObjectList.removeOne( object );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move to front of list, representing bottom most object. */
|
/// Move to front of list, representing bottom most object.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
mObjectList.push_front( object );
|
mObjectList.push_front( object );
|
||||||
@@ -338,6 +383,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Rotate Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::rotateSelection( double thetaDegs )
|
void LabelModel::rotateSelection( double thetaDegs )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -354,18 +402,27 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Rotate Selected Objects Left 90 degrees
|
||||||
|
///
|
||||||
void LabelModel::rotateSelectionLeft()
|
void LabelModel::rotateSelectionLeft()
|
||||||
{
|
{
|
||||||
rotateSelection( -90.0 );
|
rotateSelection( -90.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Rotate Selected Objects Right 90 degrees
|
||||||
|
///
|
||||||
void LabelModel::rotateSelectionRight()
|
void LabelModel::rotateSelectionRight()
|
||||||
{
|
{
|
||||||
rotateSelection( 90.0 );
|
rotateSelection( 90.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Flip Selected Objects Horizontally
|
||||||
|
///
|
||||||
void LabelModel::flipSelectionHoriz()
|
void LabelModel::flipSelectionHoriz()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -382,6 +439,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Flip Selected Objects Vertically
|
||||||
|
///
|
||||||
void LabelModel::flipSelectionVert()
|
void LabelModel::flipSelectionVert()
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -398,6 +458,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Align Selected Objects To Their Left Edges
|
||||||
|
///
|
||||||
void LabelModel::alignSelectionLeft()
|
void LabelModel::alignSelectionLeft()
|
||||||
{
|
{
|
||||||
if ( isSelectionEmpty() || isSelectionAtomic() )
|
if ( isSelectionEmpty() || isSelectionAtomic() )
|
||||||
@@ -407,15 +470,15 @@ namespace glabels
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/* Find left-most edge. */
|
/// Find left-most edge.
|
||||||
double x1_min = 7200; /* Start with a very large value: 7200pts = 100in */
|
double x1_min = 7200; /// Start with a very large value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
if ( r.x1() < x1_min ) x1_min = r.x1();
|
if ( r.x1() < x1_min ) x1_min = r.x1();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now adjust the object positions to line up the left edges at left-most edge. */
|
/// Now adjust the object positions to line up the left edges at left-most edge.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -429,6 +492,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Align Selected Objects To Their Right Edges
|
||||||
|
///
|
||||||
void LabelModel::alignSelectionRight()
|
void LabelModel::alignSelectionRight()
|
||||||
{
|
{
|
||||||
if ( isSelectionEmpty() || isSelectionAtomic() )
|
if ( isSelectionEmpty() || isSelectionAtomic() )
|
||||||
@@ -438,15 +504,15 @@ namespace glabels
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/* Find right-most edge. */
|
/// Find right-most edge.
|
||||||
double x1_max = -7200; /* Start with a very large negative value: 7200pts = 100in */
|
double x1_max = -7200; /// Start with a very large negative value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
if ( r.x1() > x1_max ) x1_max = r.x1();
|
if ( r.x1() > x1_max ) x1_max = r.x1();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now adjust the object positions to line up the right edges at right-most edge. */
|
/// Now adjust the object positions to line up the right edges at right-most edge.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -460,6 +526,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Align Selected Objects To Their Horizontal Centers
|
||||||
|
///
|
||||||
void LabelModel::alignSelectionHCenter()
|
void LabelModel::alignSelectionHCenter()
|
||||||
{
|
{
|
||||||
if ( isSelectionEmpty() || isSelectionAtomic() )
|
if ( isSelectionEmpty() || isSelectionAtomic() )
|
||||||
@@ -469,7 +538,7 @@ namespace glabels
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/* Find average center of objects. */
|
/// Find average center of objects.
|
||||||
double xsum = 0;
|
double xsum = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
@@ -480,8 +549,8 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
double xavg = xsum / n;
|
double xavg = xsum / n;
|
||||||
|
|
||||||
/* Find object closest to average center of objects. */
|
/// Find object closest to average center of objects.
|
||||||
double xcenter = 7200; /* Start with very large value. */
|
double xcenter = 7200; /// Start with very large value.
|
||||||
double dxmin = fabs( xavg - xcenter );
|
double dxmin = fabs( xavg - xcenter );
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
@@ -494,7 +563,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now adjust the object positions to line up with the center of this object. */
|
/// Now adjust the object positions to line up with the center of this object.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -508,6 +577,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Align Selected Objects To Their Top Edges
|
||||||
|
///
|
||||||
void LabelModel::alignSelectionTop()
|
void LabelModel::alignSelectionTop()
|
||||||
{
|
{
|
||||||
if ( isSelectionEmpty() || isSelectionAtomic() )
|
if ( isSelectionEmpty() || isSelectionAtomic() )
|
||||||
@@ -517,15 +589,15 @@ namespace glabels
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/* Find top-most edge. */
|
/// Find top-most edge.
|
||||||
double y1_min = 7200; /* Start with a very large value: 7200pts = 100in */
|
double y1_min = 7200; /// Start with a very large value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
if ( r.y1() < y1_min ) y1_min = r.y1();
|
if ( r.y1() < y1_min ) y1_min = r.y1();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now adjust the object positions to line up the top edges at top-most edge. */
|
/// Now adjust the object positions to line up the top edges at top-most edge.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -539,6 +611,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Align Selected Objects To Their Bottom Edges
|
||||||
|
///
|
||||||
void LabelModel::alignSelectionBottom()
|
void LabelModel::alignSelectionBottom()
|
||||||
{
|
{
|
||||||
if ( isSelectionEmpty() || isSelectionAtomic() )
|
if ( isSelectionEmpty() || isSelectionAtomic() )
|
||||||
@@ -548,15 +623,15 @@ namespace glabels
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/* Find bottom-most edge. */
|
/// Find bottom-most edge.
|
||||||
double y1_max = -7200; /* Start with a very large negative value: 7200pts = 100in */
|
double y1_max = -7200; /// Start with a very large negative value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
if ( r.y1() > y1_max ) y1_max = r.y1();
|
if ( r.y1() > y1_max ) y1_max = r.y1();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now adjust the object positions to line up the bottom edges at bottom-most edge. */
|
/// Now adjust the object positions to line up the bottom edges at bottom-most edge.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -570,6 +645,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Align Selected Objects To Their Vertical Centers Edges
|
||||||
|
///
|
||||||
void LabelModel::alignSelectionVCenter()
|
void LabelModel::alignSelectionVCenter()
|
||||||
{
|
{
|
||||||
if ( isSelectionEmpty() || isSelectionAtomic() )
|
if ( isSelectionEmpty() || isSelectionAtomic() )
|
||||||
@@ -579,7 +657,7 @@ namespace glabels
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/* Find average center of objects. */
|
/// Find average center of objects.
|
||||||
double ysum = 0;
|
double ysum = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
@@ -590,8 +668,8 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
double yavg = ysum / n;
|
double yavg = ysum / n;
|
||||||
|
|
||||||
/* Find object closest to average center of objects. */
|
/// Find object closest to average center of objects.
|
||||||
double ycenter = 7200; /* Start with very large value. */
|
double ycenter = 7200; /// Start with very large value.
|
||||||
double dymin = fabs( yavg - ycenter );
|
double dymin = fabs( yavg - ycenter );
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
@@ -604,7 +682,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now adjust the object positions to line up with the center of this object. */
|
/// Now adjust the object positions to line up with the center of this object.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -618,6 +696,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Align Selected Objects To Center Of Label Horizontally
|
||||||
|
///
|
||||||
void LabelModel::centerSelectionHoriz()
|
void LabelModel::centerSelectionHoriz()
|
||||||
{
|
{
|
||||||
double xLabelCenter = w() / 2.0;
|
double xLabelCenter = w() / 2.0;
|
||||||
@@ -639,6 +720,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Align Selected Objects To Center Of Label Vertically
|
||||||
|
///
|
||||||
void LabelModel::centerSelectionVert()
|
void LabelModel::centerSelectionVert()
|
||||||
{
|
{
|
||||||
double yLabelCenter = h() / 2.0;
|
double yLabelCenter = h() / 2.0;
|
||||||
@@ -660,6 +744,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Move Selected Objects By dx,dy
|
||||||
|
///
|
||||||
void LabelModel::moveSelection( double dx, double dy )
|
void LabelModel::moveSelection( double dx, double dy )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -676,6 +763,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Font Family Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionFontFamily( const QString &fontFamily )
|
void LabelModel::setSelectionFontFamily( const QString &fontFamily )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -692,6 +782,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Font Size Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionFontSize( double fontSize )
|
void LabelModel::setSelectionFontSize( double fontSize )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -708,6 +801,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Font Weight Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionFontWeight( QFont::Weight fontWeight )
|
void LabelModel::setSelectionFontWeight( QFont::Weight fontWeight )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -724,6 +820,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Font Italic Flag Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionFontItalicFlag( bool fontItalicFlag )
|
void LabelModel::setSelectionFontItalicFlag( bool fontItalicFlag )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -740,6 +839,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Text Horizontal Alignment Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionTextHAlign( Qt::Alignment textHAlign )
|
void LabelModel::setSelectionTextHAlign( Qt::Alignment textHAlign )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -756,6 +858,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Text Vertical Alignment Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionTextVAlign( Qt::Alignment textVAlign )
|
void LabelModel::setSelectionTextVAlign( Qt::Alignment textVAlign )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -772,6 +877,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Text Line Spacing Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionTextLineSpacing( double textLineSpacing )
|
void LabelModel::setSelectionTextLineSpacing( double textLineSpacing )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -788,6 +896,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Text Color Node Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionTextColorNode( ColorNode textColorNode )
|
void LabelModel::setSelectionTextColorNode( ColorNode textColorNode )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -804,6 +915,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Line Width Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionLineWidth( double lineWidth )
|
void LabelModel::setSelectionLineWidth( double lineWidth )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -820,6 +934,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Line Color Node Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionLineColorNode( ColorNode lineColorNode )
|
void LabelModel::setSelectionLineColorNode( ColorNode lineColorNode )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
@@ -836,6 +953,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Fill Color Node Of Selected Objects
|
||||||
|
///
|
||||||
void LabelModel::setSelectionFillColorNode( ColorNode fillColorNode )
|
void LabelModel::setSelectionFillColorNode( ColorNode fillColorNode )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
|
|||||||
@@ -28,23 +28,35 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
LabelModelBoxObject::LabelModelBoxObject( QObject* parent ) : LabelModelObject(parent)
|
LabelModelBoxObject::LabelModelBoxObject( QObject* parent ) : LabelModelObject(parent)
|
||||||
{
|
{
|
||||||
/* TODO: initialize default line and fill poperties. */
|
/* TODO: initialize default line and fill poperties. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Destructor
|
||||||
|
///
|
||||||
LabelModelBoxObject::~LabelModelBoxObject()
|
LabelModelBoxObject::~LabelModelBoxObject()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Line Width Property Getter
|
||||||
|
///
|
||||||
double LabelModelBoxObject::lineWidth( void ) const
|
double LabelModelBoxObject::lineWidth( void ) const
|
||||||
{
|
{
|
||||||
return mLineWidth;
|
return mLineWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Line Width Property Setter
|
||||||
|
///
|
||||||
void LabelModelBoxObject::setLineWidth( double value )
|
void LabelModelBoxObject::setLineWidth( double value )
|
||||||
{
|
{
|
||||||
if ( mLineWidth != value )
|
if ( mLineWidth != value )
|
||||||
@@ -55,12 +67,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Line Color Node Property Getter
|
||||||
|
///
|
||||||
ColorNode LabelModelBoxObject::lineColorNode( void ) const
|
ColorNode LabelModelBoxObject::lineColorNode( void ) const
|
||||||
{
|
{
|
||||||
return mLineColorNode;
|
return mLineColorNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Line Color Node Property Setter
|
||||||
|
///
|
||||||
void LabelModelBoxObject::setLineColorNode( const ColorNode& value )
|
void LabelModelBoxObject::setLineColorNode( const ColorNode& value )
|
||||||
{
|
{
|
||||||
if ( mLineColorNode != value )
|
if ( mLineColorNode != value )
|
||||||
@@ -71,12 +89,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Fill Color Node Property Getter
|
||||||
|
///
|
||||||
ColorNode LabelModelBoxObject::fillColorNode( void ) const
|
ColorNode LabelModelBoxObject::fillColorNode( void ) const
|
||||||
{
|
{
|
||||||
return mFillColorNode;
|
return mFillColorNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Fill Color Node Property Setter
|
||||||
|
///
|
||||||
void LabelModelBoxObject::setFillColorNode( const ColorNode& value )
|
void LabelModelBoxObject::setFillColorNode( const ColorNode& value )
|
||||||
{
|
{
|
||||||
if ( mFillColorNode != value )
|
if ( mFillColorNode != value )
|
||||||
@@ -87,25 +111,36 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Fill Capability Implementation
|
||||||
|
///
|
||||||
bool LabelModelBoxObject::canFill()
|
bool LabelModelBoxObject::canFill()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Line Color Capability Implementation
|
||||||
|
///
|
||||||
bool LabelModelBoxObject::canLineColor()
|
bool LabelModelBoxObject::canLineColor()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Can Line Width Capability Implementation
|
||||||
|
///
|
||||||
bool LabelModelBoxObject::canLineWidth()
|
bool LabelModelBoxObject::canLineWidth()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create QGraphicsItem suitable for representing this object
|
///
|
||||||
|
/// Create QGraphicsItem suitable for representing this object
|
||||||
|
///
|
||||||
QGraphicsItem* LabelModelBoxObject::createGraphicsItem()
|
QGraphicsItem* LabelModelBoxObject::createGraphicsItem()
|
||||||
{
|
{
|
||||||
QGraphicsRectItem *rectItem = new QGraphicsRectItem( x0(), y0(), w(), h() );
|
QGraphicsRectItem *rectItem = new QGraphicsRectItem( x0(), y0(), w(), h() );
|
||||||
@@ -125,7 +160,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Update a QGraphicsItem to keep it in sync with this object
|
///
|
||||||
|
/// Update a QGraphicsItem to keep it in sync with this object
|
||||||
|
///
|
||||||
void LabelModelBoxObject::updateGraphicsItem( QGraphicsItem* graphicsItem )
|
void LabelModelBoxObject::updateGraphicsItem( QGraphicsItem* graphicsItem )
|
||||||
{
|
{
|
||||||
QGraphicsRectItem *rectItem = dynamic_cast<QGraphicsRectItem*>(graphicsItem);
|
QGraphicsRectItem *rectItem = dynamic_cast<QGraphicsRectItem*>(graphicsItem);
|
||||||
|
|||||||
+17
-14
@@ -27,6 +27,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Label Model Box Object
|
||||||
|
///
|
||||||
class LabelModelBoxObject : public LabelModelObject
|
class LabelModelBoxObject : public LabelModelObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -40,32 +43,32 @@ namespace glabels
|
|||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
// Properties
|
// Property Implementations
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
/*
|
//
|
||||||
* Virtual Shape Property: lineWidth
|
// Shape Property: lineWidth
|
||||||
*/
|
//
|
||||||
virtual double lineWidth( void ) const;
|
virtual double lineWidth( void ) const;
|
||||||
virtual void setLineWidth( double value );
|
virtual void setLineWidth( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Shape Property: lineColorNode
|
// Shape Property: lineColorNode
|
||||||
*/
|
//
|
||||||
virtual ColorNode lineColorNode( void ) const;
|
virtual ColorNode lineColorNode( void ) const;
|
||||||
virtual void setLineColorNode( const ColorNode& value );
|
virtual void setLineColorNode( const ColorNode& value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Shape Property: fillColorNode
|
// Shape Property: fillColorNode
|
||||||
*/
|
//
|
||||||
virtual ColorNode fillColorNode( void ) const;
|
virtual ColorNode fillColorNode( void ) const;
|
||||||
virtual void setFillColorNode( const ColorNode& value );
|
virtual void setFillColorNode( const ColorNode& value );
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
// Capabilities
|
// Capability Implementations
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
virtual bool canFill();
|
virtual bool canFill();
|
||||||
@@ -74,11 +77,11 @@ namespace glabels
|
|||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
// QGraphicsItem methods
|
// QGraphicsItem Method Implementations
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
QGraphicsItem* createGraphicsItem();
|
virtual QGraphicsItem* createGraphicsItem();
|
||||||
void updateGraphicsItem( QGraphicsItem* graphicsItem );
|
virtual void updateGraphicsItem( QGraphicsItem* graphicsItem );
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
|
|||||||
+293
-10
@@ -35,14 +35,18 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
int LabelModelObject::lastId = 0;
|
///
|
||||||
|
/// Next Object ID
|
||||||
|
///
|
||||||
|
int LabelModelObject::msNextId = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
* Default constructor.
|
///
|
||||||
*/
|
/// Constructor
|
||||||
|
///
|
||||||
LabelModelObject::LabelModelObject( QObject *parent = 0 ) : QObject(parent)
|
LabelModelObject::LabelModelObject( QObject *parent = 0 ) : QObject(parent)
|
||||||
{
|
{
|
||||||
mId = lastId++;
|
mId = msNextId++;
|
||||||
|
|
||||||
mX0 = 0;
|
mX0 = 0;
|
||||||
mY0 = 0;
|
mY0 = 0;
|
||||||
@@ -60,41 +64,62 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Destructor
|
||||||
|
///
|
||||||
LabelModelObject::~LabelModelObject()
|
LabelModelObject::~LabelModelObject()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// ID Property Getter
|
||||||
|
///
|
||||||
int LabelModelObject::id() const
|
int LabelModelObject::id() const
|
||||||
{
|
{
|
||||||
return mId;
|
return mId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Selected Property Getter
|
||||||
|
///
|
||||||
bool LabelModelObject::isSelected() const
|
bool LabelModelObject::isSelected() const
|
||||||
{
|
{
|
||||||
return mSelectedFlag;
|
return mSelectedFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Selected Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::select( bool value )
|
void LabelModelObject::select( bool value )
|
||||||
{
|
{
|
||||||
mSelectedFlag = value;
|
mSelectedFlag = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Clear Selected Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::unselect()
|
void LabelModelObject::unselect()
|
||||||
{
|
{
|
||||||
mSelectedFlag = false;
|
mSelectedFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// X0 Property Getter
|
||||||
|
///
|
||||||
double LabelModelObject::x0() const
|
double LabelModelObject::x0() const
|
||||||
{
|
{
|
||||||
return mX0;
|
return mX0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// X0 Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setX0( double value )
|
void LabelModelObject::setX0( double value )
|
||||||
{
|
{
|
||||||
if ( mX0 != value )
|
if ( mX0 != value )
|
||||||
@@ -105,12 +130,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Y0 Property Getter
|
||||||
|
///
|
||||||
double LabelModelObject::y0() const
|
double LabelModelObject::y0() const
|
||||||
{
|
{
|
||||||
return mY0;
|
return mY0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Y0 Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setY0( double value )
|
void LabelModelObject::setY0( double value )
|
||||||
{
|
{
|
||||||
if ( mY0 != value )
|
if ( mY0 != value )
|
||||||
@@ -121,12 +152,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// W (Width) Property Getter
|
||||||
|
///
|
||||||
double LabelModelObject::w() const
|
double LabelModelObject::w() const
|
||||||
{
|
{
|
||||||
return mW;
|
return mW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// W (Width) Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setW( double value )
|
void LabelModelObject::setW( double value )
|
||||||
{
|
{
|
||||||
if ( mW != value )
|
if ( mW != value )
|
||||||
@@ -137,12 +174,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// H (Height) Property Getter
|
||||||
|
///
|
||||||
double LabelModelObject::h() const
|
double LabelModelObject::h() const
|
||||||
{
|
{
|
||||||
return mH;
|
return mH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// H (Height) Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setH( double value )
|
void LabelModelObject::setH( double value )
|
||||||
{
|
{
|
||||||
if ( mH != value )
|
if ( mH != value )
|
||||||
@@ -153,12 +196,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Matrix Property Getter
|
||||||
|
///
|
||||||
QTransform LabelModelObject::matrix() const
|
QTransform LabelModelObject::matrix() const
|
||||||
{
|
{
|
||||||
return mMatrix;
|
return mMatrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Matrix Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setMatrix( const QTransform& value )
|
void LabelModelObject::setMatrix( const QTransform& value )
|
||||||
{
|
{
|
||||||
if ( mMatrix != value )
|
if ( mMatrix != value )
|
||||||
@@ -169,12 +218,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow State Property Getter
|
||||||
|
///
|
||||||
bool LabelModelObject::shadow() const
|
bool LabelModelObject::shadow() const
|
||||||
{
|
{
|
||||||
return mShadowState;
|
return mShadowState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow State Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setShadow( bool value )
|
void LabelModelObject::setShadow( bool value )
|
||||||
{
|
{
|
||||||
if ( mShadowState != value )
|
if ( mShadowState != value )
|
||||||
@@ -185,12 +240,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow X Property Getter
|
||||||
|
///
|
||||||
double LabelModelObject::shadowX() const
|
double LabelModelObject::shadowX() const
|
||||||
{
|
{
|
||||||
return mShadowX;
|
return mShadowX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow X Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setShadowX( double value )
|
void LabelModelObject::setShadowX( double value )
|
||||||
{
|
{
|
||||||
if ( mShadowX != value )
|
if ( mShadowX != value )
|
||||||
@@ -201,12 +262,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow Y Property Getter
|
||||||
|
///
|
||||||
double LabelModelObject::shadowY() const
|
double LabelModelObject::shadowY() const
|
||||||
{
|
{
|
||||||
return mShadowY;
|
return mShadowY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow Y Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setShadowY( double value )
|
void LabelModelObject::setShadowY( double value )
|
||||||
{
|
{
|
||||||
if ( mShadowY != value )
|
if ( mShadowY != value )
|
||||||
@@ -217,12 +284,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow Opacity Property Getter
|
||||||
|
///
|
||||||
double LabelModelObject::shadowOpacity() const
|
double LabelModelObject::shadowOpacity() const
|
||||||
{
|
{
|
||||||
return mShadowOpacity;
|
return mShadowOpacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow Opacity Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setShadowOpacity( double value )
|
void LabelModelObject::setShadowOpacity( double value )
|
||||||
{
|
{
|
||||||
if ( mShadowOpacity != value )
|
if ( mShadowOpacity != value )
|
||||||
@@ -233,12 +306,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow Color Node Property Getter
|
||||||
|
///
|
||||||
ColorNode LabelModelObject::shadowColorNode() const
|
ColorNode LabelModelObject::shadowColorNode() const
|
||||||
{
|
{
|
||||||
return mShadowColorNode;
|
return mShadowColorNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Shadow Color Node Property Setter
|
||||||
|
///
|
||||||
void LabelModelObject::setShadowColorNode( const ColorNode& value )
|
void LabelModelObject::setShadowColorNode( const ColorNode& value )
|
||||||
{
|
{
|
||||||
if ( mShadowColorNode != value )
|
if ( mShadowColorNode != value )
|
||||||
@@ -249,239 +328,410 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Family Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
QString LabelModelObject::fontFamily() const
|
QString LabelModelObject::fontFamily() const
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Family Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setFontFamily( const QString& value )
|
void LabelModelObject::setFontFamily( const QString& value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Size Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
double LabelModelObject::fontSize() const
|
double LabelModelObject::fontSize() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Size Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setFontSize( double value )
|
void LabelModelObject::setFontSize( double value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Weight Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
QFont::Weight LabelModelObject::fontWeight() const
|
QFont::Weight LabelModelObject::fontWeight() const
|
||||||
{
|
{
|
||||||
return QFont::Normal;
|
return QFont::Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Weight Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setFontWeight( QFont::Weight value )
|
void LabelModelObject::setFontWeight( QFont::Weight value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Italic Flag Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
bool LabelModelObject::fontItalicFlag() const
|
bool LabelModelObject::fontItalicFlag() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Italic Flag Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setFontItalicFlag( bool value )
|
void LabelModelObject::setFontItalicFlag( bool value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Underline Flag Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
bool LabelModelObject::fontUnderlineFlag() const
|
bool LabelModelObject::fontUnderlineFlag() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Font Underline Flag Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setFontUnderlineFlag( bool value )
|
void LabelModelObject::setFontUnderlineFlag( bool value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Text Color Node Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
ColorNode LabelModelObject::textColorNode() const
|
ColorNode LabelModelObject::textColorNode() const
|
||||||
{
|
{
|
||||||
return ColorNode( QColor::fromRgba(0x00000000) );
|
return ColorNode( QColor::fromRgba(0x00000000) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Text Color Node Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setTextColorNode( const ColorNode &value )
|
void LabelModelObject::setTextColorNode( const ColorNode &value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Text Horizontal Alignment Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
Qt::Alignment LabelModelObject::textHAlign() const
|
Qt::Alignment LabelModelObject::textHAlign() const
|
||||||
{
|
{
|
||||||
return Qt::AlignLeft;
|
return Qt::AlignLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Text Horizontal Alignment Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setTextHAlign( Qt::Alignment value )
|
void LabelModelObject::setTextHAlign( Qt::Alignment value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Text Vertical Alignment Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
Qt::Alignment LabelModelObject::textVAlign() const
|
Qt::Alignment LabelModelObject::textVAlign() const
|
||||||
{
|
{
|
||||||
return Qt::AlignTop;
|
return Qt::AlignTop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Text Vertical Alignment Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setTextVAlign( Qt::Alignment value )
|
void LabelModelObject::setTextVAlign( Qt::Alignment value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Text Line Spacing Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
double LabelModelObject::textLineSpacing() const
|
double LabelModelObject::textLineSpacing() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Text Line Spacing Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setTextLineSpacing( double value )
|
void LabelModelObject::setTextLineSpacing( double value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Filename Node Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
TextNode LabelModelObject::filenameNode() const
|
TextNode LabelModelObject::filenameNode() const
|
||||||
{
|
{
|
||||||
return TextNode();
|
return TextNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Filename Node Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setFilenameNode( const TextNode& value )
|
void LabelModelObject::setFilenameNode( const TextNode& value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Line Width Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
double LabelModelObject::lineWidth() const
|
double LabelModelObject::lineWidth() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Line Width Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setLineWidth( double value )
|
void LabelModelObject::setLineWidth( double value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Line Color Node Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
ColorNode LabelModelObject::lineColorNode() const
|
ColorNode LabelModelObject::lineColorNode() const
|
||||||
{
|
{
|
||||||
return ColorNode( QColor::fromRgba(0x00000000) );
|
return ColorNode( QColor::fromRgba(0x00000000) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Line Color Node Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setLineColorNode( const ColorNode &value )
|
void LabelModelObject::setLineColorNode( const ColorNode &value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Fill Color Node Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
ColorNode LabelModelObject::fillColorNode() const
|
ColorNode LabelModelObject::fillColorNode() const
|
||||||
{
|
{
|
||||||
return ColorNode( QColor::fromRgba(0x00000000) );
|
return ColorNode( QColor::fromRgba(0x00000000) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Fill Color Node Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setFillColorNode( const ColorNode &value )
|
void LabelModelObject::setFillColorNode( const ColorNode &value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Data Node Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
TextNode LabelModelObject::bcDataNode() const
|
TextNode LabelModelObject::bcDataNode() const
|
||||||
{
|
{
|
||||||
return TextNode();
|
return TextNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Data Node Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setBcDataNode( const TextNode &value )
|
void LabelModelObject::setBcDataNode( const TextNode &value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Text Flag Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
bool LabelModelObject::bcTextFlag() const
|
bool LabelModelObject::bcTextFlag() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Text Flag Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setBcTextFlag( bool value )
|
void LabelModelObject::setBcTextFlag( bool value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Checksum Flag Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
bool LabelModelObject::bcChecksumFlag() const
|
bool LabelModelObject::bcChecksumFlag() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Checksum Flag Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setBcChecksumFlag( bool value )
|
void LabelModelObject::setBcChecksumFlag( bool value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Color Node Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
ColorNode LabelModelObject::bcColorNode() const
|
ColorNode LabelModelObject::bcColorNode() const
|
||||||
{
|
{
|
||||||
return ColorNode( QColor::fromRgba(0x00000000) );
|
return ColorNode( QColor::fromRgba(0x00000000) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Color Node Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setBcColorNode( const ColorNode &value )
|
void LabelModelObject::setBcColorNode( const ColorNode &value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Style Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
BarcodeStyle LabelModelObject::bcStyle() const
|
BarcodeStyle LabelModelObject::bcStyle() const
|
||||||
{
|
{
|
||||||
return BarcodeStyle();
|
return BarcodeStyle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Style Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setBcStyle( const BarcodeStyle &value )
|
void LabelModelObject::setBcStyle( const BarcodeStyle &value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Format Digits Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
int LabelModelObject::bcFormatDigits() const
|
int LabelModelObject::bcFormatDigits() const
|
||||||
{
|
{
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Barcode Format Digits Property Default Setter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
void LabelModelObject::setBcFormatDigits( int value )
|
void LabelModelObject::setBcFormatDigits( int value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Can Text Capability Read-Only Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
bool LabelModelObject::canText() const
|
bool LabelModelObject::canText() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Can Fill Capability Read-Only Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
bool LabelModelObject::canFill() const
|
bool LabelModelObject::canFill() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Can Line Color Capability Read-Only Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
bool LabelModelObject::canLineColor() const
|
bool LabelModelObject::canLineColor() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Virtual Can Line Width Capability Read-Only Property Default Getter
|
||||||
|
/// (Overridden by concrete class)
|
||||||
|
///
|
||||||
bool LabelModelObject::canLineWidth() const
|
bool LabelModelObject::canLineWidth() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Absolute Position
|
||||||
|
///
|
||||||
void LabelModelObject::setPosition( double x0, double y0 )
|
void LabelModelObject::setPosition( double x0, double y0 )
|
||||||
{
|
{
|
||||||
if ( ( mX0 != x0 ) || ( mY0 != y0 ) )
|
if ( ( mX0 != x0 ) || ( mY0 != y0 ) )
|
||||||
@@ -494,6 +744,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Relative Position
|
||||||
|
///
|
||||||
void LabelModelObject::setPositionRelative( double dx, double dy )
|
void LabelModelObject::setPositionRelative( double dx, double dy )
|
||||||
{
|
{
|
||||||
if ( ( dx != 0 ) || ( dy != 0 ) )
|
if ( ( dx != 0 ) || ( dy != 0 ) )
|
||||||
@@ -506,6 +759,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Size
|
||||||
|
///
|
||||||
void LabelModelObject::setSize( double w, double h )
|
void LabelModelObject::setSize( double w, double h )
|
||||||
{
|
{
|
||||||
mW = w;
|
mW = w;
|
||||||
@@ -513,6 +769,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Size (But Maintain Current Aspect Ratio)
|
||||||
|
///
|
||||||
void LabelModelObject::setSizeHonorAspect( double w, double h )
|
void LabelModelObject::setSizeHonorAspect( double w, double h )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
@@ -536,6 +795,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Width (But Maintain Current Aspect Ratio)
|
||||||
|
///
|
||||||
void LabelModelObject::setWHonorAspect( double w )
|
void LabelModelObject::setWHonorAspect( double w )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
@@ -551,6 +813,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Height (But Maintain Current Aspect Ratio)
|
||||||
|
///
|
||||||
void LabelModelObject::setHHonorAspect( double h )
|
void LabelModelObject::setHHonorAspect( double h )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
@@ -566,6 +831,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Get Extent of Bounding Box
|
||||||
|
///
|
||||||
LabelRegion LabelModelObject::getExtent()
|
LabelRegion LabelModelObject::getExtent()
|
||||||
{
|
{
|
||||||
QPointF a1( - lineWidth()/2, - lineWidth()/2 );
|
QPointF a1( - lineWidth()/2, - lineWidth()/2 );
|
||||||
@@ -579,15 +847,18 @@ namespace glabels
|
|||||||
a4 = mMatrix.map( a4 );
|
a4 = mMatrix.map( a4 );
|
||||||
|
|
||||||
LabelRegion region;
|
LabelRegion region;
|
||||||
region.x1( std::min( a1.x(), std::min( a2.x(), std::min( a3.x(), a4.x() ) ) ) + mX0 );
|
region.setX1( std::min( a1.x(), std::min( a2.x(), std::min( a3.x(), a4.x() ) ) ) + mX0 );
|
||||||
region.y1( std::min( a1.y(), std::min( a2.y(), std::min( a3.y(), a4.y() ) ) ) + mY0 );
|
region.setY1( std::min( a1.y(), std::min( a2.y(), std::min( a3.y(), a4.y() ) ) ) + mY0 );
|
||||||
region.x2( std::max( a1.x(), std::max( a2.x(), std::max( a3.x(), a4.x() ) ) ) + mX0 );
|
region.setX2( std::max( a1.x(), std::max( a2.x(), std::max( a3.x(), a4.x() ) ) ) + mX0 );
|
||||||
region.y2( std::max( a1.y(), std::max( a2.y(), std::max( a3.y(), a4.y() ) ) ) + mY0 );
|
region.setY2( std::max( a1.y(), std::max( a2.y(), std::max( a3.y(), a4.y() ) ) ) + mY0 );
|
||||||
|
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Rotate Object
|
||||||
|
///
|
||||||
void LabelModelObject::rotate( double thetaDegs )
|
void LabelModelObject::rotate( double thetaDegs )
|
||||||
{
|
{
|
||||||
if ( thetaDegs != 0 )
|
if ( thetaDegs != 0 )
|
||||||
@@ -598,6 +869,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Flip Object Horizontally
|
||||||
|
///
|
||||||
void LabelModelObject::flipHoriz()
|
void LabelModelObject::flipHoriz()
|
||||||
{
|
{
|
||||||
mMatrix = mMatrix.scale( -1, 1 );
|
mMatrix = mMatrix.scale( -1, 1 );
|
||||||
@@ -605,6 +879,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Flip Object Vertically
|
||||||
|
///
|
||||||
void LabelModelObject::flipVert()
|
void LabelModelObject::flipVert()
|
||||||
{
|
{
|
||||||
mMatrix = mMatrix.scale( 1, -1 );
|
mMatrix = mMatrix.scale( 1, -1 );
|
||||||
@@ -612,12 +889,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Update Representative Graphics Item with Object's Transformation Matrix
|
||||||
|
///
|
||||||
void LabelModelObject::updateGraphicsItemMatrix( QGraphicsItem* graphicsItem )
|
void LabelModelObject::updateGraphicsItemMatrix( QGraphicsItem* graphicsItem )
|
||||||
{
|
{
|
||||||
graphicsItem->setTransform( mMatrix );
|
graphicsItem->setTransform( mMatrix );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Update Representative Graphics Item with Object's Shadow Properties
|
||||||
|
///
|
||||||
void LabelModelObject::updateGraphicsItemShadow( QGraphicsItem* graphicsItem )
|
void LabelModelObject::updateGraphicsItemShadow( QGraphicsItem* graphicsItem )
|
||||||
{
|
{
|
||||||
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
||||||
|
|||||||
+97
-94
@@ -39,6 +39,9 @@ namespace glabels
|
|||||||
class MergeRecord;
|
class MergeRecord;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Label Model Object Base Class
|
||||||
|
///
|
||||||
class LabelModelObject : public QObject
|
class LabelModelObject : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -63,16 +66,16 @@ namespace glabels
|
|||||||
// Common Properties
|
// Common Properties
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
/*
|
//
|
||||||
* ID Property.
|
// ID Property.
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( int id READ id )
|
Q_PROPERTY( int id READ id )
|
||||||
|
|
||||||
int id() const;
|
int id() const;
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Selected Property.
|
// Selected Property.
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( bool selected READ isSelected WRITE select RESET unselect )
|
Q_PROPERTY( bool selected READ isSelected WRITE select RESET unselect )
|
||||||
|
|
||||||
bool isSelected() const;
|
bool isSelected() const;
|
||||||
@@ -80,90 +83,90 @@ namespace glabels
|
|||||||
void unselect();
|
void unselect();
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* x0 Property ( x coordinate of origin )
|
// x0 Property ( x coordinate of origin )
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double x0 READ x0 WRITE setX0 );
|
Q_PROPERTY( double x0 READ x0 WRITE setX0 );
|
||||||
|
|
||||||
double x0() const;
|
double x0() const;
|
||||||
void setX0( double value );
|
void setX0( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* y0 Property ( y coordinate of origin )
|
// y0 Property ( y coordinate of origin )
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double y0 READ y0 WRITE setY0 );
|
Q_PROPERTY( double y0 READ y0 WRITE setY0 );
|
||||||
|
|
||||||
double y0() const;
|
double y0() const;
|
||||||
void setY0( double value );
|
void setY0( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* w Property ( width of bounding box )
|
// w Property ( width of bounding box )
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double w READ w WRITE setW );
|
Q_PROPERTY( double w READ w WRITE setW );
|
||||||
|
|
||||||
double w() const;
|
double w() const;
|
||||||
void setW( double value );
|
void setW( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* h Property ( height of bounding box )
|
// h Property ( height of bounding box )
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double h READ h WRITE setH );
|
Q_PROPERTY( double h READ h WRITE setH );
|
||||||
|
|
||||||
double h() const;
|
double h() const;
|
||||||
void setH( double value );
|
void setH( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Transformation Matrix Property
|
// Transformation Matrix Property
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( QTransform matrix READ matrix WRITE setMatrix );
|
Q_PROPERTY( QTransform matrix READ matrix WRITE setMatrix );
|
||||||
|
|
||||||
QTransform matrix() const;
|
QTransform matrix() const;
|
||||||
void setMatrix( const QTransform& value );
|
void setMatrix( const QTransform& value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Shadow State Property
|
// Shadow State Property
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( bool shadow READ shadow WRITE setShadow );
|
Q_PROPERTY( bool shadow READ shadow WRITE setShadow );
|
||||||
|
|
||||||
bool shadow() const;
|
bool shadow() const;
|
||||||
void setShadow( bool value );
|
void setShadow( bool value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Shadow x Offset Property
|
// Shadow x Offset Property
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double shadowX READ shadowX WRITE setShadowX );
|
Q_PROPERTY( double shadowX READ shadowX WRITE setShadowX );
|
||||||
|
|
||||||
double shadowX() const;
|
double shadowX() const;
|
||||||
void setShadowX( double value );
|
void setShadowX( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Shadow y Offset Property
|
// Shadow y Offset Property
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double shadowY READ shadowY WRITE setShadowY );
|
Q_PROPERTY( double shadowY READ shadowY WRITE setShadowY );
|
||||||
|
|
||||||
double shadowY() const;
|
double shadowY() const;
|
||||||
void setShadowY( double value );
|
void setShadowY( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Shadow opacity Property
|
// Shadow opacity Property
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double shadowOpacity READ shadowOpacity WRITE setShadowOpacity );
|
Q_PROPERTY( double shadowOpacity READ shadowOpacity WRITE setShadowOpacity );
|
||||||
|
|
||||||
double shadowOpacity() const;
|
double shadowOpacity() const;
|
||||||
void setShadowOpacity( double value );
|
void setShadowOpacity( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Shadow Color Property
|
// Shadow Color Property
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( ColorNode shadowColorNode READ shadowColorNode WRITE setShadowColorNode );
|
Q_PROPERTY( ColorNode shadowColorNode READ shadowColorNode WRITE setShadowColorNode );
|
||||||
|
|
||||||
ColorNode shadowColorNode() const;
|
ColorNode shadowColorNode() const;
|
||||||
@@ -174,81 +177,81 @@ namespace glabels
|
|||||||
// Text Properties Virtual Interface
|
// Text Properties Virtual Interface
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: fontFamily
|
// Virtual Text Property: fontFamily
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( QString fontFamily READ fontFamily WRITE setFontFamily );
|
Q_PROPERTY( QString fontFamily READ fontFamily WRITE setFontFamily );
|
||||||
|
|
||||||
virtual QString fontFamily() const;
|
virtual QString fontFamily() const;
|
||||||
virtual void setFontFamily( const QString &value );
|
virtual void setFontFamily( const QString &value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: fontSize
|
// Virtual Text Property: fontSize
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double fontSize READ fontSize WRITE setFontSize );
|
Q_PROPERTY( double fontSize READ fontSize WRITE setFontSize );
|
||||||
|
|
||||||
virtual double fontSize() const;
|
virtual double fontSize() const;
|
||||||
virtual void setFontSize( double value );
|
virtual void setFontSize( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: fontWeight
|
// Virtual Text Property: fontWeight
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( QFont::Weight fontWeight READ fontWeight WRITE setFontWeight );
|
Q_PROPERTY( QFont::Weight fontWeight READ fontWeight WRITE setFontWeight );
|
||||||
|
|
||||||
virtual QFont::Weight fontWeight() const;
|
virtual QFont::Weight fontWeight() const;
|
||||||
virtual void setFontWeight( QFont::Weight value );
|
virtual void setFontWeight( QFont::Weight value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: fontItalicFlag
|
// Virtual Text Property: fontItalicFlag
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( bool fontItalicFlag READ fontItalicFlag WRITE setFontItalicFlag );
|
Q_PROPERTY( bool fontItalicFlag READ fontItalicFlag WRITE setFontItalicFlag );
|
||||||
|
|
||||||
virtual bool fontItalicFlag() const;
|
virtual bool fontItalicFlag() const;
|
||||||
virtual void setFontItalicFlag( bool value );
|
virtual void setFontItalicFlag( bool value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: fontUnderlineFlag
|
// Virtual Text Property: fontUnderlineFlag
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( bool fontUnderlineFlag READ fontUnderlineFlag WRITE setFontUnderlineFlag );
|
Q_PROPERTY( bool fontUnderlineFlag READ fontUnderlineFlag WRITE setFontUnderlineFlag );
|
||||||
|
|
||||||
virtual bool fontUnderlineFlag() const;
|
virtual bool fontUnderlineFlag() const;
|
||||||
virtual void setFontUnderlineFlag( bool value );
|
virtual void setFontUnderlineFlag( bool value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: textColorNode
|
// Virtual Text Property: textColorNode
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( ColorNode textColorNode READ textColorNode WRITE setTextColorNode );
|
Q_PROPERTY( ColorNode textColorNode READ textColorNode WRITE setTextColorNode );
|
||||||
|
|
||||||
virtual ColorNode textColorNode() const;
|
virtual ColorNode textColorNode() const;
|
||||||
virtual void setTextColorNode( const ColorNode &value );
|
virtual void setTextColorNode( const ColorNode &value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: textHAlign
|
// Virtual Text Property: textHAlign
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( Qt::Alignment textHAlign READ textHAlign WRITE setTextHAlign );
|
Q_PROPERTY( Qt::Alignment textHAlign READ textHAlign WRITE setTextHAlign );
|
||||||
|
|
||||||
virtual Qt::Alignment textHAlign() const;
|
virtual Qt::Alignment textHAlign() const;
|
||||||
virtual void setTextHAlign( Qt::Alignment value );
|
virtual void setTextHAlign( Qt::Alignment value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: textVAlign
|
// Virtual Text Property: textVAlign
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( Qt::Alignment textVAlign READ textVAlign WRITE setTextVAlign );
|
Q_PROPERTY( Qt::Alignment textVAlign READ textVAlign WRITE setTextVAlign );
|
||||||
|
|
||||||
virtual Qt::Alignment textVAlign() const;
|
virtual Qt::Alignment textVAlign() const;
|
||||||
virtual void setTextVAlign( Qt::Alignment value );
|
virtual void setTextVAlign( Qt::Alignment value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Text Property: textLineSpacing
|
// Virtual Text Property: textLineSpacing
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double textLineSpacing READ textLineSpacing WRITE setTextLineSpacing );
|
Q_PROPERTY( double textLineSpacing READ textLineSpacing WRITE setTextLineSpacing );
|
||||||
|
|
||||||
virtual double textLineSpacing() const;
|
virtual double textLineSpacing() const;
|
||||||
@@ -259,9 +262,9 @@ namespace glabels
|
|||||||
// Image Properties Virtual Interface
|
// Image Properties Virtual Interface
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
/*
|
//
|
||||||
* Virtual Image Property: filenameNode
|
// Virtual Image Property: filenameNode
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( TextNode filenameNode READ filenameNode WRITE setFilenameNode );
|
Q_PROPERTY( TextNode filenameNode READ filenameNode WRITE setFilenameNode );
|
||||||
|
|
||||||
virtual TextNode filenameNode() const;
|
virtual TextNode filenameNode() const;
|
||||||
@@ -272,27 +275,27 @@ namespace glabels
|
|||||||
// Shape Properties Virtual Interface
|
// Shape Properties Virtual Interface
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
/*
|
//
|
||||||
* Virtual Shape Property: lineWidth
|
// Virtual Shape Property: lineWidth
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( double lineWidth READ lineWidth WRITE setLineWidth );
|
Q_PROPERTY( double lineWidth READ lineWidth WRITE setLineWidth );
|
||||||
|
|
||||||
virtual double lineWidth() const;
|
virtual double lineWidth() const;
|
||||||
virtual void setLineWidth( double value );
|
virtual void setLineWidth( double value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Shape Property: lineColorNode
|
// Virtual Shape Property: lineColorNode
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( ColorNode lineColorNode READ lineColorNode WRITE setLineColorNode );
|
Q_PROPERTY( ColorNode lineColorNode READ lineColorNode WRITE setLineColorNode );
|
||||||
|
|
||||||
virtual ColorNode lineColorNode() const;
|
virtual ColorNode lineColorNode() const;
|
||||||
virtual void setLineColorNode( const ColorNode &value );
|
virtual void setLineColorNode( const ColorNode &value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Shape Property: fillColorNode
|
// Virtual Shape Property: fillColorNode
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( ColorNode fillColorNode READ fillColorNode WRITE setFillColorNode );
|
Q_PROPERTY( ColorNode fillColorNode READ fillColorNode WRITE setFillColorNode );
|
||||||
|
|
||||||
virtual ColorNode fillColorNode() const;
|
virtual ColorNode fillColorNode() const;
|
||||||
@@ -303,54 +306,54 @@ namespace glabels
|
|||||||
// Barcode Properties Virtual Interface
|
// Barcode Properties Virtual Interface
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
/*
|
//
|
||||||
* Virtual Barcode Property: bcDataNode
|
// Virtual Barcode Property: bcDataNode
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( TextNode bcDataNode READ bcDataNode WRITE setBcDataNode );
|
Q_PROPERTY( TextNode bcDataNode READ bcDataNode WRITE setBcDataNode );
|
||||||
|
|
||||||
virtual TextNode bcDataNode() const;
|
virtual TextNode bcDataNode() const;
|
||||||
virtual void setBcDataNode( const TextNode &value );
|
virtual void setBcDataNode( const TextNode &value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Barcode Property: bcTextFlag
|
// Virtual Barcode Property: bcTextFlag
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( bool bcTextFlag READ bcTextFlag WRITE setBcTextFlag );
|
Q_PROPERTY( bool bcTextFlag READ bcTextFlag WRITE setBcTextFlag );
|
||||||
|
|
||||||
virtual bool bcTextFlag() const;
|
virtual bool bcTextFlag() const;
|
||||||
virtual void setBcTextFlag( bool value );
|
virtual void setBcTextFlag( bool value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Barcode Property: bcChecksumFlag
|
// Virtual Barcode Property: bcChecksumFlag
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( bool bcChecksumFlag READ bcChecksumFlag WRITE setBcChecksumFlag );
|
Q_PROPERTY( bool bcChecksumFlag READ bcChecksumFlag WRITE setBcChecksumFlag );
|
||||||
|
|
||||||
virtual bool bcChecksumFlag() const;
|
virtual bool bcChecksumFlag() const;
|
||||||
virtual void setBcChecksumFlag( bool value );
|
virtual void setBcChecksumFlag( bool value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Barcode Property: bcColorNode
|
// Virtual Barcode Property: bcColorNode
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( ColorNode bcColorNode READ bcColorNode WRITE setBcColorNode );
|
Q_PROPERTY( ColorNode bcColorNode READ bcColorNode WRITE setBcColorNode );
|
||||||
|
|
||||||
virtual ColorNode bcColorNode() const;
|
virtual ColorNode bcColorNode() const;
|
||||||
virtual void setBcColorNode( const ColorNode &value );
|
virtual void setBcColorNode( const ColorNode &value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Barcode Property: bcStyle
|
// Virtual Barcode Property: bcStyle
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( BarcodeStyle bcStyle READ bcStyle WRITE setBcStyle );
|
Q_PROPERTY( BarcodeStyle bcStyle READ bcStyle WRITE setBcStyle );
|
||||||
|
|
||||||
virtual BarcodeStyle bcStyle() const;
|
virtual BarcodeStyle bcStyle() const;
|
||||||
virtual void setBcStyle( const BarcodeStyle &value );
|
virtual void setBcStyle( const BarcodeStyle &value );
|
||||||
|
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Virtual Barcode Property: bcFormatDigits
|
// Virtual Barcode Property: bcFormatDigits
|
||||||
*/
|
//
|
||||||
Q_PROPERTY( int bcFormatDigits READ bcFormatDigits WRITE setBcFormatDigits );
|
Q_PROPERTY( int bcFormatDigits READ bcFormatDigits WRITE setBcFormatDigits );
|
||||||
|
|
||||||
virtual int bcFormatDigits() const;
|
virtual int bcFormatDigits() const;
|
||||||
@@ -399,7 +402,7 @@ namespace glabels
|
|||||||
// Private Members
|
// Private Members
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
private:
|
private:
|
||||||
static int lastId;
|
static int msNextId;
|
||||||
int mId;
|
int mId;
|
||||||
|
|
||||||
bool mSelectedFlag;
|
bool mSelectedFlag;
|
||||||
|
|||||||
+88
-11
@@ -25,22 +25,48 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Label Region Type
|
||||||
|
///
|
||||||
struct LabelRegion
|
struct LabelRegion
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
inline double x1( void ) const { return mX1; }
|
//
|
||||||
inline void x1( double value ) { mX1 = value; }
|
// X1 Property
|
||||||
|
//
|
||||||
inline double y1( void ) const { return mY1; }
|
inline double x1( void ) const;
|
||||||
inline void y1( double value ) { mY1 = value; }
|
inline void setX1( double value );
|
||||||
|
|
||||||
inline double x2( void ) const { return mX2; }
|
|
||||||
inline void x2( double value ) { mX2 = value; }
|
|
||||||
|
|
||||||
inline double y2( void ) const { return mY2; }
|
|
||||||
inline void y2( double value ) { mY2 = value; }
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Y1 Property
|
||||||
|
//
|
||||||
|
inline double y1( void ) const;
|
||||||
|
inline void setY1( double value );
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// X2 Property
|
||||||
|
//
|
||||||
|
inline double x2( void ) const;
|
||||||
|
inline void setX2( double value );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Y2 Property
|
||||||
|
//
|
||||||
|
inline double y2( void ) const;
|
||||||
|
inline void setY2( double value );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
double mX1;
|
double mX1;
|
||||||
double mY1;
|
double mY1;
|
||||||
@@ -48,6 +74,57 @@ namespace glabels
|
|||||||
double mY2;
|
double mY2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// INLINE METHODS
|
||||||
|
/////////////////////////////////
|
||||||
|
double LabelRegion::x1( void ) const
|
||||||
|
{
|
||||||
|
return mX1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LabelRegion::setX1( double value )
|
||||||
|
{
|
||||||
|
mX1 = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double LabelRegion::y1( void ) const
|
||||||
|
{
|
||||||
|
return mY1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LabelRegion::setY1( double value )
|
||||||
|
{
|
||||||
|
mY1 = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double LabelRegion::x2( void ) const
|
||||||
|
{
|
||||||
|
return mX2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LabelRegion::setX2( double value )
|
||||||
|
{
|
||||||
|
mX2 = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double LabelRegion::y2( void ) const
|
||||||
|
{
|
||||||
|
return mY2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LabelRegion::setY2( double value )
|
||||||
|
{
|
||||||
|
mY2 = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // glabels_LabelRegion_h
|
#endif // glabels_LabelRegion_h
|
||||||
|
|||||||
+205
-16
@@ -43,6 +43,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
{
|
{
|
||||||
/////////////// TEMPORARY TESTING ///////////////
|
/////////////// TEMPORARY TESTING ///////////////
|
||||||
@@ -87,6 +90,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Close Event Handler
|
||||||
|
///
|
||||||
void MainWindow::closeEvent( QCloseEvent *event )
|
void MainWindow::closeEvent( QCloseEvent *event )
|
||||||
{
|
{
|
||||||
std::cout << "CLOSE EVENT" << std::endl;
|
std::cout << "CLOSE EVENT" << std::endl;
|
||||||
@@ -95,6 +101,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Actions
|
||||||
|
///
|
||||||
void MainWindow::createActions()
|
void MainWindow::createActions()
|
||||||
{
|
{
|
||||||
/* File actions */
|
/* File actions */
|
||||||
@@ -385,6 +394,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Menus
|
||||||
|
///
|
||||||
void MainWindow::createMenus()
|
void MainWindow::createMenus()
|
||||||
{
|
{
|
||||||
fileMenu = menuBar()->addMenu( tr("&File") );
|
fileMenu = menuBar()->addMenu( tr("&File") );
|
||||||
@@ -468,6 +480,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Tool Bars
|
||||||
|
///
|
||||||
void MainWindow::createToolBars()
|
void MainWindow::createToolBars()
|
||||||
{
|
{
|
||||||
fileToolBar = addToolBar( tr("&File") );
|
fileToolBar = addToolBar( tr("&File") );
|
||||||
@@ -502,6 +517,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Status Bar
|
||||||
|
///
|
||||||
void MainWindow::createStatusBar()
|
void MainWindow::createStatusBar()
|
||||||
{
|
{
|
||||||
zoomInfoLabel = new QLabel( " 999% " );
|
zoomInfoLabel = new QLabel( " 999% " );
|
||||||
@@ -525,9 +543,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
///
|
||||||
* Set enabled state of actions associated with a document.
|
/// Set enabled state of actions associated with a document.
|
||||||
*/
|
///
|
||||||
void MainWindow::setDocVerbsEnabled( bool enabled )
|
void MainWindow::setDocVerbsEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
filePropertiesAction->setEnabled( enabled );
|
filePropertiesAction->setEnabled( enabled );
|
||||||
@@ -579,27 +597,27 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
///
|
||||||
* Set enabled state of actions associated with a document being modified since last save.
|
/// Set enabled state of actions associated with a document being modified since last save.
|
||||||
*/
|
///
|
||||||
void MainWindow::setDocModifiedVerbsEnabled( bool enabled )
|
void MainWindow::setDocModifiedVerbsEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
fileSaveAction->setEnabled( enabled );
|
fileSaveAction->setEnabled( enabled );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
///
|
||||||
* Set enabled state of actions associated with data being available on clipboard.
|
/// Set enabled state of actions associated with data being available on clipboard.
|
||||||
*/
|
///
|
||||||
void MainWindow::setPasteVerbsEnabled( bool enabled )
|
void MainWindow::setPasteVerbsEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
editPasteAction->setEnabled( enabled );
|
editPasteAction->setEnabled( enabled );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
///
|
||||||
* Set enabled state of actions associated with a non-empty selection.
|
/// Set enabled state of actions associated with a non-empty selection.
|
||||||
*/
|
///
|
||||||
void MainWindow::setSelectionVerbsEnabled( bool enabled )
|
void MainWindow::setSelectionVerbsEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
editCutAction->setEnabled( enabled );
|
editCutAction->setEnabled( enabled );
|
||||||
@@ -620,9 +638,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
///
|
||||||
* Set enabled state of actions associated with a non-atomic selection.
|
/// Set enabled state of actions associated with a non-atomic selection.
|
||||||
*/
|
///
|
||||||
void MainWindow::setMultiSelectionVerbsEnabled( bool enabled )
|
void MainWindow::setMultiSelectionVerbsEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
objectsAlignMenu->setEnabled( enabled );
|
objectsAlignMenu->setEnabled( enabled );
|
||||||
@@ -635,6 +653,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Read MainWindow Settings
|
||||||
|
///
|
||||||
void MainWindow::readSettings()
|
void MainWindow::readSettings()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
@@ -664,6 +685,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Write MainWindow Settings
|
||||||
|
///
|
||||||
void MainWindow::writeSettings()
|
void MainWindow::writeSettings()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
@@ -679,318 +703,477 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->New Action
|
||||||
|
///
|
||||||
void MainWindow::fileNew()
|
void MainWindow::fileNew()
|
||||||
{
|
{
|
||||||
File::newLabel( this );
|
File::newLabel( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->Open Action
|
||||||
|
///
|
||||||
void MainWindow::fileOpen()
|
void MainWindow::fileOpen()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->Open" << std::endl;
|
std::cout << "ACTION: file->Open" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->Save Action
|
||||||
|
///
|
||||||
void MainWindow::fileSave()
|
void MainWindow::fileSave()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->Save" << std::endl;
|
std::cout << "ACTION: file->Save" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->Save As Action
|
||||||
|
///
|
||||||
void MainWindow::fileSaveAs()
|
void MainWindow::fileSaveAs()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->Save As" << std::endl;
|
std::cout << "ACTION: file->Save As" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->Print Action
|
||||||
|
///
|
||||||
void MainWindow::filePrint()
|
void MainWindow::filePrint()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->Print" << std::endl;
|
std::cout << "ACTION: file->Print" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->Properties Action
|
||||||
|
///
|
||||||
void MainWindow::fileProperties()
|
void MainWindow::fileProperties()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->Properties" << std::endl;
|
std::cout << "ACTION: file->Properties" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->Template Designer Action
|
||||||
|
///
|
||||||
void MainWindow::fileTemplateDesigner()
|
void MainWindow::fileTemplateDesigner()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->Template Designer" << std::endl;
|
std::cout << "ACTION: file->Template Designer" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->Close Action
|
||||||
|
///
|
||||||
void MainWindow::fileClose()
|
void MainWindow::fileClose()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->Close" << std::endl;
|
std::cout << "ACTION: file->Close" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// File->Exit Action
|
||||||
|
///
|
||||||
void MainWindow::fileExit()
|
void MainWindow::fileExit()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->Exit" << std::endl;
|
std::cout << "ACTION: file->Exit" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Undo Action
|
||||||
|
///
|
||||||
void MainWindow::editUndo()
|
void MainWindow::editUndo()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Undo" << std::endl;
|
std::cout << "ACTION: edit->Undo" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Redo Action
|
||||||
|
///
|
||||||
void MainWindow::editRedo()
|
void MainWindow::editRedo()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Redo" << std::endl;
|
std::cout << "ACTION: edit->Redo" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Cut Action
|
||||||
|
///
|
||||||
void MainWindow::editCut()
|
void MainWindow::editCut()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Cut" << std::endl;
|
std::cout << "ACTION: edit->Cut" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Copy Action
|
||||||
|
///
|
||||||
void MainWindow::editCopy()
|
void MainWindow::editCopy()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Copy" << std::endl;
|
std::cout << "ACTION: edit->Copy" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Paste Action
|
||||||
|
///
|
||||||
void MainWindow::editPaste()
|
void MainWindow::editPaste()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Paste" << std::endl;
|
std::cout << "ACTION: edit->Paste" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Delete Action
|
||||||
|
///
|
||||||
void MainWindow::editDelete()
|
void MainWindow::editDelete()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Delete" << std::endl;
|
std::cout << "ACTION: edit->Delete" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Select All Action
|
||||||
|
///
|
||||||
void MainWindow::editSelectAll()
|
void MainWindow::editSelectAll()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Select All" << std::endl;
|
std::cout << "ACTION: edit->Select All" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Unselect All Action
|
||||||
|
///
|
||||||
void MainWindow::editUnSelectAll()
|
void MainWindow::editUnSelectAll()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Un-select All" << std::endl;
|
std::cout << "ACTION: edit->Un-select All" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Edit->Preferences Action
|
||||||
|
///
|
||||||
void MainWindow::editPreferences()
|
void MainWindow::editPreferences()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: edit->Preferences" << std::endl;
|
std::cout << "ACTION: edit->Preferences" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->File Tool Bar Toggle Action
|
||||||
|
///
|
||||||
void MainWindow::viewFileToolBar( bool state )
|
void MainWindow::viewFileToolBar( bool state )
|
||||||
{
|
{
|
||||||
fileToolBar->setVisible( state );
|
fileToolBar->setVisible( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->Objects Tool Bar Toggle Action
|
||||||
|
///
|
||||||
void MainWindow::viewObjectsToolBar( bool state )
|
void MainWindow::viewObjectsToolBar( bool state )
|
||||||
{
|
{
|
||||||
objectsToolBar->setVisible( state );
|
objectsToolBar->setVisible( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->Edit Tool Bar Toggle Action
|
||||||
|
///
|
||||||
void MainWindow::viewEditToolBar( bool state )
|
void MainWindow::viewEditToolBar( bool state )
|
||||||
{
|
{
|
||||||
editToolBar->setVisible( state );
|
editToolBar->setVisible( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->View Tool Bar Toggle Action
|
||||||
|
///
|
||||||
void MainWindow::viewViewToolBar( bool state )
|
void MainWindow::viewViewToolBar( bool state )
|
||||||
{
|
{
|
||||||
viewToolBar->setVisible( state );
|
viewToolBar->setVisible( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->Grid Toggle Action
|
||||||
|
///
|
||||||
void MainWindow::viewGrid( bool state )
|
void MainWindow::viewGrid( bool state )
|
||||||
{
|
{
|
||||||
view->setGridVisible( state );
|
view->setGridVisible( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->Markup Toggle Action
|
||||||
|
///
|
||||||
void MainWindow::viewMarkup( bool state )
|
void MainWindow::viewMarkup( bool state )
|
||||||
{
|
{
|
||||||
view->setMarkupVisible( state );
|
view->setMarkupVisible( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->Zoom In Action
|
||||||
|
///
|
||||||
void MainWindow::viewZoomIn()
|
void MainWindow::viewZoomIn()
|
||||||
{
|
{
|
||||||
view->zoomIn();
|
view->zoomIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->Zoom Out Action
|
||||||
|
///
|
||||||
void MainWindow::viewZoomOut()
|
void MainWindow::viewZoomOut()
|
||||||
{
|
{
|
||||||
view->zoomOut();
|
view->zoomOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->Zoom 1:1 Action
|
||||||
|
///
|
||||||
void MainWindow::viewZoom1To1()
|
void MainWindow::viewZoom1To1()
|
||||||
{
|
{
|
||||||
view->zoom1To1();
|
view->zoom1To1();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// View->Zoom To Fit Action
|
||||||
|
///
|
||||||
void MainWindow::viewZoomToFit()
|
void MainWindow::viewZoomToFit()
|
||||||
{
|
{
|
||||||
view->zoomToFit();
|
view->zoomToFit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Arrow Mode Action
|
||||||
|
///
|
||||||
void MainWindow::objectsArrowMode()
|
void MainWindow::objectsArrowMode()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Select Mode" << std::endl;
|
std::cout << "ACTION: objects->Select Mode" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Create Text Mode Action
|
||||||
|
///
|
||||||
void MainWindow::objectsCreateText()
|
void MainWindow::objectsCreateText()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Create->Text" << std::endl;
|
std::cout << "ACTION: objects->Create->Text" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Create Box Mode Action
|
||||||
|
///
|
||||||
void MainWindow::objectsCreateBox()
|
void MainWindow::objectsCreateBox()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Create->Box" << std::endl;
|
std::cout << "ACTION: objects->Create->Box" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Create Line Mode Action
|
||||||
|
///
|
||||||
void MainWindow::objectsCreateLine()
|
void MainWindow::objectsCreateLine()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Create->Line" << std::endl;
|
std::cout << "ACTION: objects->Create->Line" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Create Ellipse Mode Action
|
||||||
|
///
|
||||||
void MainWindow::objectsCreateEllipse()
|
void MainWindow::objectsCreateEllipse()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Create->Ellipse" << std::endl;
|
std::cout << "ACTION: objects->Create->Ellipse" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Create Image Mode Action
|
||||||
|
///
|
||||||
void MainWindow::objectsCreateImage()
|
void MainWindow::objectsCreateImage()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Create->Image" << std::endl;
|
std::cout << "ACTION: objects->Create->Image" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Create Barcode Mode Action
|
||||||
|
///
|
||||||
void MainWindow::objectsCreateBarcode()
|
void MainWindow::objectsCreateBarcode()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Create->Barcode" << std::endl;
|
std::cout << "ACTION: objects->Create->Barcode" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Order->Bring To Front Action
|
||||||
|
///
|
||||||
void MainWindow::objectsOrderRaise()
|
void MainWindow::objectsOrderRaise()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Order->Bring to front" << std::endl;
|
std::cout << "ACTION: objects->Order->Bring to front" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Order->Send To Back Action
|
||||||
|
///
|
||||||
void MainWindow::objectsOrderLower()
|
void MainWindow::objectsOrderLower()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Order->Send to back" << std::endl;
|
std::cout << "ACTION: objects->Order->Send to back" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Rotate/Flip->Rotate Left Action
|
||||||
|
///
|
||||||
void MainWindow::objectsXformRotateLeft()
|
void MainWindow::objectsXformRotateLeft()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Rotate/Flip->Rotate Left" << std::endl;
|
std::cout << "ACTION: objects->Rotate/Flip->Rotate Left" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Rotate/Flip->Rotate Right Action
|
||||||
|
///
|
||||||
void MainWindow::objectsXformRotateRight()
|
void MainWindow::objectsXformRotateRight()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Rotate/Flip->Rotate Right" << std::endl;
|
std::cout << "ACTION: objects->Rotate/Flip->Rotate Right" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Rotate/Flip->Flip Horizontally Action
|
||||||
|
///
|
||||||
void MainWindow::objectsXformFlipHoriz()
|
void MainWindow::objectsXformFlipHoriz()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Rotate/Flip->Flip Horizontally" << std::endl;
|
std::cout << "ACTION: objects->Rotate/Flip->Flip Horizontally" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Rotate/Flip->Flip Vertically Action
|
||||||
|
///
|
||||||
void MainWindow::objectsXformFlipVert()
|
void MainWindow::objectsXformFlipVert()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Rotate/Flip->Flip Vertically" << std::endl;
|
std::cout << "ACTION: objects->Rotate/Flip->Flip Vertically" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Align->Left Action
|
||||||
|
///
|
||||||
void MainWindow::objectsAlignLeft()
|
void MainWindow::objectsAlignLeft()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Align->Left" << std::endl;
|
std::cout << "ACTION: objects->Align->Left" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Align->Center Horizontally Action
|
||||||
|
///
|
||||||
void MainWindow::objectsAlignHCenter()
|
void MainWindow::objectsAlignHCenter()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Align->Center Horizontally" << std::endl;
|
std::cout << "ACTION: objects->Align->Center Horizontally" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Align->Right Action
|
||||||
|
///
|
||||||
void MainWindow::objectsAlignRight()
|
void MainWindow::objectsAlignRight()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Align->Right" << std::endl;
|
std::cout << "ACTION: objects->Align->Right" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Align->Top Action
|
||||||
|
///
|
||||||
void MainWindow::objectsAlignTop()
|
void MainWindow::objectsAlignTop()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Align->Top" << std::endl;
|
std::cout << "ACTION: objects->Align->Top" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Align->Center Vertically Action
|
||||||
|
///
|
||||||
void MainWindow::objectsAlignVCenter()
|
void MainWindow::objectsAlignVCenter()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Align->Center Vertically" << std::endl;
|
std::cout << "ACTION: objects->Align->Center Vertically" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Align->Bottom Action
|
||||||
|
///
|
||||||
void MainWindow::objectsAlignBottom()
|
void MainWindow::objectsAlignBottom()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Align->Bottom" << std::endl;
|
std::cout << "ACTION: objects->Align->Bottom" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Center->Horizontally Action
|
||||||
|
///
|
||||||
void MainWindow::objectsCenterHoriz()
|
void MainWindow::objectsCenterHoriz()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Center->Horizontally" << std::endl;
|
std::cout << "ACTION: objects->Center->Horizontally" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Center->Vertically Action
|
||||||
|
///
|
||||||
void MainWindow::objectsCenterVert()
|
void MainWindow::objectsCenterVert()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Center->Vertically" << std::endl;
|
std::cout << "ACTION: objects->Center->Vertically" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Objects->Merge Properties Action
|
||||||
|
///
|
||||||
void MainWindow::objectsMergeProperties()
|
void MainWindow::objectsMergeProperties()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: objects->Merge Properties..." << std::endl;
|
std::cout << "ACTION: objects->Merge Properties..." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Help->Contents Action
|
||||||
|
///
|
||||||
void MainWindow::helpContents()
|
void MainWindow::helpContents()
|
||||||
{
|
{
|
||||||
Help::displayContents( this );
|
Help::displayContents( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Help->About Action
|
||||||
|
///
|
||||||
void MainWindow::helpAbout()
|
void MainWindow::helpAbout()
|
||||||
{
|
{
|
||||||
Help::displayAbout( this );
|
Help::displayAbout( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Update Zoom Information in Status Bar
|
||||||
|
///
|
||||||
void MainWindow::updateZoomInfo()
|
void MainWindow::updateZoomInfo()
|
||||||
{
|
{
|
||||||
zoomInfoLabel->setText( QString( " %1% " ).arg(100*view->zoom(), 0, 'f', 0) );
|
zoomInfoLabel->setText( QString( " %1% " ).arg(100*view->zoom(), 0, 'f', 0) );
|
||||||
@@ -1000,6 +1183,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Update Cursor Information in Status Bar
|
||||||
|
///
|
||||||
void MainWindow::updateCursorInfo( double x, double y )
|
void MainWindow::updateCursorInfo( double x, double y )
|
||||||
{
|
{
|
||||||
/* TODO: convert x,y to locale units and set precision accordingly. */
|
/* TODO: convert x,y to locale units and set precision accordingly. */
|
||||||
@@ -1007,7 +1193,10 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Clears cursor info. E.g. when pointer exits view. */
|
///
|
||||||
|
/// Update Zoom Information in Status Bar (Clears information)
|
||||||
|
/// E.g. when pointer exits view.
|
||||||
|
///
|
||||||
void MainWindow::updateCursorInfo()
|
void MainWindow::updateCursorInfo()
|
||||||
{
|
{
|
||||||
cursorInfoLabel->setText( "" );
|
cursorInfoLabel->setText( "" );
|
||||||
|
|||||||
+3
-5
@@ -37,11 +37,9 @@ namespace glabels
|
|||||||
class View;
|
class View;
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////
|
///
|
||||||
//////////////////////////////////////////////
|
/// MainWindow Widget
|
||||||
// MainWindow
|
///
|
||||||
//////////////////////////////////////////////
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
+52
-7
@@ -27,21 +27,66 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Merge Field Structure
|
||||||
|
///
|
||||||
struct MergeField
|
struct MergeField
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
inline QString key( void ) { return m_key; }
|
//
|
||||||
inline void key( const QString &value ) { m_key = value; }
|
// Key Property
|
||||||
|
//
|
||||||
inline QString value( void ) { return m_value; }
|
inline const QString key( void ) const;
|
||||||
inline void value( const QString &value ) { m_value = value; }
|
inline void setKey( const QString &value );
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Value Property
|
||||||
|
//
|
||||||
|
inline const QString value( void ) const;
|
||||||
|
inline void setValue( const QString &value );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private data
|
||||||
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
QString m_key;
|
QString mKey;
|
||||||
QString m_value;
|
QString mValue;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// INLINE METHODS
|
||||||
|
/////////////////////////////////
|
||||||
|
const QString MergeField::key( void ) const
|
||||||
|
{
|
||||||
|
return mKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MergeField::setKey( const QString &value )
|
||||||
|
{
|
||||||
|
mKey = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const QString MergeField::value( void ) const
|
||||||
|
{
|
||||||
|
return mValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MergeField::setValue( const QString &value )
|
||||||
|
{
|
||||||
|
mValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // glabels_MergeField_h
|
#endif // glabels_MergeField_h
|
||||||
|
|||||||
@@ -20,3 +20,17 @@
|
|||||||
|
|
||||||
#include "MergeRecord.h"
|
#include "MergeRecord.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
|
MergeRecord::MergeRecord() : mSelected( false )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+47
-12
@@ -22,37 +22,72 @@
|
|||||||
#define glabels_MergeRecord_h
|
#define glabels_MergeRecord_h
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <list>
|
#include <QList>
|
||||||
|
|
||||||
#include "MergeField.h"
|
#include "MergeField.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Merge Record Structure
|
||||||
|
///
|
||||||
struct MergeRecord
|
struct MergeRecord
|
||||||
{
|
{
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
MergeRecord() : m_selected( false )
|
MergeRecord();
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
inline bool selected( void ) { return m_selected; }
|
inline bool selected( void ) const;
|
||||||
inline void selected( bool value ) { m_selected = value; }
|
inline void setSelected( bool value );
|
||||||
|
|
||||||
inline list<MergeField> field_list( void ) { return m_field_list; }
|
inline const QList<MergeField>& fieldList( void ) const;
|
||||||
inline void field_list( list<MergeField> &value ) { m_field_list = value; }
|
inline void setFieldList( QList<MergeField>& value );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private data
|
||||||
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
bool m_selected;
|
bool mSelected;
|
||||||
list<MergeField> m_field_list;
|
QList<MergeField> mFieldList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// INLINE METHODS
|
||||||
|
/////////////////////////////////
|
||||||
|
bool MergeRecord::selected( void ) const
|
||||||
|
{
|
||||||
|
return mSelected;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MergeRecord::setSelected( bool value )
|
||||||
|
{
|
||||||
|
mSelected = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const QList<MergeField>& MergeRecord::fieldList( void ) const
|
||||||
|
{
|
||||||
|
return mFieldList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MergeRecord::setFieldList( QList<MergeField>& value )
|
||||||
|
{
|
||||||
|
mFieldList = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // glabels_MergeRecord_h
|
#endif // glabels_MergeRecord_h
|
||||||
|
|||||||
@@ -29,6 +29,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
NewLabelDialog::NewLabelDialog( QWidget *parent = 0 )
|
NewLabelDialog::NewLabelDialog( QWidget *parent = 0 )
|
||||||
{
|
{
|
||||||
setupUi( this );
|
setupUi( this );
|
||||||
@@ -66,6 +69,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Search Entry Text Changed Slot
|
||||||
|
///
|
||||||
void NewLabelDialog::searchEntryTextChanged( const QString &text )
|
void NewLabelDialog::searchEntryTextChanged( const QString &text )
|
||||||
{
|
{
|
||||||
templatePicker->applyFilter( text,
|
templatePicker->applyFilter( text,
|
||||||
@@ -75,6 +81,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Page Size Radio Toggled Slot
|
||||||
|
///
|
||||||
void NewLabelDialog::pageSizeRadioToggled( bool checked )
|
void NewLabelDialog::pageSizeRadioToggled( bool checked )
|
||||||
{
|
{
|
||||||
if ( checked )
|
if ( checked )
|
||||||
@@ -87,6 +96,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Template Picker Selection Changed Slot
|
||||||
|
///
|
||||||
void NewLabelDialog::templatePickerSelectionChanged()
|
void NewLabelDialog::templatePickerSelectionChanged()
|
||||||
{
|
{
|
||||||
orientationNormalRadio->setChecked( true );
|
orientationNormalRadio->setChecked( true );
|
||||||
@@ -164,6 +176,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Orientation Radio Button Toggled Slot
|
||||||
|
///
|
||||||
void NewLabelDialog::orientationRadioToggled( bool checked )
|
void NewLabelDialog::orientationRadioToggled( bool checked )
|
||||||
{
|
{
|
||||||
if ( checked )
|
if ( checked )
|
||||||
@@ -173,6 +188,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Button Clicked Slot
|
||||||
|
///
|
||||||
void NewLabelDialog::createButtonClicked()
|
void NewLabelDialog::createButtonClicked()
|
||||||
{
|
{
|
||||||
const libglabels::Template *tmplate = templatePicker->selectedTemplate();
|
const libglabels::Template *tmplate = templatePicker->selectedTemplate();
|
||||||
|
|||||||
@@ -27,13 +27,24 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// New Label Dialog Widget
|
||||||
|
///
|
||||||
class NewLabelDialog : public QDialog, public Ui_NewLabelDialog
|
class NewLabelDialog : public QDialog, public Ui_NewLabelDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
NewLabelDialog( QWidget *parent );
|
NewLabelDialog( QWidget *parent );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
private slots:
|
private slots:
|
||||||
void searchEntryTextChanged( const QString &text );
|
void searchEntryTextChanged( const QString &text );
|
||||||
void pageSizeRadioToggled( bool checked );
|
void pageSizeRadioToggled( bool checked );
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private Configuration Data
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const QColor paperColor( 255, 255, 255 );
|
const QColor paperColor( 255, 255, 255 );
|
||||||
@@ -51,6 +54,9 @@ namespace
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
SimplePreview::SimplePreview( QWidget *parent = 0 )
|
SimplePreview::SimplePreview( QWidget *parent = 0 )
|
||||||
: mScale(1), mTmplate(NULL), mRotateFlag(false), QGraphicsView(parent)
|
: mScale(1), mTmplate(NULL), mRotateFlag(false), QGraphicsView(parent)
|
||||||
{
|
{
|
||||||
@@ -65,6 +71,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Template Property Setter
|
||||||
|
///
|
||||||
void SimplePreview::setTemplate( const libglabels::Template *tmplate )
|
void SimplePreview::setTemplate( const libglabels::Template *tmplate )
|
||||||
{
|
{
|
||||||
mTmplate = tmplate;
|
mTmplate = tmplate;
|
||||||
@@ -72,6 +81,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Rotate Property Setter
|
||||||
|
///
|
||||||
void SimplePreview::setRotate( bool rotateFlag )
|
void SimplePreview::setRotate( bool rotateFlag )
|
||||||
{
|
{
|
||||||
mRotateFlag = rotateFlag;
|
mRotateFlag = rotateFlag;
|
||||||
@@ -79,6 +91,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Update View
|
||||||
|
///
|
||||||
void SimplePreview::update()
|
void SimplePreview::update()
|
||||||
{
|
{
|
||||||
clearScene();
|
clearScene();
|
||||||
@@ -103,6 +118,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Clear View
|
||||||
|
///
|
||||||
void SimplePreview::clearScene()
|
void SimplePreview::clearScene()
|
||||||
{
|
{
|
||||||
foreach ( QGraphicsItem *item, mScene->items() )
|
foreach ( QGraphicsItem *item, mScene->items() )
|
||||||
@@ -113,6 +131,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Draw Paper
|
||||||
|
///
|
||||||
void SimplePreview::drawPaper( double pw, double ph )
|
void SimplePreview::drawPaper( double pw, double ph )
|
||||||
{
|
{
|
||||||
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
||||||
@@ -133,6 +154,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Draw Labels on Paper
|
||||||
|
///
|
||||||
void SimplePreview::drawLabels()
|
void SimplePreview::drawLabels()
|
||||||
{
|
{
|
||||||
libglabels::Frame *frame = mTmplate->frames().first();
|
libglabels::Frame *frame = mTmplate->frames().first();
|
||||||
@@ -144,6 +168,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Draw a Single Label at x,y
|
||||||
|
///
|
||||||
void SimplePreview::drawLabel( double x, double y, const QPainterPath &path )
|
void SimplePreview::drawLabel( double x, double y, const QPainterPath &path )
|
||||||
{
|
{
|
||||||
QBrush brush( labelColor );
|
QBrush brush( labelColor );
|
||||||
@@ -159,6 +186,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Draw Arrow Indicating Top of First Label
|
||||||
|
///
|
||||||
void SimplePreview::drawArrow()
|
void SimplePreview::drawArrow()
|
||||||
{
|
{
|
||||||
libglabels::Frame *frame = mTmplate->frames().first();
|
libglabels::Frame *frame = mTmplate->frames().first();
|
||||||
|
|||||||
+24
-2
@@ -32,16 +32,32 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Simple Preview Widget
|
||||||
|
///
|
||||||
class SimplePreview : public QGraphicsView
|
class SimplePreview : public QGraphicsView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
SimplePreview( QWidget *parent );
|
SimplePreview( QWidget *parent );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
void setTemplate( const libglabels::Template *tmplate );
|
void setTemplate( const libglabels::Template *tmplate );
|
||||||
void setRotate( bool rotateFlag );
|
void setRotate( bool rotateFlag );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Internal Methods
|
||||||
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
void update();
|
void update();
|
||||||
void clearScene();
|
void clearScene();
|
||||||
@@ -50,11 +66,17 @@ namespace glabels
|
|||||||
void drawLabel( double x, double y, const QPainterPath &path );
|
void drawLabel( double x, double y, const QPainterPath &path );
|
||||||
void drawArrow();
|
void drawArrow();
|
||||||
|
|
||||||
QGraphicsScene *mScene;
|
|
||||||
double mScale;
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
const libglabels::Template *mTmplate;
|
const libglabels::Template *mTmplate;
|
||||||
bool mRotateFlag;
|
bool mRotateFlag;
|
||||||
|
|
||||||
|
QGraphicsScene *mScene;
|
||||||
|
double mScale;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
TemplatePicker::TemplatePicker( QWidget *parent ) : QListWidget(parent)
|
TemplatePicker::TemplatePicker( QWidget *parent ) : QListWidget(parent)
|
||||||
{
|
{
|
||||||
setViewMode( QListView::IconMode );
|
setViewMode( QListView::IconMode );
|
||||||
@@ -39,6 +42,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set List of Templates to Pick From
|
||||||
|
///
|
||||||
void TemplatePicker::setTemplates( const QList <libglabels::Template*> &tmplates )
|
void TemplatePicker::setTemplates( const QList <libglabels::Template*> &tmplates )
|
||||||
{
|
{
|
||||||
foreach (libglabels::Template *tmplate, tmplates)
|
foreach (libglabels::Template *tmplate, tmplates)
|
||||||
@@ -48,6 +54,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Apply Filter to Narrow Template Choices
|
||||||
|
///
|
||||||
void TemplatePicker::applyFilter( const QString &searchString,
|
void TemplatePicker::applyFilter( const QString &searchString,
|
||||||
bool isoMask, bool usMask, bool otherMask )
|
bool isoMask, bool usMask, bool otherMask )
|
||||||
{
|
{
|
||||||
@@ -72,6 +81,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Get Currently Selected Template
|
||||||
|
///
|
||||||
const libglabels::Template *TemplatePicker::selectedTemplate()
|
const libglabels::Template *TemplatePicker::selectedTemplate()
|
||||||
{
|
{
|
||||||
QList<QListWidgetItem *> items = selectedItems();
|
QList<QListWidgetItem *> items = selectedItems();
|
||||||
|
|||||||
@@ -31,15 +31,31 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Template Picker Widget
|
||||||
|
///
|
||||||
class TemplatePicker : public QListWidget
|
class TemplatePicker : public QListWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
TemplatePicker( QWidget *parent = 0 );
|
TemplatePicker( QWidget *parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
void setTemplates( const QList <libglabels::Template*> &tmplates );
|
void setTemplates( const QList <libglabels::Template*> &tmplates );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Methods
|
||||||
|
/////////////////////////////////
|
||||||
void applyFilter( const QString &searchString, bool isoMask, bool usMask, bool otherMask );
|
void applyFilter( const QString &searchString, bool isoMask, bool usMask, bool otherMask );
|
||||||
|
|
||||||
const libglabels::Template *selectedTemplate();
|
const libglabels::Template *selectedTemplate();
|
||||||
|
|||||||
@@ -28,8 +28,11 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
TemplatePickerItem::TemplatePickerItem( libglabels::Template *tmplate,
|
TemplatePickerItem::TemplatePickerItem( libglabels::Template *tmplate,
|
||||||
QListWidget *parent = 0 )
|
QListWidget *parent )
|
||||||
: QListWidgetItem(parent)
|
: QListWidgetItem(parent)
|
||||||
{
|
{
|
||||||
mTmplate = tmplate;
|
mTmplate = tmplate;
|
||||||
@@ -40,5 +43,14 @@ namespace glabels
|
|||||||
setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
|
setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Template Property Getter
|
||||||
|
///
|
||||||
|
const libglabels::Template *TemplatePickerItem::tmplate() const
|
||||||
|
{
|
||||||
|
return mTmplate;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,14 +31,29 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Template Picker Item Widget
|
||||||
|
///
|
||||||
class TemplatePickerItem : public QListWidgetItem
|
class TemplatePickerItem : public QListWidgetItem
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
TemplatePickerItem( libglabels::Template *tmplate, QListWidget *parent );
|
TemplatePickerItem( libglabels::Template *tmplate, QListWidget *parent = 0 );
|
||||||
|
|
||||||
inline const libglabels::Template *tmplate() const { return mTmplate; }
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Properties
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
const libglabels::Template *tmplate() const;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
libglabels::Template *mTmplate;
|
libglabels::Template *mTmplate;
|
||||||
|
|
||||||
|
|||||||
+61
-2
@@ -36,6 +36,27 @@ namespace {
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Default Constructor
|
||||||
|
///
|
||||||
|
TextNode::TextNode()
|
||||||
|
: mFieldFlag(false), mData("")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor from Data
|
||||||
|
///
|
||||||
|
TextNode::TextNode( bool field_flag, const QString &data )
|
||||||
|
: mFieldFlag(field_flag), mData(data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor from Parsing Next Token in Text
|
||||||
|
///
|
||||||
TextNode::TextNode( const QString &text, int i_start, int &i_next )
|
TextNode::TextNode( const QString &text, int i_start, int &i_next )
|
||||||
{
|
{
|
||||||
State state = START;
|
State state = START;
|
||||||
@@ -175,13 +196,51 @@ namespace glabels
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_field_flag = field_flag;
|
mFieldFlag = field_flag;
|
||||||
m_data = field_flag ? field_name : literal_text;
|
mData = field_flag ? field_name : literal_text;
|
||||||
|
|
||||||
i_next = i;
|
i_next = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// == Operator
|
||||||
|
///
|
||||||
|
bool TextNode::operator==( const TextNode& other )
|
||||||
|
{
|
||||||
|
return ( (mFieldFlag == other.mFieldFlag) &&
|
||||||
|
(mData == other.mData) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// != Operator
|
||||||
|
///
|
||||||
|
bool TextNode::operator!=( const TextNode& other )
|
||||||
|
{
|
||||||
|
return ( (mFieldFlag != other.mFieldFlag) ||
|
||||||
|
(mData != other.mData) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Field Flag Property Getter
|
||||||
|
///
|
||||||
|
bool TextNode::fieldFlag( void ) const
|
||||||
|
{
|
||||||
|
return mFieldFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Data Property Getter
|
||||||
|
///
|
||||||
|
const QString& TextNode::data( void ) const
|
||||||
|
{
|
||||||
|
return mData;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if TODO
|
#if TODO
|
||||||
public string expand( MergeRecord? record )
|
public string expand( MergeRecord? record )
|
||||||
{
|
{
|
||||||
|
|||||||
+38
-27
@@ -27,53 +27,64 @@
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
class TextNode
|
///
|
||||||
|
/// Text Node Type
|
||||||
|
///
|
||||||
|
struct TextNode
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
TextNode()
|
TextNode();
|
||||||
: m_field_flag(false), m_data("")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TextNode( bool field_flag, const QString &data )
|
|
||||||
: m_field_flag(field_flag), m_data(data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~TextNode() {}
|
|
||||||
|
|
||||||
|
TextNode( bool field_flag, const QString &data );
|
||||||
|
|
||||||
TextNode( const QString &text, int i_start, int &i_next );
|
TextNode( const QString &text, int i_start, int &i_next );
|
||||||
|
|
||||||
|
|
||||||
bool operator==( const TextNode &tn )
|
/////////////////////////////////
|
||||||
{
|
// Operators
|
||||||
return ( (m_field_flag == tn.m_field_flag) &&
|
/////////////////////////////////
|
||||||
(m_data == tn.m_data) );
|
public:
|
||||||
}
|
bool operator==( const TextNode& other );
|
||||||
|
|
||||||
|
bool operator!=( const TextNode& other );
|
||||||
|
|
||||||
|
|
||||||
bool operator!=( const TextNode &tn )
|
/////////////////////////////////
|
||||||
{
|
// Properties
|
||||||
return ( (m_field_flag != tn.m_field_flag) ||
|
/////////////////////////////////
|
||||||
(m_data != tn.m_data) );
|
public:
|
||||||
}
|
//
|
||||||
|
// Field Flag Property
|
||||||
|
//
|
||||||
|
bool fieldFlag( void ) const;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Data Property
|
||||||
|
//
|
||||||
|
const QString& data( void ) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Methods
|
||||||
|
/////////////////////////////////
|
||||||
#if TODO
|
#if TODO
|
||||||
string expand( MergeRecord? record );
|
string expand( MergeRecord? record );
|
||||||
bool is_empty_field( MergeRecord? record );
|
bool is_empty_field( MergeRecord? record );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool field_flag( void ) { return m_field_flag; }
|
|
||||||
QString data( void ) { return m_data; }
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private Data
|
||||||
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool m_field_flag;
|
bool mFieldFlag;
|
||||||
QString m_data;
|
QString mData;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,9 @@
|
|||||||
#include "libglabels/FrameCd.h"
|
#include "libglabels/FrameCd.h"
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private Configuration Data
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const int nZoomLevels = 14;
|
const int nZoomLevels = 14;
|
||||||
@@ -65,6 +68,9 @@ namespace
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
View::View( QWidget *parent ) : QGraphicsView(parent)
|
View::View( QWidget *parent ) : QGraphicsView(parent)
|
||||||
{
|
{
|
||||||
setZoomReal( 1, false );
|
setZoomReal( 1, false );
|
||||||
@@ -86,6 +92,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Model Parameter Setter
|
||||||
|
///
|
||||||
void View::setModel( LabelModel* model )
|
void View::setModel( LabelModel* model )
|
||||||
{
|
{
|
||||||
mModel = model;
|
mModel = model;
|
||||||
@@ -103,18 +112,27 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Grid Visibility Parameter Setter
|
||||||
|
///
|
||||||
void View::setGridVisible( bool visibleFlag )
|
void View::setGridVisible( bool visibleFlag )
|
||||||
{
|
{
|
||||||
mGridLayer->setVisible( visibleFlag );
|
mGridLayer->setVisible( visibleFlag );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Markup Visibility Parameter Setter
|
||||||
|
///
|
||||||
void View::setMarkupVisible( bool visibleFlag )
|
void View::setMarkupVisible( bool visibleFlag )
|
||||||
{
|
{
|
||||||
mMarkupLayer->setVisible( visibleFlag );
|
mMarkupLayer->setVisible( visibleFlag );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Zoom In "One Notch"
|
||||||
|
///
|
||||||
void View::zoomIn()
|
void View::zoomIn()
|
||||||
{
|
{
|
||||||
// Find closest standard zoom level to our current zoom
|
// Find closest standard zoom level to our current zoom
|
||||||
@@ -137,6 +155,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Zoom Out "One Notch"
|
||||||
|
///
|
||||||
void View::zoomOut()
|
void View::zoomOut()
|
||||||
{
|
{
|
||||||
// Find closest standard zoom level to our current zoom
|
// Find closest standard zoom level to our current zoom
|
||||||
@@ -159,12 +180,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Zoom To 1:1 Scale
|
||||||
|
///
|
||||||
void View::zoom1To1()
|
void View::zoom1To1()
|
||||||
{
|
{
|
||||||
setZoomReal( 1.0, false );
|
setZoomReal( 1.0, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Zoom To Fit
|
||||||
|
///
|
||||||
void View::zoomToFit()
|
void View::zoomToFit()
|
||||||
{
|
{
|
||||||
double x_scale = (72.0/physicalDpiX()) * ( width() - ZOOM_TO_FIT_PAD ) / mModel->w();
|
double x_scale = (72.0/physicalDpiX()) * ( width() - ZOOM_TO_FIT_PAD ) / mModel->w();
|
||||||
@@ -179,18 +206,27 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Is Zoom at Maximum?
|
||||||
|
///
|
||||||
bool View::isZoomMax() const
|
bool View::isZoomMax() const
|
||||||
{
|
{
|
||||||
return ( mZoom >= zoomLevels[0] );
|
return ( mZoom >= zoomLevels[0] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Is Zoom at Minimum?
|
||||||
|
///
|
||||||
bool View::isZoomMin() const
|
bool View::isZoomMin() const
|
||||||
{
|
{
|
||||||
return ( mZoom <= zoomLevels[nZoomLevels-1] );
|
return ( mZoom <= zoomLevels[nZoomLevels-1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set Zoom to Value
|
||||||
|
///
|
||||||
void View::setZoomReal( double zoom, bool zoomToFitFlag )
|
void View::setZoomReal( double zoom, bool zoomToFitFlag )
|
||||||
{
|
{
|
||||||
mZoom = zoom;
|
mZoom = zoom;
|
||||||
@@ -203,6 +239,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Resize Event Handler
|
||||||
|
///
|
||||||
void View::resizeEvent( QResizeEvent *event )
|
void View::resizeEvent( QResizeEvent *event )
|
||||||
{
|
{
|
||||||
if ( mZoomToFitFlag )
|
if ( mZoomToFitFlag )
|
||||||
@@ -218,6 +257,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Mouse Movement Event Handler
|
||||||
|
///
|
||||||
void View::mouseMoveEvent( QMouseEvent* event )
|
void View::mouseMoveEvent( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
QPointF pointer = mapToScene( event->x(), event->y() );
|
QPointF pointer = mapToScene( event->x(), event->y() );
|
||||||
@@ -225,12 +267,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Leave Event Handler
|
||||||
|
///
|
||||||
void View::leaveEvent( QEvent* event )
|
void View::leaveEvent( QEvent* event )
|
||||||
{
|
{
|
||||||
emit pointerExited();
|
emit pointerExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Clear Layer (Item Group) of All Child Items
|
||||||
|
///
|
||||||
void View::clearLayer( QGraphicsItemGroup* layer )
|
void View::clearLayer( QGraphicsItemGroup* layer )
|
||||||
{
|
{
|
||||||
foreach( QGraphicsItem* item, layer->childItems() )
|
foreach( QGraphicsItem* item, layer->childItems() )
|
||||||
@@ -240,6 +288,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Label Layer
|
||||||
|
///
|
||||||
void View::createLabelLayer()
|
void View::createLabelLayer()
|
||||||
{
|
{
|
||||||
clearLayer( mLabelLayer );
|
clearLayer( mLabelLayer );
|
||||||
@@ -259,6 +310,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Grid Layer
|
||||||
|
///
|
||||||
void View::createGridLayer()
|
void View::createGridLayer()
|
||||||
{
|
{
|
||||||
clearLayer( mGridLayer );
|
clearLayer( mGridLayer );
|
||||||
@@ -302,6 +356,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Markup Layer
|
||||||
|
///
|
||||||
void View::createMarkupLayer()
|
void View::createMarkupLayer()
|
||||||
{
|
{
|
||||||
clearLayer( mMarkupLayer );
|
clearLayer( mMarkupLayer );
|
||||||
@@ -321,6 +378,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Add Object to Object Layer
|
||||||
|
///
|
||||||
void View::addObjectToObjectLayer( LabelModelObject* object )
|
void View::addObjectToObjectLayer( LabelModelObject* object )
|
||||||
{
|
{
|
||||||
QGraphicsItem* item = object->createGraphicsItem();
|
QGraphicsItem* item = object->createGraphicsItem();
|
||||||
@@ -328,6 +388,9 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Create Foreground Layer
|
||||||
|
///
|
||||||
void View::createForegroundLayer()
|
void View::createForegroundLayer()
|
||||||
{
|
{
|
||||||
clearLayer( mForegroundLayer );
|
clearLayer( mForegroundLayer );
|
||||||
|
|||||||
+3
-5
@@ -34,11 +34,9 @@ namespace glabels
|
|||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////
|
///
|
||||||
//////////////////////////////////////////////
|
/// View Widget
|
||||||
// View
|
///
|
||||||
//////////////////////////////////////////////
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
class View : public QGraphicsView
|
class View : public QGraphicsView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
Reference in New Issue
Block a user