OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
fscroll.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1998 by Yura Bidus, All Rights Reserved
4//
5/// \file
6/// Definition of class TFlatScroller.
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_FSCROLL_H)
10#define OWL_FSCROLL_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/scroller.h>
18#include <owl/commctrl.h>
19
20namespace owl {
21
22#include <owl/preclass.h>
23
24/// \addtogroup newctrl
25/// @{
26/// \class TFlatScroller
27// ~~~~~ ~~~~~~~~~~~~~
28/// Class TFlatScroller implements the actual scroller object. All functions
29/// are inline or virtual to avoid pulling in code when no scrollers have
30/// been constructed.
31//
33 public:
34 TFlatScroller(TWindow* window,
35 int xUnit, int yUnit,
36 long xRange, long yRange);
37 virtual ~TFlatScroller();
38
39 virtual void SetWindow(TWindow* win);
40 virtual bool EnableScrollBar(uint flags=SB_BOTH, uint arrow=ESB_ENABLE_BOTH);
41 virtual void ShowScrollBar(int code, bool show=true);
42
43 void EnableFlatStyle(bool enable=true);
44 bool GetScrollProp(uint index, int& value);
45 bool SetScrollProp(uint index, int value, bool redraw = true);
46
47 protected:
48 virtual void SetScrollPage(int bar, int page, bool redraw = true);
49 virtual int GetScrollPage(int bar) const;
50 virtual void GetScrollRange(int bar, int& minPos, int& maxPos) const;
51 virtual void SetScrollRange(int bar, int minPos, int maxPos, bool redraw = true);
52 virtual int GetScrollPos(int bar) const;
53 virtual int SetScrollPos(int bar, int pos, bool redraw = true);
54 virtual int GetScrollTrackPos(int bar) const;
55
57};
58/// @}
59
61
62#include <owl/posclass.h>
63
64
65//----------------------------------------------------------------------------
66// Inline implementations
67//
68
69//
71{
73 EnableFlatStyle(true);
74}
75
76//
78{
79 if(Window->GetHandle()){
80 if(enable)
82 else
84 }
85}
86
87//
88inline bool TFlatScroller::GetScrollProp(uint index, int& value)
89{
91 return FlatSB_GetScrollProp(*Window, index, &value);
92}
93
94//
95inline bool TFlatScroller::SetScrollProp(uint index, int value, bool redraw)
96{
98 return FlatSB_SetScrollProp(*Window, index, value, redraw);
99}
100
101//
107
108//
114
115////////////////////////////////////////////////////////////////////////////////
116
117} // OWL namespace
118
119
120#endif // OWL_SCROLLER_H
#define PRECONDITION(condition)
Definition checks.h:227
Class TFlatScroller implements the actual scroller object.
Definition fscroll.h:32
virtual void ShowScrollBar(int code, bool show=true)
Definition fscroll.h:109
virtual bool EnableScrollBar(uint flags=SB_BOTH, uint arrow=ESB_ENABLE_BOTH)
Definition fscroll.h:102
void EnableFlatStyle(bool enable=true)
Definition fscroll.h:77
virtual void SetWindow(TWindow *win)
Definition fscroll.h:70
bool GetScrollProp(uint index, int &value)
Definition fscroll.h:88
bool SetScrollProp(uint index, int value, bool redraw=true)
Definition fscroll.h:95
Class TScroller implements the actual scroller object.
Definition scroller.h:46
virtual void SetWindow(TWindow *win)
Sets the owning window to win.
Definition scroller.h:126
TWindow * Window
Points to the window whose client area scroller is to be managed.
Definition scroller.h:91
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
HWND GetHandle() const
Returns the handle of the window.
Definition window.h:2020
Definition of classes for CommonControl encapsulation.
#define DECLARE_STREAMABLE_OWL(cls, ver)
Definition objstrm.h:1529
#define DECLARE_STREAMABLE_INLINES(cls)
Definition objstrm.h:1538
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
unsigned int uint
Definition number.h:25
#define _OWLCLASS
Definition defs.h:338
Definition of class TScroller.