GteMSWWindow.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
11 #include <Windows.h>
12 
13 namespace gte
14 {
15 
17 {
18 public:
20  {
21  Parameters();
22 
23  Parameters(std::wstring const& inTitle,
24  int inXOrigin, int inYOrigin, int inXSize, int inYSize);
25 
26  HWND handle;
27  bool hscrollBar, vscrollBar;
28  };
29 
30 protected:
31  // Abstract base class. Only WindowSystem may create windows.
32  MSWWindow(Parameters& parameters);
33 public:
34  virtual ~MSWWindow();
35 
36  // Member access.
37  inline HWND GetHandle() const;
38  virtual void SetTitle(std::wstring const& title) override;
39 
40  // Mouse position information.
41  virtual void SetMousePosition(int x, int y) override;
42  virtual void GetMousePosition(int& x, int& y) const override;
43 
44  // Actions to take before the window closes.
45  virtual void OnClose() override;
46 
47  // Scroll support. The 'bar' value is 0 for horizontal scroll bars or 1
48  // for vertical scroll bars.
49  void SetScrollInterval(int bar, int minValue, int maxValue);
50  void GetScrollInterval(int bar, int& minValue, int& maxValue) const;
51  int SetScrollPosition(int bar, int value);
52  int GetScrollPosition(int bar) const;
53 
54  // The return value of the increment/decrement functions is the delta of
55  // the slider thumb. If zero, the scroll state did not change. For the
56  // tracking functions, the return value is the current slider thumb
57  // position. A derived-class override must call the base-class function
58  // first.
59  int OnScrollIncrementLoRes(int bar);
60  int OnScrollDecrementLoRes(int bar);
61  int OnScrollIncrementHiRes(int bar);
62  int OnScrollDecrementHiRes(int bar);
63  int OnScrollTracking(int bar);
64  int OnScrollEndTracking(int bar);
65 
66 protected:
67  // Standard window information.
68  HWND mHandle;
69 
70  // Scroll bar support.
71  bool mHasScroll[2];
72  mutable SCROLLINFO mScrollInfo[2];
73  int mScrollLoResDelta[2];
74  int mScrollHiResDelta[2];
75 };
76 
77 
78 inline HWND MSWWindow::GetHandle() const
79 {
80  return mHandle;
81 }
82 
83 }
HWND GetHandle() const
Definition: GteMSWWindow.h:78
GLsizei const GLfloat * value
Definition: glcorearb.h:819
GLint GLenum GLint x
Definition: glcorearb.h:404
GLint y
Definition: glcorearb.h:98
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:01