Win32MainWindow.h
Go to the documentation of this file.
1 // ****************************************************************************
2 // Filename: Win32MainWindow.h
3 // Author: Florian Hecht
4 // Date: 2008
5 // ****************************************************************************
6 
7 
8 #ifndef _WIN32_MAIN_WINDOW_H_
9 #define _WIN32_MAIN_WINDOW_H_
10 
11 
12 // ****************************************************************************
13 // Necessary includes
14 // ****************************************************************************
15 
17 
18 #include <windows.h>
19 #include <vector>
20 
21 
22 // ****************************************************************************
23 // Forward declarations
24 // ****************************************************************************
25 
26 struct Win32Widget;
27 
28 
29 
30 // ****************************************************************************
31 // CWin32MainWindow
32 // ****************************************************************************
33 
35 {
36 public:
37  CWin32MainWindow(int x, int y, int width, int height, const char *title);
39 
40  // create widgets
41  WIDGET_HANDLE AddImage(int x, int y, int width, int height, WIDGET_HANDLE parent = 0);
42  WIDGET_HANDLE AddButton(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
43  WIDGET_HANDLE AddLabel(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
44  WIDGET_HANDLE AddCheckBox(int x, int y, int width, int height, const char *text, bool checked, WIDGET_HANDLE parent = 0);
45  WIDGET_HANDLE AddTextEdit(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
46  WIDGET_HANDLE AddSlider(int x, int y, int width, int height, int min_value, int max_value, int step, int value, WIDGET_HANDLE parent = 0);
47  WIDGET_HANDLE AddComboBox(int x, int y, int width, int height, int num_entries, const char **entries, int current_entry, WIDGET_HANDLE parent = 0);
48  WIDGET_HANDLE AddGLWidget(int x, int y, int width, int height, WIDGET_HANDLE parent = 0);
49 
50  // access to widget attributes
51  bool GetText(WIDGET_HANDLE widget, char *text, int len);
52  bool SetText(WIDGET_HANDLE widget, const char *text);
53 
54  bool SetImage(WIDGET_HANDLE widget, const CByteImage *pImage);
55 
56  bool GetValue(WIDGET_HANDLE widget, int &value);
57  bool SetValue(WIDGET_HANDLE widget, int value);
58 
61 
62  // window control
63  void Show(WIDGET_HANDLE widget = 0);
64  void Hide(WIDGET_HANDLE widget = 0);
65 
66  void SetSize(int width, int height, WIDGET_HANDLE widget = 0);
67 
68  int GetModifierKeyState();
69 
71 
72 
73  LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
74 private:
75 
76  Win32Widget *FindWidget(HWND handle);
77 
78 
79  HINSTANCE m_hInstance;
80  HWND m_hWnd;
81  static int m_ref_count;
82  static int m_quit_count;
83  bool m_did_quit;
84 
86 
87  std::vector<Win32Widget*> m_widgets;
88 };
89 
90 
91 
92 #endif /* _WIN32_MAIN_WINDOW_H_ */
WIDGET_HANDLE AddTextEdit(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent=0)
bool SetImage(WIDGET_HANDLE widget, const CByteImage *pImage)
std::vector< Win32Widget * > m_widgets
WIDGET_HANDLE AddLabel(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent=0)
void SetEventCallback(CMainWindowEventInterface *callback)
Win32Widget * FindWidget(HWND handle)
CWin32MainWindow(int x, int y, int width, int height, const char *title)
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
Definition: ByteImage.h:80
WIDGET_HANDLE AddComboBox(int x, int y, int width, int height, int num_entries, const char **entries, int current_entry, WIDGET_HANDLE parent=0)
GLenum GLsizei len
Definition: glext.h:3940
bool GetText(WIDGET_HANDLE widget, char *text, int len)
void Hide(WIDGET_HANDLE widget=0)
LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
bool MakeCurrentGLWidget(WIDGET_HANDLE widget)
bool SetValue(WIDGET_HANDLE widget, int value)
GLenum GLint x
Definition: glext.h:3125
bool SetText(WIDGET_HANDLE widget, const char *text)
void * WIDGET_HANDLE
bool SwapBuffersGLWidget(WIDGET_HANDLE widget)
GLsizei const GLfloat * value
Definition: glext.h:3538
WIDGET_HANDLE AddCheckBox(int x, int y, int width, int height, const char *text, bool checked, WIDGET_HANDLE parent=0)
static int m_ref_count
Interface for the creation of GUIs with the GUI toolkit of the IVT.
CMainWindowEventInterface * m_event_callback
bool GetValue(WIDGET_HANDLE widget, int &value)
GLenum GLsizei width
Definition: glext.h:3122
GLenum GLsizei GLsizei height
Definition: glext.h:3132
HINSTANCE m_hInstance
WIDGET_HANDLE AddImage(int x, int y, int width, int height, WIDGET_HANDLE parent=0)
GLenum GLint GLint y
Definition: glext.h:3125
static int m_quit_count
void SetSize(int width, int height, WIDGET_HANDLE widget=0)
void Show(WIDGET_HANDLE widget=0)
WIDGET_HANDLE AddButton(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent=0)
Interface for the event mechanism of GUIs using the GUI toolkit of the IVT.
WIDGET_HANDLE AddSlider(int x, int y, int width, int height, int min_value, int max_value, int step, int value, WIDGET_HANDLE parent=0)
static void callback(IplImage *pIplImage)
WIDGET_HANDLE AddGLWidget(int x, int y, int width, int height, WIDGET_HANDLE parent=0)


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Mon Dec 2 2019 03:47:28