OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
hotkey.h
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
/// Definition of class THotKey
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_HOTKEY_H)
10
#define OWL_HOTKEY_H
11
12
#include <
owl/private/defs.h
>
13
#if defined(BI_HAS_PRAGMA_ONCE)
14
# pragma once
15
#endif
16
17
#include <
owl/commctrl.h
>
18
19
20
namespace
owl
{
21
22
#include <
owl/preclass.h
>
23
24
/// \addtogroup commctrl
25
/// @{
26
/// \class THotKey
27
// ~~~~~ ~~~~~~~
28
/// THotKey encapsulates the hot-key control, a window that allows the user to
29
/// enter a combination of keystrokes to be used as a a hot key.
30
/// [A hot key is a key combination that the user can press to perform an
31
/// action quickly].
32
//
33
class
_OWLCLASS
THotKey
:
public
TControl
{
34
public
:
35
THotKey
(
TWindow
* parent,
int
id
,
int
x,
int
y,
int
w,
int
h,
TModule
* module = 0);
36
THotKey
(
TWindow
* parent,
int
resourceId,
TModule
* module = 0);
37
THotKey
(
THandle
hWnd,
TModule
* module = 0);
38
39
// Set and retrieve the hot key virtual code.
40
//
41
uint16
GetHotKey
();
42
void
SetHotKey
(
uint16
hotKey);
43
void
SetHotKey
(
uint8
vk,
uint8
mods);
44
45
/// Set the invalid key combinations for this control
46
//
47
void
SetRules
(
uint16
invalid,
uint16
defFlag);
48
49
/// Safe overload
50
//
51
uint
Transfer
(
uint16
& key,
TTransferDirection
direction) {
return
Transfer
(&key, direction);}
52
53
protected
:
54
55
// Override TWindow virtual member functions
56
//
57
uint
Transfer(
void
* buffer,
TTransferDirection
direction);
58
virtual
auto
GetWindowClassName() ->
TWindowClassName
;
59
60
private
:
61
// Hidden to prevent accidental copying or assignment
62
//
63
THotKey
(
const
THotKey
&);
64
THotKey
& operator =(
const
THotKey
&);
65
66
};
67
68
/// @}
69
70
#include <
owl/posclass.h
>
71
72
73
}
// OWL namespace
74
75
76
#endif
// OWL_HOTKEY_H
owl::TControl::TControl
TControl(TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, TModule *module=nullptr)
Invokes TWindow's constructor, passing it parent (parent window), title (caption text),...
Definition
control.cpp:43
owl::THotKey
THotKey encapsulates the hot-key control, a window that allows the user to enter a combination of key...
Definition
hotkey.h:33
owl::THotKey::SetRules
void SetRules(uint16 invalid, uint16 defFlag)
Set the invalid key combinations for this control.
Definition
hotkey.cpp:109
owl::THotKey::Transfer
uint Transfer(uint16 &key, TTransferDirection direction)
Safe overload.
Definition
hotkey.h:51
owl::THotKey::SetHotKey
void SetHotKey(uint16 hotKey)
Sets the virtual key code and modifier flags for the hot key.
Definition
hotkey.cpp:91
owl::THotKey::GetHotKey
uint16 GetHotKey()
Returns the 16-bit virtual key code for the control.
Definition
hotkey.cpp:81
owl::THotKey::THotKey
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
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
owl::TWindowClassName
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
Definition
module.h:50
owl::TWindow
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition
window.h:414
owl::TWindow::THandle
HWND THandle
TWindow encapsulates an HWND.
Definition
window.h:418
commctrl.h
Definition of classes for CommonControl encapsulation.
owl::TTransferDirection
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition
window.h:92
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::uint8
unsigned char uint8
Definition
number.h:32
owl::uint16
unsigned short uint16
Definition
number.h:33
owl::uint
unsigned int uint
Definition
number.h:25
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
hotkey.h
Generated by
1.18.0