OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
inputdia.h
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows
3
// Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Definition of TInputDialog class
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_INPUTDIA_H)
10
#define OWL_INPUTDIA_H
11
12
#include <
owl/private/defs.h
>
13
#if defined(BI_HAS_PRAGMA_ONCE)
14
# pragma once
15
#endif
16
17
#include <
owl/dialog.h
>
18
#include <owl/inputdia.rh>
19
20
21
namespace
owl
{
22
23
#include <
owl/preclass.h
>
24
25
class
_OWLCLASS
TValidator
;
26
27
/// \addtogroup dlg
28
/// @{
29
/// \class TInputDialog
30
// ~~~~~ ~~~~~~~~~~~~
31
/// Provides a generic dialog box to retrieve text input by a user. When the input
32
/// dialog box is constructed, its title, prompt, and default input text are
33
/// specified. TInputDialog is a streamable class.
34
//
35
class
_OWLCLASS
TInputDialog
:
public
TDialog
{
36
public
:
37
TInputDialog
(
TWindow
* parent,
38
LPCTSTR title,
39
LPCTSTR prompt,
40
LPTSTR buffer,
41
int
bufferSize,
42
TModule
* module = 0,
43
TValidator
* valid = 0);
// Optional validator
44
45
TInputDialog
(
46
TWindow
* parent,
47
const
tstring
& title,
48
const
tstring
& prompt,
49
LPTSTR buffer,
50
int
bufferSize,
51
TModule
* module = 0,
52
TValidator
* valid = 0);
// Optional validator
53
54
TInputDialog
(
55
TWindow
* parent,
56
const
tstring
& title,
57
const
tstring
& prompt,
58
const
tstring
& initValue =
tstring
(),
59
TModule
* module = 0,
60
TValidator
* valid = 0);
61
62
~TInputDialog
();
63
64
// Override TWindow virtual member functions
65
//
66
void
TransferData
(
TTransferDirection
);
67
68
LPCTSTR
GetPrompt
()
const
;
69
LPCTSTR
GetBuffer
()
const
;
70
int
GetBufferSize
()
const
;
71
72
protected
:
73
// Override TWindow virtual member functions
74
//
75
void
SetupWindow
();
76
77
public_data
:
78
/// Points to the prompt for the input dialog box.
79
tchar
* Prompt;
80
81
/// Pointer to the buffer that returns the text retrieved from the user. When passed
82
/// to the constructor of the input dialog box, contains the default text to be
83
/// initially displayed in the edit control.
84
tchar
* Buffer;
85
86
/// Contains the size of the buffer that returns user input.
87
int
BufferSize;
88
89
private
:
90
91
bool
ShouldDelete;
92
93
// Hidden to prevent accidental copying or assignment
94
//
95
TInputDialog
(
const
TInputDialog
&);
96
TInputDialog
& operator=(
const
TInputDialog
&);
97
98
DECLARE_STREAMABLE_OWL
(
TInputDialog
, 1);
99
};
100
/// @}
101
102
DECLARE_STREAMABLE_INLINES
(
owl::TInputDialog
);
103
104
#include <
owl/posclass.h
>
105
106
107
//----------------------------------------------------------------------------
108
// Inline implementations
109
//
110
111
//
112
/// Returns the prompt for the dialog.
113
//
114
inline
LPCTSTR
TInputDialog::GetPrompt
()
const
115
{
116
return
Prompt;
117
}
118
119
//
120
/// Returns the buffer.
121
//
122
inline
LPCTSTR
TInputDialog::GetBuffer
()
const
123
{
124
return
Buffer;
125
}
126
127
//
128
/// Returns the size of the buffer.
129
//
130
inline
int
TInputDialog::GetBufferSize
()
const
131
{
132
return
BufferSize;
133
}
134
135
136
137
}
// OWL namespace
138
139
#endif
// OWL_INPUTDIA_H
owl::TDialog::TDialog
TDialog(TWindow *parent, TResId resId, TModule *module=nullptr)
Constructor for a TDialog object.
Definition
dialog.cpp:103
owl::TInputDialog
Provides a generic dialog box to retrieve text input by a user.
Definition
inputdia.h:35
owl::TInputDialog::TransferData
void TransferData(TTransferDirection)
Transfers the data of the input dialog box.
Definition
inputdia.cpp:142
owl::TInputDialog::TInputDialog
TInputDialog(TWindow *parent, LPCTSTR title, LPCTSTR prompt, TCHAR *buffer, int bufferSize, TModule *module=0, TValidator *valid=0)
Let the compiler know that the following template instances will be defined elsewhere.
Definition
inputdia.cpp:29
owl::TInputDialog::GetPrompt
LPCTSTR GetPrompt() const
Returns the prompt for the dialog.
Definition
inputdia.h:114
owl::TInputDialog::GetBufferSize
int GetBufferSize() const
Returns the size of the buffer.
Definition
inputdia.h:130
owl::TInputDialog::SetupWindow
void SetupWindow()
Calls TDialog::SetupWindow to set up the window, then limits the number of characters the user can en...
Definition
inputdia.cpp:158
owl::TInputDialog::GetBuffer
LPCTSTR GetBuffer() const
Returns the buffer.
Definition
inputdia.h:122
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
owl::TValidator
A streamable class, TValidator defines an abstract data validation object.
Definition
validate.h:71
owl::TWindow
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition
window.h:414
dialog.h
Definition of TDialog class and TDialogAttr struct.
DECLARE_STREAMABLE_OWL
#define DECLARE_STREAMABLE_OWL(cls, ver)
Definition
objstrm.h:1529
DECLARE_STREAMABLE_INLINES
#define DECLARE_STREAMABLE_INLINES(cls)
Definition
objstrm.h:1538
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::tchar
char tchar
Definition
defs.h:77
owl::tstring
std::string tstring
Definition
defs.h:79
public_data
#define public_data
Definition
defs.h:207
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
inputdia.h
Generated by
1.18.0