Initial skeletal object editor.
This commit is contained in:
@@ -31,6 +31,7 @@ set (glabels_sources
|
|||||||
MergeField.cpp
|
MergeField.cpp
|
||||||
MergeRecord.cpp
|
MergeRecord.cpp
|
||||||
NewLabelDialog.cpp
|
NewLabelDialog.cpp
|
||||||
|
ObjectEditor.cpp
|
||||||
Outline.cpp
|
Outline.cpp
|
||||||
TemplatePicker.cpp
|
TemplatePicker.cpp
|
||||||
TemplatePickerItem.cpp
|
TemplatePickerItem.cpp
|
||||||
@@ -56,8 +57,9 @@ set (glabels_qobject_headers
|
|||||||
LabelModelObject.h
|
LabelModelObject.h
|
||||||
LabelModelBoxObject.h
|
LabelModelBoxObject.h
|
||||||
LabelModelShapeObject.h
|
LabelModelShapeObject.h
|
||||||
NewLabelDialog.h
|
|
||||||
MainWindow.h
|
MainWindow.h
|
||||||
|
NewLabelDialog.h
|
||||||
|
ObjectEditor.h
|
||||||
SimplePreview.h
|
SimplePreview.h
|
||||||
TemplatePicker.h
|
TemplatePicker.h
|
||||||
View.h
|
View.h
|
||||||
@@ -65,6 +67,7 @@ set (glabels_qobject_headers
|
|||||||
|
|
||||||
set (glabels_forms
|
set (glabels_forms
|
||||||
ui/NewLabelDialog.ui
|
ui/NewLabelDialog.ui
|
||||||
|
ui/ObjectEditor.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
set (glabels_resource_files
|
set (glabels_resource_files
|
||||||
|
|||||||
@@ -34,11 +34,13 @@ namespace
|
|||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
ColorButton::ColorButton( const QString& defaultLabel,
|
ColorButton::ColorButton( QWidget* parent )
|
||||||
const QColor& defaultColor,
|
|
||||||
const QColor& color,
|
|
||||||
QWidget* parent )
|
|
||||||
: QPushButton( parent )
|
: QPushButton( parent )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ColorButton::init( const QString& defaultLabel, const QColor& defaultColor, const QColor& color )
|
||||||
{
|
{
|
||||||
mDefaultColor = defaultColor;
|
mDefaultColor = defaultColor;
|
||||||
mColorNode = ColorNode( color );
|
mColorNode = ColorNode( color );
|
||||||
|
|||||||
@@ -42,10 +42,7 @@ namespace glabels
|
|||||||
// Life Cycle
|
// Life Cycle
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
ColorButton( const QString& defaultLabel,
|
ColorButton( QWidget* parent = 0 );
|
||||||
const QColor& defaultColor,
|
|
||||||
const QColor& color,
|
|
||||||
QWidget* parent = 0 );
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -59,6 +56,7 @@ namespace glabels
|
|||||||
// Public Methods
|
// Public Methods
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
|
void init( const QString& defaultLabel, const QColor& defaultColor, const QColor& color );
|
||||||
void setColorNode( ColorNode colorNode );
|
void setColorNode( ColorNode colorNode );
|
||||||
void setColor( QColor color );
|
void setColor( QColor color );
|
||||||
void setToDefault();
|
void setToDefault();
|
||||||
|
|||||||
+12
-9
@@ -27,8 +27,19 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
FieldButton::FieldButton( const QString& name, QWidget* parent )
|
FieldButton::FieldButton( QWidget* parent )
|
||||||
: QPushButton(parent)
|
: QPushButton(parent)
|
||||||
|
{
|
||||||
|
setEnabled( false );
|
||||||
|
|
||||||
|
mMenu = new FieldMenu();
|
||||||
|
setMenu( mMenu );
|
||||||
|
|
||||||
|
connect( mMenu, SIGNAL(keySelected(const QString&)), this, SLOT(onMenuKeySelected(const QString&)) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FieldButton::setName( const QString& name )
|
||||||
{
|
{
|
||||||
if ( name.isNull() || name.isEmpty() )
|
if ( name.isNull() || name.isEmpty() )
|
||||||
{
|
{
|
||||||
@@ -40,14 +51,6 @@ namespace glabels
|
|||||||
setText( name );
|
setText( name );
|
||||||
mLabelIsKey = true;
|
mLabelIsKey = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setEnabled( false );
|
|
||||||
|
|
||||||
mMenu = new FieldMenu();
|
|
||||||
setMenu( mMenu );
|
|
||||||
|
|
||||||
connect( mMenu, SIGNAL(keySelected(const QString&)), this, SLOT(onMenuKeySelected(const QString&)) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace glabels
|
|||||||
// Life Cycle
|
// Life Cycle
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
FieldButton( const QString& name, QWidget* parent = 0 );
|
FieldButton( QWidget* parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -61,6 +61,7 @@ namespace glabels
|
|||||||
// Public Methods
|
// Public Methods
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
|
void setName( const QString& name = "" );
|
||||||
void setKeys( const QList<QString>& keyList );
|
void setKeys( const QList<QString>& keyList );
|
||||||
void clearKeys();
|
void clearKeys();
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "libglabels/Db.h"
|
#include "libglabels/Db.h"
|
||||||
#include "View.h"
|
#include "View.h"
|
||||||
|
#include "ObjectEditor.h"
|
||||||
#include "LabelModel.h"
|
#include "LabelModel.h"
|
||||||
#include "LabelModelBoxObject.h"
|
#include "LabelModelBoxObject.h"
|
||||||
#include "Icons.h"
|
#include "Icons.h"
|
||||||
@@ -54,8 +55,17 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
{
|
{
|
||||||
|
QWidget* editorPage = new QWidget;
|
||||||
|
|
||||||
mView = new View();
|
mView = new View();
|
||||||
setCentralWidget( mView );
|
mObjectEditor = new ObjectEditor();
|
||||||
|
|
||||||
|
QHBoxLayout* editorLayout = new QHBoxLayout;
|
||||||
|
editorLayout->addWidget( mView );
|
||||||
|
editorLayout->addWidget( mObjectEditor );
|
||||||
|
editorPage->setLayout( editorLayout );
|
||||||
|
|
||||||
|
setCentralWidget( editorPage );
|
||||||
mModel = 0;
|
mModel = 0;
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace glabels
|
|||||||
// Forward References
|
// Forward References
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
class View;
|
class View;
|
||||||
|
class ObjectEditor;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -187,8 +188,9 @@ namespace glabels
|
|||||||
QToolBar* editToolBar;
|
QToolBar* editToolBar;
|
||||||
QToolBar* viewToolBar;
|
QToolBar* viewToolBar;
|
||||||
|
|
||||||
LabelModel* mModel;
|
LabelModel* mModel;
|
||||||
View* mView;
|
View* mView;
|
||||||
|
ObjectEditor* mObjectEditor;
|
||||||
|
|
||||||
QLabel* zoomInfoLabel;
|
QLabel* zoomInfoLabel;
|
||||||
QLabel* cursorInfoLabel;
|
QLabel* cursorInfoLabel;
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/* ObjectEditor.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
||||||
|
*
|
||||||
|
* This file is part of gLabels-qt.
|
||||||
|
*
|
||||||
|
* gLabels-qt is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* gLabels-qt is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ObjectEditor.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Constructor
|
||||||
|
///
|
||||||
|
ObjectEditor::ObjectEditor( QWidget *parent )
|
||||||
|
{
|
||||||
|
setupUi( this );
|
||||||
|
|
||||||
|
setEnabled( false );
|
||||||
|
hidePages();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ObjectEditor::hidePages()
|
||||||
|
{
|
||||||
|
notebook->removeTab( notebook->indexOf(textPage) );
|
||||||
|
notebook->removeTab( notebook->indexOf(barcodePage) );
|
||||||
|
notebook->removeTab( notebook->indexOf(imagePage) );
|
||||||
|
notebook->removeTab( notebook->indexOf(lineFillPage) );
|
||||||
|
notebook->removeTab( notebook->indexOf(posSizePage) );
|
||||||
|
notebook->removeTab( notebook->indexOf(shadowPage) );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/* ObjectEditor.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
||||||
|
*
|
||||||
|
* This file is part of gLabels-qt.
|
||||||
|
*
|
||||||
|
* gLabels-qt is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* gLabels-qt is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef glabels_ObjectEditor_h
|
||||||
|
#define glabels_ObjectEditor_h
|
||||||
|
|
||||||
|
#include "ui_ObjectEditor.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Object Editor Widget
|
||||||
|
///
|
||||||
|
class ObjectEditor : public QWidget, public Ui_ObjectEditor
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Life Cycle
|
||||||
|
/////////////////////////////////
|
||||||
|
public:
|
||||||
|
ObjectEditor( QWidget *parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Accessors
|
||||||
|
/////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Private methods
|
||||||
|
/////////////////////////////////
|
||||||
|
private:
|
||||||
|
void hidePages();
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Slots
|
||||||
|
/////////////////////////////////
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // glabels_ObjectEditor_h
|
||||||
+1
-1
@@ -86,7 +86,7 @@ glabels::View::View( QWidget *parent ) : QWidget(parent)
|
|||||||
|
|
||||||
setMouseTracking( true );
|
setMouseTracking( true );
|
||||||
|
|
||||||
setMinimumSize( 640, 400 );
|
setMinimumSize( 640, 450 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user