OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
updown.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Implementation of the TUpDown class
7//----------------------------------------------------------------------------
8#include <owl/pch.h>
9#include <owl/defs.h>
10#include <owl/updown.h>
11#include <owl/gdiobjec.h>
12#include <owl/uihelper.h>
13#include <stdio.h>
14
15namespace owl {
16
18DIAG_DECLARE_GROUP(OwlCommCtrl); // Common Controls diagnostic group
19
20//
21// Constants used when ObjectWindows provides the underlying implementation of
22// the Up-down control...
23//
24const uint UpDownTimerID1 = 0x1000; // Initial timer (for startup delay)
25const uint UpDownTimerID2 = 0x1001; // Regular timer (for notifications)
26const uint InitDelay = 500; // Initial delay before notifying
27const uint RepeatDelay = 50; // Interval between notifications
28
33
34//
35/// Constructor of UpDown control.
36//
37TUpDown::TUpDown(TWindow* parent, int id, int x, int y, int w, int h,
38 TWindow* buddy, TModule* module)
39:
40 TControl(parent, id, _T(""), x, y, w, h, module),
41 Buddy(buddy),
42 Lower(0),
43 Upper(100),
44 Pos(0)
45{
47 Attr.Style = WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP;
48 DisableTransfer(); // No transfer implemented for this control; data resides in buddy.
49}
50
51//
52/// Constructor to an alias of an up-down control that is part of a dialog resource.
53//
55:
56 TControl(parent, resourceId, module),
57 Buddy(buddy),
58 Lower(0),
59 Upper(100),
60 Pos(0)
61{
63 DisableTransfer(); // No transfer implemented for this control; data resides in buddy.
64}
65
66//
67/// Returns the ClassName of the underlying control.
68/// \note The name returned depends upon whether you're using an operating system
69/// which provides the underlying implementation of UPDOWN controls. Also, when
70/// emulating, we choose to return a distinct class name. Although this is not
71/// strictly necessary with ObjectWindows, it facilitates the debugging process.
72//
77
78//
79/// Overriden to invoke the OS' 'CreateUpDownControl' method on systems that use the
80/// native implementation of UPDOWN controls.
81//
84{
87 Attr.Style,
88 Attr.X, Attr.Y, Attr.W, Attr.H,
89 Parent ? Parent->GetHandle() : nullptr,
90 Attr.Id,
91 *GetModule(),
92 Buddy ? Buddy->GetHandle() : nullptr,
93 Upper, Lower, Pos
94 );
95}
96
97//
98/// Keeps TWindow from rerouting these. Must be left as is for updown control.
99//
100void
105
106//
107/// Keeps TWindow from rerouting these; must be left as is for updown control.
108//
109void
114
115
116
117} // OWL namespace
118/* ========================================================================== */
119
#define PRECONDITION(condition)
Definition checks.h:227
#define DIAG_DECLARE_GROUP(group)
Definition checks.h:404
TControl unifies its derived control classes, such as TScrollBar, TControlGadget, and TButton.
Definition control.h:38
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
TUpDown encapsulates an up-down control, which is a window with a pair of arrow buttons that the user...
Definition updown.h:40
void EvVScroll(uint, uint, HWND)
Keeps TWindow from rerouting these. Must be left as is for updown control.
Definition updown.cpp:101
auto GetWindowClassName() -> TWindowClassName override
Returns the ClassName of the underlying control.
Definition updown.cpp:73
TUpDown(TWindow *parent, int id, int x, int y, int w, int h, TWindow *buddy=0, TModule *module=0)
Constructor of UpDown control.
Definition updown.cpp:37
void EvHScroll(uint, uint, HWND)
Keeps TWindow from rerouting these; must be left as is for updown control.
Definition updown.cpp:110
auto PerformCreate() -> THandle override
Overriden to invoke the OS' 'CreateUpDownControl' method on systems that use the native implementatio...
Definition updown.cpp:83
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
Definition module.h:47
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
TModule * GetModule() const
Returns a pointer to the module object.
Definition window.h:1841
void DisableTransfer()
Disables (for the interface object) the transfer mechanism, which allows state data to be transferred...
Definition window.h:1835
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
Definition window.cpp:852
HWND THandle
TWindow encapsulates an HWND.
Definition window.h:418
HWND GetHandle() const
Returns the handle of the window.
Definition window.h:2020
#define _T(x)
Definition cygwin.h:51
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition eventhan.h:492
Definition of abstract GDI object class and derived classes.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
void InitializeCommonControls(uint controlFlags)
Wrapper for the Windows API function InitCommmonControlsEx.
Definition commctrl.cpp:19
const uint UpDownTimerID1
Definition updown.cpp:24
EV_WM_HSCROLL
Definition notetab.cpp:55
const uint RepeatDelay
Definition updown.cpp:27
OWL_DIAGINFO
Definition animctrl.cpp:14
END_RESPONSE_TABLE
Definition button.cpp:26
const uint InitDelay
Definition updown.cpp:26
const uint UpDownTimerID2
Definition updown.cpp:25
EV_WM_VSCROLL
Definition scrollba.cpp:18
unsigned int uint
Definition number.h:25
General definitions used by all ObjectWindows programs.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
Definition of class TUpDown.