VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
autoHidePanel.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #if !defined(Q_MOC_RUN)
14 #include <vrvUtil/signalslib.h>
23 #include <vrvCoreQt/DtDockable.h>
24 #include <vrvCoreQt/DtMenuItem.h>
27 #endif
28 
29 #include <QtGui/QIcon>
30 #include <QtGui/QPixmap>
31 #include <QtWidgets/QWidget>
32 #include <QtWidgets/QDockWidget>
33 #include <QtWidgets/QPushButton>
34 #include <QtWidgets/QHeaderView>
35 #include <QtCore/QTimer>
36 #include <map>
37 
38 class QVBoxLayout;
39 
40 namespace makVrv
41 {
42  class DtDe;
43  class DtChannelManager;
44  class DtChannel;
45  class DtObserverObject;
46 }
47 
48 namespace makVrf
49 {
50  class DtAutoHidePanelItem;
51  class DtPropCreatePalette;
52  class DtEntityCreatePalette;
53  class DtTacticalGraphicCreatePalette;
54 
59  {
60 
61  Q_OBJECT
62 
63  public:
64 
66  DtAutoHideDockViewItem(makVrv::DtDe& de, const std::string& dockName, DtAutoHidePanelItem* item);
67 
69  virtual ~DtAutoHideDockViewItem();
70 
72  virtual QAction* createAction(makVrv::DtDe& de, QWidget* parent);
73 
74  protected:
75 
77  virtual void on_triggered();
78 
80  virtual void on_aboutToShow();
81 
82  protected:
83 
87  };
88 
94  {
95  Q_OBJECT
96 
97  public:
98 
101  DtAutoHidePanelItem(makVrv::DtDe& de, QWidget* parent, QString title, const std::string& className);
102 
104  virtual ~DtAutoHidePanelItem();
105 
107  DtAutoHideDock* dockToManage();
108  virtual void setDockToManage(DtAutoHideDock* widget);
109 
111  virtual const QIcon& icon() const;
112  virtual void setIcon(const QIcon& p);
113 
115  const std::string& className() const { return myClassName; };
116 
118  virtual QString iconText();
119  virtual void setIconText(const QString& s);
120 
123  virtual bool toggled() const;
124  virtual void setToggled(bool flag);
125 
127  virtual void setSelected(bool flag);
128 
131  virtual void setAvailable(bool visible, bool updateVisibilityState = true);
132  virtual bool available() const;
133 
135  virtual void setAboutToBeShown(bool flag);
136 
139  virtual void refreshSize(int minsize=-1);
140 
142  virtual void setToggle(bool flag);
143 
144  protected:
145 
147  virtual void enterEvent(QEvent* e);
148 
150  virtual void leaveEvent(QEvent *);
151 
153  virtual void mouseReleaseEvent( QMouseEvent * event );
154 
156  virtual void paintEvent(QPaintEvent* p);
157 
158  signals:
159 
161  void signal_enter(DtAutoHidePanelItem*);
162 
164  void signal_leave(DtAutoHidePanelItem*);
165 
168  void signal_toggled(DtAutoHidePanelItem*);
169 
172  void signal_clicked(DtAutoHidePanelItem*);
173 
175  void signal_availabilityChanged(DtAutoHidePanelItem*);
176 
177  protected:
178 
179  QIcon myIcon;
181  QString myIconText;
194  std::string myClassName;
195  };
196 
198  {
199  public:
201  virtual ~DtAutoHidePanelItemCreator();
202 
204  static DtAutoHidePanelItemCreator& instance(makVrv::DtDe&);
205 
207  static void registerInstance(makVrv::DtDe& de, DtAutoHidePanelItemCreator* instance);
208 
209  virtual DtAutoHidePanelItem* create(makVrv::DtDe&, QWidget* parent, const QString& title, const std::string& className);
210  };
211 
217  {
218  Q_OBJECT
219 
220  public:
221 
223  {
224  Hidden = 0,
227  Floating
228  };
229 
230  typedef std::list<DtAutoHidePanelItem*> DtAutoHidePanelItemList;
231  typedef DtAutoHidePanelItemList::iterator DtAutoHidePanelItemListIterator;
232 
233  typedef std::list<DtAutoHideDock*> DtAutoHideDockList;
234  typedef DtAutoHideDockList::iterator DtAutoHideDockListIterator;
235 
236  typedef std::map<std::string, DtAppearanceOptions> DtAppearanceList;
237  typedef std::map<std::string, DtAppearanceOptions>::iterator DtAppearanceListIterator;
238 
239  public:
240 
241  DtAutoHidePanel(makVrv::DtDe& de, const std::string& name, makVrv::DtQtDeMainWindow* parent);
242 
243  virtual ~DtAutoHidePanel();
244 
248  virtual DtAutoHidePanelItem* addItem(DtAutoHideDock* dock, bool forceVisible=false, bool initiallVisible = true) ;
249 
251  virtual void clear();
252 
254  virtual DtAutoHidePanelItem* findItemForClass( const std::string& s );
255  virtual DtAutoHidePanelItem* findItemForDock( const DtAutoHideDock* dock );
256 
258  virtual void setPanelItemVisible(const std::string& panelClassName, bool, bool updateVisibilityState = false);
259 
262  virtual void hideAllDocks();
263 
265  virtual int itemCount();
266 
268  virtual void placeItems();
269 
271  virtual void removeItem(DtAutoHidePanelItem* item);
272 
274  virtual void showDockForItem( DtAutoHidePanelItem* item, bool animate=true);
275 
277  virtual void hideDockForItem( DtAutoHidePanelItem* item, bool animate=true);
278 
280  static DtAutoHidePanel* instance(makVrv::DtDe&);
281 
284  virtual std::vector< std::pair<DtString, QString> > panelsThatCanBeUsedOnCreateMenu() const;
285 
286  virtual void changeVisibility(bool);
287 
289  virtual bool findDock(DtAutoHideDock* dock);
290 
292 
295 
297  virtual void changeFloatingGeometry(int px, int py, int width, int height) {};
298 
301 
303  virtual void changeDockedGeometry(int px, int py, int width, int height) {};
304 
307 
309  virtual void selectPage(const std::string& pageClassName) {};
310 
311  const DtAutoHideDockList& docks() const
312  {
313  return myDocks;
314  }
315 
316  template <typename PaletteClass>
317  PaletteClass* createPalette()
318  {
319  DtAutoHideDockList::iterator iter = myDocks.begin();
320 
321  while (iter != myDocks.end())
322  {
323  PaletteClass* p = dynamic_cast<PaletteClass*>((*iter)->widget());
324 
325  if (p)
326  {
327  return p;
328  }
329 
330  ++iter;
331  }
332 
333  return 0;
334  }
335 
336  template <typename PaletteClass>
338  {
339  DtAutoHideDockList::iterator iter = myDocks.begin();
340 
341  while (iter != myDocks.end())
342  {
343  PaletteClass* p = dynamic_cast<PaletteClass*>((*iter)->widget());
344 
345  if (p)
346  {
347  return *iter;
348  }
349 
350  ++iter;
351  }
352 
353  return 0;
354  }
355 
358  {
359  return createPalette<DtEntityCreatePalette>();
360  }
361 
363  {
364  return creationDock<DtEntityCreatePalette>();
365  }
366 
369  {
370  return createPalette<DtTacticalGraphicCreatePalette>();
371  }
372 
374  {
375  return creationDock<DtTacticalGraphicCreatePalette>();
376  }
377 
380  {
381  return createPalette<DtPropCreatePalette>();
382  }
383 
385  {
386  return creationDock<DtPropCreatePalette>();
387  }
388 
391  virtual void setItemPinned( DtAutoHidePanelItem*, bool );
392 
393  protected:
394 
396  virtual void setupGui();
397 
399  virtual bool eventFilter(QObject* p, QEvent* e);
400 
402  virtual void installEventFilters();
403 
405  virtual int maxItemWidth();
406 
408  virtual void removeDock(DtAutoHideDock* dock);
409 
411  virtual void relocateAnyPinnedDock();
412 
414  virtual void refreshItems(int minsize);
415 
417  virtual void refreshAppearanceOfItem(DtAutoHidePanelItem* autoHideItemWidget, bool forceVisible);
418 
420  virtual void addPageToGui(makVrv::DtPage*);
421 
423  virtual void removePageFromGui(makVrv::DtPage*);
424 
426  virtual void selectPageInGui(makVrv::DtPage* page) {};
427 
428  protected slots:
429 
432  virtual void slot_onItemToggled(DtAutoHidePanelItem*);
433 
436  virtual void slot_onItemClicked(DtAutoHidePanelItem*);
437 
439  virtual void slot_dockClosed(DtAutoHideDock* dockWidget);
440 
442  virtual void slot_dockEntered(DtAutoHideDock* dockWidget);
443 
445  virtual void slot_dockLeft(DtAutoHideDock* dockWidget);
446 
448  virtual void slot_dockResized(DtAutoHideDock* dockWidget);
449 
451  virtual void slot_dockDestroyed(DtAutoHideDock* dockWidget);
452 
454  virtual void slot_showDockOfCurrentItem(bool lockIt=false);
455 
457  virtual void slot_closeTimerTimeout();
458 
460  virtual void slot_onItemAvailabilityChanged(DtAutoHidePanelItem* dockWidget);
461 
462  virtual void slot_observerModeSettingChanged( makVrv::DtObserverObject*, int setting, bool value );
463  virtual void placeCompass();
464 
465  virtual void finalizeSetup();
466 
467  protected:
469  QWidget* myCentralWidget;
476  QTimer myTimer;
477  QTimer myCloseTimer;
478 
481  };
482 
485  {
486  public:
489 
491  virtual ~DtAutoHidePanelCreator();
492 
494  static DtAutoHidePanelCreator& instance(makVrv::DtDe&);
495 
497  static void registerInstance(makVrv::DtDe&, DtAutoHidePanelCreator*);
498 
500  virtual DtAutoHidePanel* create(const std::string& name, QWidget* parent);
501 
502  protected:
504  };
505 }
int myTopMargin
Definition: autoHidePanel.h:184
virtual DtAutoHideDock * tacticalGraphicCreationDock()
Definition: autoHidePanel.h:373
std::list< DtAutoHidePanelItem * > DtAutoHidePanelItemList
Definition: autoHidePanel.h:230
Definition: autoHidePanel.h:225
std::string myClassName
Definition: autoHidePanel.h:194
Contains makVrv::DtUserInterfaceAssembler class.
Builder for menu items.
Definition: DtMenuItem.h:23
The DtQtPageCollection is an abstract class which implements the page collection interface, and can be used extended by specific Qt implementations such as a tabbed panel or dialog.
Definition: DtQtPageCollection.h:23
DtAutoHideDock * creationDock()
Definition: autoHidePanel.h:337
DtAutoHideDockList myDocks
List with all the items currently on display.
Definition: autoHidePanel.h:471
Virtual base class.
Definition: DtVirtualBaseClass.h:19
QTimer myTimer
The item that wants to be closed.
Definition: autoHidePanel.h:476
Represents a new kind of dock widget: it has a &quot;pin&quot; button that allows the widget to pin/unpin from ...
Definition: autoHideDock.h:34
virtual DtAutoHideDock * propCreationDock()
Definition: autoHidePanel.h:384
A widget class for showing different items of supplied types to the logic tthat can be created...
Definition: entityCreatePalette.h:66
Contains makVrv::DtQtPageCollection class.
#define DT_DLL_VRFGUICOREQT
Definition: vrfGuiCoreQt.h:26
PageCollectionLocation
Definition: DtPageConfiguration.h:42
Definition: DtPageConfiguration.h:56
DtAutoHideDock * myCloseIfMousePressOutside
Definition: autoHidePanel.h:480
bool myIsToggleType
Definition: autoHidePanel.h:191
Represents a menu item associated with an autoHidePanelItem widget.
Definition: autoHidePanel.h:58
virtual void selectPageInGui(makVrv::DtPage *page)
Implement selecting a page in the GUI.
Definition: autoHidePanel.h:426
Represents an element of the autoHidePanel.
Definition: autoHidePanel.h:93
virtual DtPropCreatePalette * propCreatePalette()
Return the prop create palette.
Definition: autoHidePanel.h:379
This class implements the panel where auto hide dialogs are placed when they are hidden.
Definition: autoHidePanel.h:215
bool myIsSelected
Definition: autoHidePanel.h:187
QTimer myCloseTimer
Controls the 1 second delay before showing a dock.
Definition: autoHidePanel.h:477
virtual DtTacticalGraphicCreatePalette * tacticalGraphicCreatePalette()
Return the tactical graphic create palette.
Definition: autoHidePanel.h:368
QWidget * myCentralWidget
Definition: autoHidePanel.h:469
bool myAboutToBeShown
Definition: autoHidePanel.h:190
bool myIsToggled
Definition: autoHidePanel.h:188
virtual void changeFloatingGeometry(int px, int py, int width, int height)
Implement changing the floating geometry of the collection.
Definition: autoHidePanel.h:297
DtAutoHideDock * myAutoHideDock
Definition: autoHidePanel.h:189
int myRightMargin
Definition: autoHidePanel.h:183
QIcon myIcon
Definition: autoHidePanel.h:179
QString myIconText
Definition: autoHidePanel.h:181
Contains makVrv::DtVirtualBaseClass class.
std::map< std::string, DtAppearanceOptions >::iterator DtAppearanceListIterator
Definition: autoHidePanel.h:237
DtAutoHidePanelItem * myPanelItem
Definition: autoHidePanel.h:84
DtAutoHidePanelItem * myCurrentItem
Animates the display of a dock.
Definition: autoHidePanel.h:474
Contains makVrv::DtDockable class.
int myIconSize
Definition: autoHidePanel.h:180
Creator for the auto hide panel.
Definition: autoHidePanel.h:484
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners...
Definition: DtObserverObject.h:29
makVrv::DtDe & myDe
Definition: autoHidePanel.h:503
bool myIsAvailable
Definition: autoHidePanel.h:192
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
makVrv::DtDe & myDe
Definition: autoHidePanel.h:86
DtAutoHidePanelItemList::iterator DtAutoHidePanelItemListIterator
Definition: autoHidePanel.h:231
QAction * myAction
Definition: autoHidePanel.h:85
int myBottomMargin
Definition: autoHidePanel.h:185
The page is a single widget component which is viewed in a page collection.
Definition: DtPage.h:27
DtAutoHidePanelItemList myItems
Definition: autoHidePanel.h:470
const DtAutoHideDockList & docks() const
Definition: autoHidePanel.h:311
Definition: autoHidePanel.h:197
makVrv::DtSignalConnectionManager myConnections
Controls the 1 second delay before hiding a dock.
Definition: autoHidePanel.h:479
DtWidgetAnimator * myWidgetAnimator
Keeps track of the last appearance of the items (hidden, pinned, docked, floating) ...
Definition: autoHidePanel.h:473
DtAutoHideDockList::iterator DtAutoHideDockListIterator
Definition: autoHidePanel.h:234
Represents a widget that can animate the movement of other widgets.
Definition: widgetAnimator.h:54
makVrv::DtDe & myDe
Definition: autoHidePanel.h:193
std::list< DtAutoHideDock * > DtAutoHideDockList
Definition: autoHidePanel.h:233
Base class to provide boost signal/slot management.
A widget class for creating TacticalGraphic objects.
Definition: tacticalGraphicCreatePalette.h:20
virtual void changeDockedGeometry(const makVrv::DtPageConfiguration::PageCollectionGeometry &geometry)
Implement changing the docked geometry of the collection.
Definition: autoHidePanel.h:306
int mySpacing
Definition: autoHidePanel.h:186
virtual void changeLocation(makVrv::DtPageConfiguration::PageCollectionLocation)
No-op. Cannot change location or geometry.
Definition: autoHidePanel.h:294
virtual DtEntityCreatePalette * entityCreatePalette()
Return the entity create palette.
Definition: autoHidePanel.h:357
virtual void changeDockedGeometry(int px, int py, int width, int height)
Implement changing the docked geometry of the collection.
Definition: autoHidePanel.h:303
const std::string & className() const
Class name.
Definition: autoHidePanel.h:115
std::map< std::string, DtAppearanceOptions > DtAppearanceList
Definition: autoHidePanel.h:236
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
virtual void changeFloatingGeometry(const makVrv::DtPageConfiguration::PageCollectionGeometry &geometry)
Implement changing the floating geometry of the collection.
Definition: autoHidePanel.h:300
PaletteClass * createPalette()
Definition: autoHidePanel.h:317
QMainWindow * myMainWindow
Definition: autoHidePanel.h:468
virtual void selectPage(const std::string &pageClassName)
Implement selecting a page by name.
Definition: autoHidePanel.h:309
DtAppearanceOptions
Definition: autoHidePanel.h:222
Definition: autoHidePanel.h:226
The Qt main window.
Definition: DtQtDeMainWindow.h:40
int myLeftMargin
Definition: autoHidePanel.h:182
DtAppearanceList myItemsAppearance
List with all the docks registered with this panel.
Definition: autoHidePanel.h:472
DtAutoHidePanelItem * myDockToClose
Current item to be shown.
Definition: autoHidePanel.h:475
virtual DtAutoHideDock * entityCreationDock()
Definition: autoHidePanel.h:362
A widget class for managing different camera views the currently selected observer can be placed in...
Definition: propCreatePalette.h:39

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)