00001 /* 00002 * Qtstalker stock charter 00003 * 00004 * Copyright (C) 2001-2007 Stefan S. Stratigakos 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00019 * USA. 00020 */ 00021 00022 #ifndef CHARTTOOLBAR_HPP 00023 #define CHARTTOOLBAR_HPP 00024 00025 #include <qstring.h> 00026 #include <qtoolbar.h> 00027 #include <qmainwindow.h> 00028 #include <qcombobox.h> 00029 #include <qspinbox.h> 00030 #include <qlineedit.h> 00031 #include <qslider.h> 00032 #include <qtoolbutton.h> 00033 #include <qdatetime.h> 00034 00035 #include "RcFile.h" 00036 00037 class ChartToolbar : public QToolBar 00038 { 00039 Q_OBJECT 00040 00041 signals: 00042 void signalBarLengthChanged (int); 00043 void signalPixelspaceChanged (int); 00044 void signalSliderChanged (int); 00045 void signalBarsChanged (int); 00046 void signalPaperTradeNextBar (); 00047 00048 public: 00049 00050 enum MenuAction 00051 { 00052 ToolbarFocus, 00053 BarLengthFocus, 00054 BarSpacingFocus, 00055 BarsLoadedFocus, 00056 ChartPannerFocus 00057 }; 00058 00059 ChartToolbar(QMainWindow *); 00060 ~ChartToolbar(); 00061 int getBars (); 00062 void enableSlider (bool); 00063 void setPixelspace (int, int); 00064 int getPixelspace (); 00065 int getBarLengthInt (); 00066 QString getBarLength (); 00067 int getSlider (); 00068 int setSliderStart (int width, int records); 00069 void saveSettings (); 00070 void getPaperTradeDate (QDateTime &); 00071 00072 00073 public slots: 00074 void setFocus (); 00075 void slotAccel (int); 00076 void doKeyPress (QKeyEvent *); 00077 void barsChanged (); 00078 void paperTradeDate (); 00079 void paperTradeNextBar (); 00080 void paperTradeClicked (bool); 00081 void ps1ButtonClicked (); 00082 void ps2ButtonClicked (); 00083 void ps3ButtonClicked (); 00084 void cmpsBtnMClicked(); 00085 void cmpsBtnWClicked(); 00086 void cmpsBtnDClicked(); 00087 void cmpsBtn15Clicked(); 00088 void slotSetButtonView (); 00089 00090 private: 00091 QComboBox *compressionCombo; 00092 QSpinBox *pixelspace; 00093 QLineEdit *barCount; 00094 QSlider *slider; 00095 MenuAction focusFlag; 00096 QToolButton *ptdButton; 00097 QToolButton *ptnButton; 00098 QDateTime ptDate; 00099 QStringList compressionList; 00100 QToolButton *cmpsBtnM; 00101 QToolButton *cmpsBtnW; 00102 QToolButton *cmpsBtnD; 00103 QToolButton *cmpsBtn15; 00104 QToolButton *ps1Button; 00105 QToolButton *ps2Button; 00106 QToolButton *ps3Button; 00107 00108 int minPixelspace; 00109 RcFile rcfile; 00110 00111 private slots: 00112 void slotOrientationChanged(Orientation); 00113 void barsChangedValidate (); 00114 }; 00115 00116 #endif