diff options
Diffstat (limited to 'doc/html/chart-setdataform-cpp.html')
-rw-r--r-- | doc/html/chart-setdataform-cpp.html | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/doc/html/chart-setdataform-cpp.html b/doc/html/chart-setdataform-cpp.html index 9b400de6c..4cf004ee8 100644 --- a/doc/html/chart-setdataform-cpp.html +++ b/doc/html/chart-setdataform-cpp.html @@ -35,12 +35,12 @@ body { background: #ffffff; color: black; } <pre>#include "setdataform.h" #include "chartform.h" -#include <<a href="qcolordialog-h.html">qcolordialog.h</a>> -#include <<a href="qcombobox-h.html">qcombobox.h</a>> -#include <<a href="qlayout-h.html">qlayout.h</a>> -#include <<a href="qpixmap-h.html">qpixmap.h</a>> -#include <<a href="qpushbutton-h.html">qpushbutton.h</a>> -#include <<a href="qtable-h.html">qtable.h</a>> +#include <<a href="qcolordialog-h.html">ntqcolordialog.h</a>> +#include <<a href="qcombobox-h.html">ntqcombobox.h</a>> +#include <<a href="qlayout-h.html">ntqlayout.h</a>> +#include <<a href="qpixmap-h.html">ntqpixmap.h</a>> +#include <<a href="qpushbutton-h.html">ntqpushbutton.h</a>> +#include <<a href="qtable-h.html">ntqtable.h</a>> #include "images/pattern01.xpm" #include "images/pattern02.xpm" @@ -61,70 +61,70 @@ const int MAX_PATTERNS = 14; <a name="f178"></a>SetDataForm::SetDataForm( ElementVector *elements, int decimalPlaces, - <a href="qwidget.html">TQWidget</a>* parent, const char* name, + <a href="ntqwidget.html">TQWidget</a>* parent, const char* name, bool modal, WFlags f ) - : <a href="qdialog.html">TQDialog</a>( parent, name, modal, f ) + : <a href="ntqdialog.html">TQDialog</a>( parent, name, modal, f ) { m_elements = elements; m_decimalPlaces = decimalPlaces; - <a href="qwidget.html#setCaption">setCaption</a>( "Chart -- Set Data" ); - <a href="qwidget.html#resize">resize</a>( 540, 440 ); + <a href="ntqwidget.html#setCaption">setCaption</a>( "Chart -- Set Data" ); + <a href="ntqwidget.html#resize">resize</a>( 540, 440 ); tableButtonBox = new <a href="qvboxlayout.html">TQVBoxLayout</a>( this, 11, 6, "table button box layout" ); - table = new <a href="qtable.html">TQTable</a>( this, "data table" ); - table-><a href="qtable.html#setNumCols">setNumCols</a>( 5 ); - table-><a href="qtable.html#setNumRows">setNumRows</a>( ChartForm::MAX_ELEMENTS ); - table-><a href="qtable.html#setColumnReadOnly">setColumnReadOnly</a>( 1, TRUE ); - table-><a href="qtable.html#setColumnReadOnly">setColumnReadOnly</a>( 2, TRUE ); - table-><a href="qtable.html#setColumnReadOnly">setColumnReadOnly</a>( 4, TRUE ); - table-><a href="qtable.html#setColumnWidth">setColumnWidth</a>( 0, 80 ); - table-><a href="qtable.html#setColumnWidth">setColumnWidth</a>( 1, 60 ); // Columns 1 and 4 must be equal - table-><a href="qtable.html#setColumnWidth">setColumnWidth</a>( 2, 60 ); - table-><a href="qtable.html#setColumnWidth">setColumnWidth</a>( 3, 200 ); - table-><a href="qtable.html#setColumnWidth">setColumnWidth</a>( 4, 60 ); - <a href="qheader.html">TQHeader</a> *th = table-><a href="qtable.html#horizontalHeader">horizontalHeader</a>(); - th-><a href="qheader.html#setLabel">setLabel</a>( 0, "Value" ); - th-><a href="qheader.html#setLabel">setLabel</a>( 1, "Color" ); - th-><a href="qheader.html#setLabel">setLabel</a>( 2, "Pattern" ); - th-><a href="qheader.html#setLabel">setLabel</a>( 3, "Label" ); - th-><a href="qheader.html#setLabel">setLabel</a>( 4, "Color" ); + table = new <a href="ntqtable.html">TQTable</a>( this, "data table" ); + table-><a href="ntqtable.html#setNumCols">setNumCols</a>( 5 ); + table-><a href="ntqtable.html#setNumRows">setNumRows</a>( ChartForm::MAX_ELEMENTS ); + table-><a href="ntqtable.html#setColumnReadOnly">setColumnReadOnly</a>( 1, TRUE ); + table-><a href="ntqtable.html#setColumnReadOnly">setColumnReadOnly</a>( 2, TRUE ); + table-><a href="ntqtable.html#setColumnReadOnly">setColumnReadOnly</a>( 4, TRUE ); + table-><a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 0, 80 ); + table-><a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 1, 60 ); // Columns 1 and 4 must be equal + table-><a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 2, 60 ); + table-><a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 3, 200 ); + table-><a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 4, 60 ); + <a href="ntqheader.html">TQHeader</a> *th = table-><a href="ntqtable.html#horizontalHeader">horizontalHeader</a>(); + th-><a href="ntqheader.html#setLabel">setLabel</a>( 0, "Value" ); + th-><a href="ntqheader.html#setLabel">setLabel</a>( 1, "Color" ); + th-><a href="ntqheader.html#setLabel">setLabel</a>( 2, "Pattern" ); + th-><a href="ntqheader.html#setLabel">setLabel</a>( 3, "Label" ); + th-><a href="ntqheader.html#setLabel">setLabel</a>( 4, "Color" ); tableButtonBox-><a href="qboxlayout.html#addWidget">addWidget</a>( table ); buttonBox = new <a href="qhboxlayout.html">TQHBoxLayout</a>( 0, 0, 6, "button box layout" ); - colorPushButton = new <a href="qpushbutton.html">TQPushButton</a>( this, "color button" ); - colorPushButton-><a href="qbutton.html#setText">setText</a>( "&Color..." ); - colorPushButton-><a href="qwidget.html#setEnabled">setEnabled</a>( FALSE ); + colorPushButton = new <a href="ntqpushbutton.html">TQPushButton</a>( this, "color button" ); + colorPushButton-><a href="ntqbutton.html#setText">setText</a>( "&Color..." ); + colorPushButton-><a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE ); buttonBox-><a href="qboxlayout.html#addWidget">addWidget</a>( colorPushButton ); <a href="qspaceritem.html">TQSpacerItem</a> *spacer = new <a href="qspaceritem.html">TQSpacerItem</a>( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); buttonBox-><a href="qboxlayout.html#addItem">addItem</a>( spacer ); - okPushButton = new <a href="qpushbutton.html">TQPushButton</a>( this, "ok button" ); - okPushButton-><a href="qbutton.html#setText">setText</a>( "OK" ); - okPushButton-><a href="qpushbutton.html#setDefault">setDefault</a>( TRUE ); + okPushButton = new <a href="ntqpushbutton.html">TQPushButton</a>( this, "ok button" ); + okPushButton-><a href="ntqbutton.html#setText">setText</a>( "OK" ); + okPushButton-><a href="ntqpushbutton.html#setDefault">setDefault</a>( TRUE ); buttonBox-><a href="qboxlayout.html#addWidget">addWidget</a>( okPushButton ); - cancelPushButton = new <a href="qpushbutton.html">TQPushButton</a>( this, "cancel button" ); - cancelPushButton-><a href="qbutton.html#setText">setText</a>( "Cancel" ); - cancelPushButton-><a href="qbutton.html#setAccel">setAccel</a>( Key_Escape ); + cancelPushButton = new <a href="ntqpushbutton.html">TQPushButton</a>( this, "cancel button" ); + cancelPushButton-><a href="ntqbutton.html#setText">setText</a>( "Cancel" ); + cancelPushButton-><a href="ntqbutton.html#setAccel">setAccel</a>( Key_Escape ); buttonBox-><a href="qboxlayout.html#addWidget">addWidget</a>( cancelPushButton ); tableButtonBox-><a href="qboxlayout.html#addLayout">addLayout</a>( buttonBox ); - <a href="qobject.html#connect">connect</a>( table, SIGNAL( <a href="qtable.html#clicked">clicked</a>(int,int,int,const <a href="qpoint.html">TQPoint</a>&) ), + <a href="ntqobject.html#connect">connect</a>( table, SIGNAL( <a href="ntqtable.html#clicked">clicked</a>(int,int,int,const <a href="ntqpoint.html">TQPoint</a>&) ), this, SLOT( setColor(int,int) ) ); - <a href="qobject.html#connect">connect</a>( table, SIGNAL( <a href="qtable.html#currentChanged">currentChanged</a>(int,int) ), + <a href="ntqobject.html#connect">connect</a>( table, SIGNAL( <a href="ntqtable.html#currentChanged">currentChanged</a>(int,int) ), this, SLOT( currentChanged(int,int) ) ); - <a href="qobject.html#connect">connect</a>( table, SIGNAL( <a href="qtable.html#valueChanged">valueChanged</a>(int,int) ), + <a href="ntqobject.html#connect">connect</a>( table, SIGNAL( <a href="ntqtable.html#valueChanged">valueChanged</a>(int,int) ), this, SLOT( valueChanged(int,int) ) ); - <a href="qobject.html#connect">connect</a>( colorPushButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), this, SLOT( setColor() ) ); - <a href="qobject.html#connect">connect</a>( okPushButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), this, SLOT( <a href="qdialog.html#accept">accept</a>() ) ); - <a href="qobject.html#connect">connect</a>( cancelPushButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), this, SLOT( <a href="qdialog.html#reject">reject</a>() ) ); + <a href="ntqobject.html#connect">connect</a>( colorPushButton, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( setColor() ) ); + <a href="ntqobject.html#connect">connect</a>( okPushButton, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( <a href="ntqdialog.html#accept">accept</a>() ) ); + <a href="ntqobject.html#connect">connect</a>( cancelPushButton, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( <a href="ntqdialog.html#reject">reject</a>() ) ); TQPixmap patterns[MAX_PATTERNS]; patterns[0] = TQPixmap( pattern01 ); @@ -142,35 +142,35 @@ const int MAX_PATTERNS = 14; patterns[12] = TQPixmap( pattern13 ); patterns[13] = TQPixmap( pattern14 ); - <a href="qrect.html">TQRect</a> rect = table-><a href="qtable.html#cellRect">cellRect</a>( 0, 1 ); - <a href="qpixmap.html">TQPixmap</a> pix( rect.<a href="qrect.html#width">width</a>(), rect.<a href="qrect.html#height">height</a>() ); + <a href="ntqrect.html">TQRect</a> rect = table-><a href="ntqtable.html#cellRect">cellRect</a>( 0, 1 ); + <a href="ntqpixmap.html">TQPixmap</a> pix( rect.<a href="ntqrect.html#width">width</a>(), rect.<a href="ntqrect.html#height">height</a>() ); for ( int i = 0; i < ChartForm::MAX_ELEMENTS; ++i ) { Element element = (*m_elements)[i]; if ( element.isValid() ) - table-><a href="qtable.html#setText">setText</a>( + table-><a href="ntqtable.html#setText">setText</a>( i, 0, TQString( "%1" ).arg( element.value(), 0, 'f', m_decimalPlaces ) ); - <a href="qcolor.html">TQColor</a> color = element.valueColor(); - pix.<a href="qpixmap.html#fill">fill</a>( color ); - table-><a href="qtable.html#setPixmap">setPixmap</a>( i, 1, pix ); - table-><a href="qtable.html#setText">setText</a>( i, 1, color.<a href="qcolor.html#name">name</a>() ); + <a href="ntqcolor.html">TQColor</a> color = element.valueColor(); + pix.<a href="ntqpixmap.html#fill">fill</a>( color ); + table-><a href="ntqtable.html#setPixmap">setPixmap</a>( i, 1, pix ); + table-><a href="ntqtable.html#setText">setText</a>( i, 1, color.<a href="ntqcolor.html#name">name</a>() ); - <a href="qcombobox.html">TQComboBox</a> *combobox = new <a href="qcombobox.html">TQComboBox</a>; + <a href="ntqcombobox.html">TQComboBox</a> *combobox = new <a href="ntqcombobox.html">TQComboBox</a>; for ( int j = 0; j < MAX_PATTERNS; ++j ) - combobox-><a href="qcombobox.html#insertItem">insertItem</a>( patterns[j] ); - combobox-><a href="qcombobox.html#setCurrentItem">setCurrentItem</a>( element.valuePattern() - 1 ); - table-><a href="qtable.html#setCellWidget">setCellWidget</a>( i, 2, combobox ); + combobox-><a href="ntqcombobox.html#insertItem">insertItem</a>( patterns[j] ); + combobox-><a href="ntqcombobox.html#setCurrentItem">setCurrentItem</a>( element.valuePattern() - 1 ); + table-><a href="ntqtable.html#setCellWidget">setCellWidget</a>( i, 2, combobox ); - table-><a href="qtable.html#setText">setText</a>( i, 3, element.label() ); + table-><a href="ntqtable.html#setText">setText</a>( i, 3, element.label() ); color = element.labelColor(); - pix.<a href="qpixmap.html#fill">fill</a>( color ); - table-><a href="qtable.html#setPixmap">setPixmap</a>( i, 4, pix ); - table-><a href="qtable.html#setText">setText</a>( i, 4, color.<a href="qcolor.html#name">name</a>() ); + pix.<a href="ntqpixmap.html#fill">fill</a>( color ); + table-><a href="ntqtable.html#setPixmap">setPixmap</a>( i, 4, pix ); + table-><a href="ntqtable.html#setText">setText</a>( i, 4, color.<a href="ntqcolor.html#name">name</a>() ); } } @@ -178,7 +178,7 @@ const int MAX_PATTERNS = 14; void <a name="f179"></a>SetDataForm::currentChanged( int, int col ) { - colorPushButton-><a href="qwidget.html#setEnabled">setEnabled</a>( col == 1 || col == 4 ); + colorPushButton-><a href="ntqwidget.html#setEnabled">setEnabled</a>( col == 1 || col == 4 ); } @@ -186,21 +186,21 @@ void <a name="f180"></a>SetDataForm::valueChanged( int row, int col ) { if ( col == 0 ) { bool ok; - double d = table-><a href="qtable.html#text">text</a>( row, col ).toDouble( &ok ); + double d = table-><a href="ntqtable.html#text">text</a>( row, col ).toDouble( &ok ); if ( ok && d > EPSILON ) - table-><a href="qtable.html#setText">setText</a>( + table-><a href="ntqtable.html#setText">setText</a>( row, col, TQString( "%1" ).arg( d, 0, 'f', m_decimalPlaces ) ); - else if ( !table-><a href="qtable.html#text">text</a>( row, col ).isEmpty() ) - table-><a href="qtable.html#setText">setText</a>( row, col, table-><a href="qtable.html#text">text</a>( row, col ) + "?" ); + else if ( !table-><a href="ntqtable.html#text">text</a>( row, col ).isEmpty() ) + table-><a href="ntqtable.html#setText">setText</a>( row, col, table-><a href="ntqtable.html#text">text</a>( row, col ) + "?" ); } } void <a name="f181"></a>SetDataForm::setColor() { - setColor( table-><a href="qtable.html#currentRow">currentRow</a>(), table-><a href="qtable.html#currentColumn">currentColumn</a>() ); - table-><a href="qwidget.html#setFocus">setFocus</a>(); + setColor( table-><a href="ntqtable.html#currentRow">currentRow</a>(), table-><a href="ntqtable.html#currentColumn">currentColumn</a>() ); + table-><a href="ntqwidget.html#setFocus">setFocus</a>(); } @@ -209,36 +209,36 @@ void SetDataForm::setColor( int row, int col ) if ( !( col == 1 || col == 4 ) ) return; - <a href="qcolor.html">TQColor</a> color = TQColorDialog::<a href="qcolordialog.html#getColor">getColor</a>( - TQColor( table-><a href="qtable.html#text">text</a>( row, col ) ), + <a href="ntqcolor.html">TQColor</a> color = TQColorDialog::<a href="ntqcolordialog.html#getColor">getColor</a>( + TQColor( table-><a href="ntqtable.html#text">text</a>( row, col ) ), this, "color dialog" ); - if ( color.<a href="qcolor.html#isValid">isValid</a>() ) { - <a href="qpixmap.html">TQPixmap</a> pix = table-><a href="qtable.html#pixmap">pixmap</a>( row, col ); - pix.<a href="qpixmap.html#fill">fill</a>( color ); - table-><a href="qtable.html#setPixmap">setPixmap</a>( row, col, pix ); - table-><a href="qtable.html#setText">setText</a>( row, col, color.<a href="qcolor.html#name">name</a>() ); + if ( color.<a href="ntqcolor.html#isValid">isValid</a>() ) { + <a href="ntqpixmap.html">TQPixmap</a> pix = table-><a href="ntqtable.html#pixmap">pixmap</a>( row, col ); + pix.<a href="ntqpixmap.html#fill">fill</a>( color ); + table-><a href="ntqtable.html#setPixmap">setPixmap</a>( row, col, pix ); + table-><a href="ntqtable.html#setText">setText</a>( row, col, color.<a href="ntqcolor.html#name">name</a>() ); } } -void SetDataForm::<a href="qdialog.html#accept">accept</a>() +void SetDataForm::<a href="ntqdialog.html#accept">accept</a>() { bool ok; for ( int i = 0; i < ChartForm::MAX_ELEMENTS; ++i ) { Element &element = (*m_elements)[i]; - double d = table-><a href="qtable.html#text">text</a>( i, 0 ).toDouble( &ok ); + double d = table-><a href="ntqtable.html#text">text</a>( i, 0 ).toDouble( &ok ); if ( ok ) element.setValue( d ); else element.setValue( Element::INVALID ); - element.setValueColor( TQColor( table-><a href="qtable.html#text">text</a>( i, 1 ) ) ); + element.setValueColor( TQColor( table-><a href="ntqtable.html#text">text</a>( i, 1 ) ) ); element.setValuePattern( - ((TQComboBox*)table-><a href="qtable.html#cellWidget">cellWidget</a>( i, 2 ))->currentItem() + 1 ); - element.setLabel( table-><a href="qtable.html#text">text</a>( i, 3 ) ); - element.setLabelColor( TQColor( table-><a href="qtable.html#text">text</a>( i, 4 ) ) ); + ((TQComboBox*)table-><a href="ntqtable.html#cellWidget">cellWidget</a>( i, 2 ))->currentItem() + 1 ); + element.setLabel( table-><a href="ntqtable.html#text">text</a>( i, 3 ) ); + element.setLabelColor( TQColor( table-><a href="ntqtable.html#text">text</a>( i, 4 ) ) ); } - TQDialog::<a href="qdialog.html#accept">accept</a>(); + TQDialog::<a href="ntqdialog.html#accept">accept</a>(); } </pre><!-- eof --> <p><address><hr><div align=center> |