Initial skeletal object editor.
This commit is contained in:
@@ -31,6 +31,7 @@ set (glabels_sources
|
||||
MergeField.cpp
|
||||
MergeRecord.cpp
|
||||
NewLabelDialog.cpp
|
||||
ObjectEditor.cpp
|
||||
Outline.cpp
|
||||
TemplatePicker.cpp
|
||||
TemplatePickerItem.cpp
|
||||
@@ -56,8 +57,9 @@ set (glabels_qobject_headers
|
||||
LabelModelObject.h
|
||||
LabelModelBoxObject.h
|
||||
LabelModelShapeObject.h
|
||||
NewLabelDialog.h
|
||||
MainWindow.h
|
||||
NewLabelDialog.h
|
||||
ObjectEditor.h
|
||||
SimplePreview.h
|
||||
TemplatePicker.h
|
||||
View.h
|
||||
@@ -65,6 +67,7 @@ set (glabels_qobject_headers
|
||||
|
||||
set (glabels_forms
|
||||
ui/NewLabelDialog.ui
|
||||
ui/ObjectEditor.ui
|
||||
)
|
||||
|
||||
set (glabels_resource_files
|
||||
|
||||
@@ -34,11 +34,13 @@ namespace
|
||||
namespace glabels
|
||||
{
|
||||
|
||||
ColorButton::ColorButton( const QString& defaultLabel,
|
||||
const QColor& defaultColor,
|
||||
const QColor& color,
|
||||
QWidget* parent )
|
||||
ColorButton::ColorButton( QWidget* parent )
|
||||
: QPushButton( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void ColorButton::init( const QString& defaultLabel, const QColor& defaultColor, const QColor& color )
|
||||
{
|
||||
mDefaultColor = defaultColor;
|
||||
mColorNode = ColorNode( color );
|
||||
|
||||
@@ -42,10 +42,7 @@ namespace glabels
|
||||
// Life Cycle
|
||||
/////////////////////////////////
|
||||
public:
|
||||
ColorButton( const QString& defaultLabel,
|
||||
const QColor& defaultColor,
|
||||
const QColor& color,
|
||||
QWidget* parent = 0 );
|
||||
ColorButton( QWidget* parent = 0 );
|
||||
|
||||
|
||||
/////////////////////////////////
|
||||
@@ -59,6 +56,7 @@ namespace glabels
|
||||
// Public Methods
|
||||
/////////////////////////////////
|
||||
public:
|
||||
void init( const QString& defaultLabel, const QColor& defaultColor, const QColor& color );
|
||||
void setColorNode( ColorNode colorNode );
|
||||
void setColor( QColor color );
|
||||
void setToDefault();
|
||||
|
||||
+12
-9
@@ -27,8 +27,19 @@ namespace glabels
|
||||
///
|
||||
/// Constructor
|
||||
///
|
||||
FieldButton::FieldButton( const QString& name, QWidget* parent )
|
||||
FieldButton::FieldButton( QWidget* 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() )
|
||||
{
|
||||
@@ -40,14 +51,6 @@ namespace glabels
|
||||
setText( name );
|
||||
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
|
||||
/////////////////////////////////
|
||||
public:
|
||||
FieldButton( const QString& name, QWidget* parent = 0 );
|
||||
FieldButton( QWidget* parent = 0 );
|
||||
|
||||
|
||||
/////////////////////////////////
|
||||
@@ -61,6 +61,7 @@ namespace glabels
|
||||
// Public Methods
|
||||
/////////////////////////////////
|
||||
public:
|
||||
void setName( const QString& name = "" );
|
||||
void setKeys( const QList<QString>& keyList );
|
||||
void clearKeys();
|
||||
|
||||
|
||||
+11
-1
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "libglabels/Db.h"
|
||||
#include "View.h"
|
||||
#include "ObjectEditor.h"
|
||||
#include "LabelModel.h"
|
||||
#include "LabelModelBoxObject.h"
|
||||
#include "Icons.h"
|
||||
@@ -54,8 +55,17 @@ namespace glabels
|
||||
///
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
QWidget* editorPage = new QWidget;
|
||||
|
||||
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;
|
||||
|
||||
createActions();
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace glabels
|
||||
// Forward References
|
||||
class LabelModel;
|
||||
class View;
|
||||
class ObjectEditor;
|
||||
|
||||
|
||||
///
|
||||
@@ -187,8 +188,9 @@ namespace glabels
|
||||
QToolBar* editToolBar;
|
||||
QToolBar* viewToolBar;
|
||||
|
||||
LabelModel* mModel;
|
||||
View* mView;
|
||||
LabelModel* mModel;
|
||||
View* mView;
|
||||
ObjectEditor* mObjectEditor;
|
||||
|
||||
QLabel* zoomInfoLabel;
|
||||
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 );
|
||||
|
||||
setMinimumSize( 640, 400 );
|
||||
setMinimumSize( 640, 450 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user