OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
hotkey.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5//----------------------------------------------------------------------------
6#include <owl/pch.h>
7#include <owl/hotkey.h>
8#include <owl/system.h>
9
10namespace owl {
11
13
14//
15// Constructors for THotKey
16//
17/// Constructors for THotKey initialize data fields using parameters passed and
18/// default values. By default, a Hotkey control associated with the TColumnHeader
19/// will be visible upon creation and will have a border.
20//
22 int id,
23 int x, int y, int w, int h,
24 TModule* module)
25:
26 TControl(parent, id, nullptr, x, y, w, h, module)
27{
30}
31
32//
33/// Constructs a hot key control from resource.
34//
36 int resourceId,
37 TModule* module)
38:
39 TControl(parent, resourceId, module)
40{
42}
43
44//
45/// Constructs a hot key object to encapsulate (alias) an existing control.
46//
53
54//
55/// Return the class name for a hot key control
56//
61
62//
63/// Transfer a uint16 (the virtual key code) for the control.
64//
65uint
67{
68 if (!buffer && direction != tdSizeData) return 0;
69 if (direction == tdGetData)
70 *((uint16*)buffer) = GetHotKey();
71 else if (direction == tdSetData)
72 SetHotKey(*(static_cast<uint16*>(buffer)));
73
74 return sizeof(uint16);
75}
76
77//
78/// Returns the 16-bit virtual key code for the control.
79//
85
86//
87/// Sets the virtual key code and modifier flags for the hot key.
88/// See the Windows API for more details on VK_xxxx and modifier flags.
89//
90void
95
96//
97/// Sets the virtual key code and modifier flags for the hot key.
98//
99void
104
105//
106/// Sets the invalid key combinations for the hotkey control.
107//
108void
113
114} // OWL namespace
115/* ========================================================================== */
116
TControl unifies its derived control classes, such as TScrollBar, TControlGadget, and TButton.
Definition control.h:38
void SetRules(uint16 invalid, uint16 defFlag)
Set the invalid key combinations for this control.
Definition hotkey.cpp:109
uint Transfer(uint16 &key, TTransferDirection direction)
Safe overload.
Definition hotkey.h:51
void SetHotKey(uint16 hotKey)
Sets the virtual key code and modifier flags for the hot key.
Definition hotkey.cpp:91
virtual auto GetWindowClassName() -> TWindowClassName
Return the class name for a hot key control.
Definition hotkey.cpp:57
uint16 GetHotKey()
Returns the 16-bit virtual key code for the control.
Definition hotkey.cpp:81
THotKey(TWindow *parent, int id, int x, int y, int w, int h, TModule *module=0)
Constructors for THotKey initialize data fields using parameters passed and default values.
Definition hotkey.cpp:21
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
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
bool ModifyStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
Definition window.cpp:3591
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
Definition window.cpp:3288
HWND THandle
TWindow encapsulates an HWND.
Definition window.h:418
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition window.h:92
@ tdSizeData
Return the size of data transferred by the class.
Definition window.h:95
@ tdSetData
Set data from the buffer into the window.
Definition window.h:94
@ tdGetData
Get data from the window into the buffer.
Definition window.h:93
Definition of class THotKey.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
void InitializeCommonControls(uint controlFlags)
Wrapper for the Windows API function InitCommmonControlsEx.
Definition commctrl.cpp:19
unsigned char uint8
Definition number.h:32
uint16 MkUint16(uint8 lo, uint8 hi)
Definition defs.h:258
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
uint16 LoUint16(LRESULT r)
Definition defs.h:264
TParam2 MkParam2(const T1 &lo, const T2 &hi)
Definition dispatch.h:65
OWL_DIAGINFO
Definition animctrl.cpp:14
unsigned short uint16
Definition number.h:33
unsigned int uint
Definition number.h:25
Definition of TSystem, a system information provider class.