File indexing completed on 2024-12-22 04:17:25
0001 /*************************************************************************** 0002 * * 0003 * copyright : (C) 2007 The University of Toronto * 0004 * netterfield@astro.utoronto.ca * 0005 * * 0006 * This program is free software; you can redistribute it and/or modify * 0007 * it under the terms of the GNU General Public License as published by * 0008 * the Free Software Foundation; either version 2 of the License, or * 0009 * (at your option) any later version. * 0010 * * 0011 ***************************************************************************/ 0012 0013 #include "arrowpropertiestab.h" 0014 0015 namespace Kst { 0016 0017 ArrowPropertiesTab::ArrowPropertiesTab(QWidget *parent) 0018 : DialogTab(parent) { 0019 0020 setupUi(this); 0021 setTabTitle(tr("ArrowProperties")); 0022 0023 connect(_startArrow, SIGNAL(stateChanged(int)), this, SLOT(update())); 0024 connect(_endArrow, SIGNAL(stateChanged(int)), this, SLOT(update())); 0025 0026 connect(_startArrow, SIGNAL(stateChanged(int)), this, SIGNAL(modified())); 0027 connect(_endArrow, SIGNAL(stateChanged(int)), this, SIGNAL(modified())); 0028 connect(_startArrowScale, SIGNAL(valueChanged(double)), this, SIGNAL(modified())); 0029 connect(_endArrowScale, SIGNAL(valueChanged(double)), this, SIGNAL(modified())); 0030 0031 update(); 0032 } 0033 0034 0035 ArrowPropertiesTab::~ArrowPropertiesTab() { 0036 } 0037 0038 0039 void ArrowPropertiesTab::update() { 0040 _startArrowScale->setEnabled(_startArrow->isChecked()); 0041 _endArrowScale->setEnabled(_endArrow->isChecked()); 0042 _startArrowLabel->setEnabled(_startArrow->isChecked()); 0043 _endArrowLabel->setEnabled(_endArrow->isChecked()); 0044 } 0045 0046 0047 bool ArrowPropertiesTab::startArrowHead() { 0048 return _startArrow->isChecked(); 0049 } 0050 0051 0052 void ArrowPropertiesTab::setStartArrowHead(const bool enabled) { 0053 _startArrow->setChecked(enabled); 0054 } 0055 0056 0057 bool ArrowPropertiesTab::endArrowHead() { 0058 return _endArrow->isChecked(); 0059 } 0060 0061 0062 void ArrowPropertiesTab::setEndArrowHead(const bool enabled) { 0063 _endArrow->setChecked(enabled); 0064 } 0065 0066 0067 qreal ArrowPropertiesTab::startArrowScale() { 0068 return _startArrowScale->value(); 0069 } 0070 0071 0072 void ArrowPropertiesTab::setStartArrowScale(const qreal scale) { 0073 _startArrowScale->setValue(scale); 0074 } 0075 0076 0077 qreal ArrowPropertiesTab::endArrowScale() { 0078 return _endArrowScale->value(); 0079 } 0080 0081 0082 void ArrowPropertiesTab::setEndArrowScale(const qreal scale) { 0083 _endArrowScale->setValue(scale); 0084 } 0085 0086 } 0087 // vim: ts=2 sw=2 et