src/NavigatorTab.h

Go to the documentation of this file.
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 NAVIGATORTAB_HPP
00023 #define NAVIGATORTAB_HPP
00024 
00025 #include <qpopupmenu.h>
00026 #include <qwidgetstack.h>
00027 #include <qwidget.h>
00028 #include <qbuttongroup.h>
00029 #include <qmainwindow.h>
00030 
00031 class NavigatorTab : public QWidget
00032 {
00033   Q_OBJECT
00034 
00035   signals:
00036     void signalPositionChanged (int);
00037     void signaVisibilityChanged (bool);
00038   
00039   public:
00040   
00041     enum HotKey
00042     {
00043       ChartPanelFocus,
00044       GroupPanelFocus,
00045       IndicatorPanelFocus,
00046       PortfolioPanelFocus,
00047       TestPanelFocus,
00048       ScannerPanelFocus
00049     };
00050   
00051     NavigatorTab (QWidget *, QMainWindow *);
00052     ~NavigatorTab ();
00053     void loadSettings();
00054     void saveSettings();
00055     int getPosition ();
00056     void addWidget (QWidget *w, int);
00057     void init ();
00058 
00059   public slots:
00060     void togglePosition (int);
00061     void buttonPressed (int);
00062     void pressButton (int);
00063     void doKeyPress (QKeyEvent *);
00064     void slotAccel (int);
00065     void recentTab (QString);
00066 
00067   protected:
00068     virtual void contextMenuEvent (QContextMenuEvent *);
00069     
00070   protected slots:  
00071     void slotTglPosAboutToShow(); 
00072   
00073   private:
00074     int position;
00075     QPopupMenu *menu;
00076     QPopupMenu *positionMenu;
00077     int idMenuLeft;
00078     int idMenuRight;
00079     QWidgetStack *stack;
00080     QButtonGroup *bg;
00081     int activeButton;
00082     bool isVisible;
00083 };
00084 
00085 #endif