mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 22:00:35 +01:00
TBT editor: added menu entries to add rows/columns at the end of the grid.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1637 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -304,6 +304,8 @@ void QETTitleBlockTemplateEditor::initActions() {
|
|||||||
zoom_out_ = new QAction(QET::Icons::ZoomOut, tr("Zoom arri\350re", "menu entry"), this);
|
zoom_out_ = new QAction(QET::Icons::ZoomOut, tr("Zoom arri\350re", "menu entry"), this);
|
||||||
zoom_fit_ = new QAction(QET::Icons::ZoomFitBest, tr("Zoom adapt\351", "menu entry"), this);
|
zoom_fit_ = new QAction(QET::Icons::ZoomFitBest, tr("Zoom adapt\351", "menu entry"), this);
|
||||||
zoom_reset_ = new QAction(QET::Icons::ZoomOriginal, tr("Pas de zoom", "menu entry"), this);
|
zoom_reset_ = new QAction(QET::Icons::ZoomOriginal, tr("Pas de zoom", "menu entry"), this);
|
||||||
|
add_row_ = new QAction(QET::Icons::EditTableInsertRowAbove, tr("Ajouter une &ligne", "menu entry"), this);
|
||||||
|
add_col_ = new QAction(QET::Icons::EditTableInsertColumnRight, tr("Ajouter une &colonne", "menu entry"), this);
|
||||||
merge_cells_ = new QAction(QET::Icons::EditTableCellMerge, tr("&Fusionner les cellules", "menu entry"), this);
|
merge_cells_ = new QAction(QET::Icons::EditTableCellMerge, tr("&Fusionner les cellules", "menu entry"), this);
|
||||||
split_cell_ = new QAction(QET::Icons::EditTableCellSplit, tr("&S\351parer les cellules", "menu entry"), this);
|
split_cell_ = new QAction(QET::Icons::EditTableCellSplit, tr("&S\351parer les cellules", "menu entry"), this);
|
||||||
|
|
||||||
@@ -344,6 +346,8 @@ void QETTitleBlockTemplateEditor::initActions() {
|
|||||||
connect(zoom_fit_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomFit()));
|
connect(zoom_fit_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomFit()));
|
||||||
connect(zoom_reset_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomReset()));
|
connect(zoom_reset_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomReset()));
|
||||||
connect(edit_info_, SIGNAL(triggered()), this, SLOT(editTemplateInformation()));
|
connect(edit_info_, SIGNAL(triggered()), this, SLOT(editTemplateInformation()));
|
||||||
|
connect(add_row_, SIGNAL(triggered()), template_edition_area_view_, SLOT(addRowAtEnd()));
|
||||||
|
connect(add_col_, SIGNAL(triggered()), template_edition_area_view_, SLOT(addColumnAtEnd()));
|
||||||
connect(merge_cells_, SIGNAL(triggered()), template_edition_area_view_, SLOT(mergeSelectedCells()));
|
connect(merge_cells_, SIGNAL(triggered()), template_edition_area_view_, SLOT(mergeSelectedCells()));
|
||||||
connect(split_cell_, SIGNAL(triggered()), template_edition_area_view_, SLOT(splitSelectedCell()));
|
connect(split_cell_, SIGNAL(triggered()), template_edition_area_view_, SLOT(splitSelectedCell()));
|
||||||
}
|
}
|
||||||
@@ -372,8 +376,11 @@ void QETTitleBlockTemplateEditor::initMenus() {
|
|||||||
edit_menu_ -> addAction(copy_);
|
edit_menu_ -> addAction(copy_);
|
||||||
edit_menu_ -> addAction(paste_);
|
edit_menu_ -> addAction(paste_);
|
||||||
edit_menu_ -> addSeparator();
|
edit_menu_ -> addSeparator();
|
||||||
|
edit_menu_ -> addAction(add_row_);
|
||||||
|
edit_menu_ -> addAction(add_col_);
|
||||||
edit_menu_ -> addAction(merge_cells_);
|
edit_menu_ -> addAction(merge_cells_);
|
||||||
edit_menu_ -> addAction(split_cell_);
|
edit_menu_ -> addAction(split_cell_);
|
||||||
|
edit_menu_ -> addSeparator();
|
||||||
edit_menu_ -> addAction(edit_info_);
|
edit_menu_ -> addAction(edit_info_);
|
||||||
display_menu_ -> addAction(zoom_in_);
|
display_menu_ -> addAction(zoom_in_);
|
||||||
display_menu_ -> addAction(zoom_out_);
|
display_menu_ -> addAction(zoom_out_);
|
||||||
@@ -582,6 +589,8 @@ void QETTitleBlockTemplateEditor::updateActions() {
|
|||||||
cut_ -> setEnabled(!read_only_ && count);
|
cut_ -> setEnabled(!read_only_ && count);
|
||||||
copy_ -> setEnabled(count);
|
copy_ -> setEnabled(count);
|
||||||
paste_ -> setEnabled(!read_only_ && count && template_edition_area_view_ -> mayPaste());
|
paste_ -> setEnabled(!read_only_ && count && template_edition_area_view_ -> mayPaste());
|
||||||
|
add_row_ -> setEnabled(!read_only_);
|
||||||
|
add_col_ -> setEnabled(!read_only_);
|
||||||
merge_cells_ -> setEnabled(!read_only_ && can_merge);
|
merge_cells_ -> setEnabled(!read_only_ && can_merge);
|
||||||
split_cell_ -> setEnabled(!read_only_ && can_split);
|
split_cell_ -> setEnabled(!read_only_ && can_split);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class QETTitleBlockTemplateEditor : public QETMainWindow {
|
|||||||
QMenu *file_menu_, *edit_menu_,/* *paste_from_menu_, */*display_menu_,/* *tools_menu_*/;
|
QMenu *file_menu_, *edit_menu_,/* *paste_from_menu_, */*display_menu_,/* *tools_menu_*/;
|
||||||
/// actions
|
/// actions
|
||||||
QAction *new_, *open_, *open_from_file_, *save_, *save_as_, *save_as_file_, *quit_;
|
QAction *new_, *open_, *open_from_file_, *save_, *save_as_, *save_as_file_, *quit_;
|
||||||
QAction *undo_, *redo_, *cut_, *copy_, *paste_, *edit_info_, *merge_cells_, *split_cell_;
|
QAction *undo_, *redo_, *cut_, *copy_, *paste_, *edit_info_, *add_row_, *add_col_, *merge_cells_, *split_cell_;
|
||||||
QAction *zoom_in_, *zoom_out_, *zoom_fit_, *zoom_reset_;
|
QAction *zoom_in_, *zoom_out_, *zoom_fit_, *zoom_reset_;
|
||||||
/// Location of the currently edited template
|
/// Location of the currently edited template
|
||||||
TitleBlockTemplateLocation location_;
|
TitleBlockTemplateLocation location_;
|
||||||
|
|||||||
@@ -257,6 +257,22 @@ void TitleBlockTemplateView::paste() {
|
|||||||
requestGridModification(paste_command);
|
requestGridModification(paste_command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Add a column right after the last one.
|
||||||
|
*/
|
||||||
|
void TitleBlockTemplateView::addColumnAtEnd() {
|
||||||
|
if (read_only_) return;
|
||||||
|
requestGridModification(ModifyTemplateGridCommand::addColumn(tbtemplate_, tbtemplate_ -> columnsCount()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Add a row right after the last one.
|
||||||
|
*/
|
||||||
|
void TitleBlockTemplateView::addRowAtEnd() {
|
||||||
|
if (read_only_) return;
|
||||||
|
requestGridModification(ModifyTemplateGridCommand::addRow(tbtemplate_, tbtemplate_ -> rowsCount()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Add a column right before the last index selected when calling the context
|
Add a column right before the last index selected when calling the context
|
||||||
menu.
|
menu.
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class TitleBlockTemplateView : public QGraphicsView {
|
|||||||
bool mayPaste();
|
bool mayPaste();
|
||||||
QList<TitleBlockCell> pastedCells();
|
QList<TitleBlockCell> pastedCells();
|
||||||
void paste();
|
void paste();
|
||||||
|
void addColumnAtEnd();
|
||||||
|
void addRowAtEnd();
|
||||||
void addColumnBefore();
|
void addColumnBefore();
|
||||||
void addRowBefore();
|
void addRowBefore();
|
||||||
void addColumnAfter();
|
void addColumnAfter();
|
||||||
|
|||||||
Reference in New Issue
Block a user