Crazy Eddie's GUI System  ${CEGUI_VERSION}
SamplesBrowserManager.h
1 /***********************************************************************
2 created: 11/6/2012
3 author: Lukas E Meindl
4 *************************************************************************/
5 /***************************************************************************
6 * Copyright (C) 2004 - 2012 Paul D Turner & The CEGUI Development Team
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining
9 * a copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sublicense, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 ***************************************************************************/
27 #ifndef _SamplesBrowserManager_h_
28 #define _SamplesBrowserManager_h_
29 
30 #include <vector>
31 #include <map>
32 
33 #include "CEGUI/Base.h"
34 #include "CEGUI/String.h"
35 
36 #include "CEGUI/ForwardRefs.h"
37 
38 class SamplesFramework;
39 
41 {
42 public:
44  virtual ~SamplesBrowserManager() {}
45 
46  CEGUI::Window* getWindow();
47 
48  CEGUI::FrameWindow* createSampleWindow(const CEGUI::String& name, const CEGUI::Image& image);
49 
50  void setWindowRatio(float aspectRatio);
51 
52  void selectSampleWindow(CEGUI::Window* wnd);
53 
54 private:
56 
57  void init();
58  SamplesBrowserManager& operator=(const SamplesBrowserManager&) { return *this; }
59 
60  static const CEGUI::uint32 d_sampleWindowFrameNormal;
61  static const CEGUI::uint32 d_sampleWindowFrameSelected;
62 
63  void updateWindows();
64 
65  bool handleMouseClickSampleWindow(const CEGUI::EventArgs& args);
66  bool handleMouseMoveSampleWindow(const CEGUI::EventArgs& args);
67  bool handleLeaveSampleWindow(const CEGUI::EventArgs& args);
68 
69  bool handleSampleEnterButtonClicked(const CEGUI::EventArgs& args);
70 
71  CEGUI::VerticalLayoutContainer* createPreviewLayoutContainer();
72  CEGUI::DefaultWindow* createPreviewHeaderNameWindow(const CEGUI::String& name);
73  CEGUI::FrameWindow* createPreviewSampleWindow(const CEGUI::String& name, const CEGUI::Image &image);
74  CEGUI::PushButton* createPreviewHeaderEnterButton();
75  CEGUI::HorizontalLayoutContainer* createPreviewHeader();
76 
77  SamplesFramework* d_owner;
78 
79  CEGUI::Window* d_root;
80  CEGUI::VerticalLayoutContainer* d_verticalLayoutContainerSamples;
81  int d_childCount;
82  float d_aspectRatio;
83  CEGUI::Window* d_selectedWindow;
84 
85 
86  std::map<CEGUI::Window*, CEGUI::Window*> d_buttonToSampleWindowMap;
87 
88 
89  std::vector<CEGUI::Window*> d_sampleWindows;
90 };
91 
92 #endif
A Layout Container window layouting it&#39;s children vertically.
Definition: cegui/include/CEGUI/widgets/VerticalLayoutContainer.h:42
Interface for Image.
Definition: cegui/include/CEGUI/Image.h:158
Base class used as the argument to all subscribers Event object.
Definition: cegui/include/CEGUI/EventArgs.h:49
Window class intended to be used as a simple, generic Window.
Definition: cegui/include/CEGUI/widgets/DefaultWindow.h:50
This is.
Definition: SamplesFramework.h:48
Base class to provide logic for push button type widgets.
Definition: cegui/include/CEGUI/widgets/PushButton.h:47
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: cegui/include/CEGUI/Window.h:149
Abstract base class for a movable, sizable, window with a title-bar and a frame.
Definition: cegui/include/CEGUI/widgets/FrameWindow.h:48
A Layout Container window layouting it&#39;s children Horizontally.
Definition: cegui/include/CEGUI/widgets/HorizontalLayoutContainer.h:42
Definition: SamplesBrowserManager.h:40
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62