ReactOS  0.4.14-dev-50-g13bb5e2
CScrollboxWindow Class Reference

#include <scrollbox.h>

Inheritance diagram for CScrollboxWindow:
Collaboration diagram for CScrollboxWindow:

Public Member Functions

LRESULT OnSize (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnHScroll (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnVScroll (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonDown (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 

Detailed Description

Definition at line 11 of file scrollbox.h.

Member Function Documentation

◆ OnHScroll()

LRESULT CScrollboxWindow::OnHScroll ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 106 of file scrollbox.cpp.

107 {
108  if (m_hWnd == scrollboxWindow.m_hWnd)
109  {
110  SCROLLINFO si;
111  si.cbSize = sizeof(SCROLLINFO);
112  si.fMask = SIF_ALL;
113  scrollboxWindow.GetScrollInfo(SB_HORZ, &si);
114  switch (LOWORD(wParam))
115  {
116  case SB_THUMBTRACK:
117  case SB_THUMBPOSITION:
118  si.nPos = HIWORD(wParam);
119  break;
120  case SB_LINELEFT:
121  si.nPos -= 5;
122  break;
123  case SB_LINERIGHT:
124  si.nPos += 5;
125  break;
126  case SB_PAGELEFT:
127  si.nPos -= si.nPage;
128  break;
129  case SB_PAGERIGHT:
130  si.nPos += si.nPage;
131  break;
132  }
133  scrollboxWindow.SetScrollInfo(SB_HORZ, &si);
134  scrlClientWindow.MoveWindow(-scrollboxWindow.GetScrollPos(SB_HORZ),
135  -scrollboxWindow.GetScrollPos(SB_VERT), imageModel.GetWidth() * toolsModel.GetZoom() / 1000 + 6,
136  imageModel.GetHeight() * toolsModel.GetZoom() / 1000 + 6, TRUE);
137  }
138  return 0;
139 }
ToolsModel toolsModel
Definition: main.cpp:18
#define TRUE
Definition: types.h:120
#define SB_VERT
Definition: winuser.h:553
#define SB_HORZ
Definition: winuser.h:552
WPARAM wParam
Definition: combotst.c:138
int GetZoom()
Definition: toolsmodel.cpp:104
#define SB_THUMBPOSITION
Definition: winuser.h:572
struct tagSCROLLINFO SCROLLINFO
CScrollboxWindow scrlClientWindow
Definition: main.cpp:69
#define SB_THUMBTRACK
Definition: winuser.h:573
int GetWidth()
Definition: history.cpp:195
int GetHeight()
Definition: history.cpp:200
#define SB_PAGELEFT
Definition: winuser.h:570
ImageModel imageModel
Definition: main.cpp:32
#define SB_LINERIGHT
Definition: winuser.h:567
#define SB_PAGERIGHT
Definition: winuser.h:571
CScrollboxWindow scrollboxWindow
Definition: main.cpp:68
#define HIWORD(l)
Definition: typedefs.h:246
#define SB_LINELEFT
Definition: winuser.h:566
#define LOWORD(l)
Definition: pedump.c:82
#define SIF_ALL
Definition: winuser.h:1218

◆ OnLButtonDown()

LRESULT CScrollboxWindow::OnLButtonDown ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 176 of file scrollbox.cpp.

177 {
178  selectionWindow.ShowWindow(SW_HIDE);
179  pointSP = 0; // resets the point-buffer of the polygon and bezier functions
180  return 0;
181 }
#define SW_HIDE
Definition: winuser.h:762
short pointSP
Definition: mouse.cpp:53
CSelectionWindow selectionWindow
Definition: main.cpp:70

◆ OnSize()

LRESULT CScrollboxWindow::OnSize ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 97 of file scrollbox.cpp.

98 {
99  if (m_hWnd == scrollboxWindow.m_hWnd)
100  {
101  UpdateScrollbox();
102  }
103  return 0;
104 }
CScrollboxWindow scrollboxWindow
Definition: main.cpp:68
void UpdateScrollbox()
Definition: scrollbox.cpp:53

◆ OnVScroll()

LRESULT CScrollboxWindow::OnVScroll ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 141 of file scrollbox.cpp.

142 {
143  if (m_hWnd == scrollboxWindow.m_hWnd)
144  {
145  SCROLLINFO si;
146  si.cbSize = sizeof(SCROLLINFO);
147  si.fMask = SIF_ALL;
148  scrollboxWindow.GetScrollInfo(SB_VERT, &si);
149  switch (LOWORD(wParam))
150  {
151  case SB_THUMBTRACK:
152  case SB_THUMBPOSITION:
153  si.nPos = HIWORD(wParam);
154  break;
155  case SB_LINEUP:
156  si.nPos -= 5;
157  break;
158  case SB_LINEDOWN:
159  si.nPos += 5;
160  break;
161  case SB_PAGEUP:
162  si.nPos -= si.nPage;
163  break;
164  case SB_PAGEDOWN:
165  si.nPos += si.nPage;
166  break;
167  }
168  scrollboxWindow.SetScrollInfo(SB_VERT, &si);
169  scrlClientWindow.MoveWindow(-scrollboxWindow.GetScrollPos(SB_HORZ),
170  -scrollboxWindow.GetScrollPos(SB_VERT), imageModel.GetWidth() * toolsModel.GetZoom() / 1000 + 6,
171  imageModel.GetHeight() * toolsModel.GetZoom() / 1000 + 6, TRUE);
172  }
173  return 0;
174 }
#define SB_PAGEDOWN
Definition: winuser.h:569
ToolsModel toolsModel
Definition: main.cpp:18
#define SB_PAGEUP
Definition: winuser.h:568
#define TRUE
Definition: types.h:120
#define SB_VERT
Definition: winuser.h:553
#define SB_HORZ
Definition: winuser.h:552
WPARAM wParam
Definition: combotst.c:138
int GetZoom()
Definition: toolsmodel.cpp:104
#define SB_THUMBPOSITION
Definition: winuser.h:572
struct tagSCROLLINFO SCROLLINFO
CScrollboxWindow scrlClientWindow
Definition: main.cpp:69
#define SB_THUMBTRACK
Definition: winuser.h:573
int GetWidth()
Definition: history.cpp:195
int GetHeight()
Definition: history.cpp:200
ImageModel imageModel
Definition: main.cpp:32
#define SB_LINEDOWN
Definition: winuser.h:565
#define SB_LINEUP
Definition: winuser.h:564
CScrollboxWindow scrollboxWindow
Definition: main.cpp:68
#define HIWORD(l)
Definition: typedefs.h:246
#define LOWORD(l)
Definition: pedump.c:82
#define SIF_ALL
Definition: winuser.h:1218

The documentation for this class was generated from the following files: