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
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
21namespace owl {
22
23#include <owl/preclass.h>
24
25class _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//
36 public:
37 TInputDialog(TWindow* parent,
41 int bufferSize,
42 TModule* module = 0,
43 TValidator* valid = 0); // Optional validator
44
46 TWindow* parent,
47 const tstring& title,
48 const tstring& prompt,
50 int bufferSize,
51 TModule* module = 0,
52 TValidator* valid = 0); // Optional validator
53
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
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
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 //
96 TInputDialog& operator=(const TInputDialog&);
97
99};
100/// @}
101
103
104#include <owl/posclass.h>
105
106
107//----------------------------------------------------------------------------
108// Inline implementations
109//
110
111//
112/// Returns the prompt for the dialog.
113//
115{
116 return Prompt;
117}
118
119//
120/// Returns the buffer.
121//
123{
124 return Buffer;
125}
126
127//
128/// Returns the size of the buffer.
129//
131{
132 return BufferSize;
133}
134
135
136
137} // OWL namespace
138
139#endif // OWL_INPUTDIA_H
Typically used to obtain information from a user, a dialog box is a window inside of which other cont...
Definition dialog.h:85
Provides a generic dialog box to retrieve text input by a user.
Definition inputdia.h:35
LPCTSTR GetPrompt() const
Returns the prompt for the dialog.
Definition inputdia.h:114
int GetBufferSize() const
Returns the size of the buffer.
Definition inputdia.h:130
LPCTSTR GetBuffer() const
Returns the buffer.
Definition inputdia.h:122
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
A streamable class, TValidator defines an abstract data validation object.
Definition validate.h:71
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
Definition of TDialog class and TDialogAttr struct.
#define DECLARE_STREAMABLE_OWL(cls, ver)
Definition objstrm.h:1529
#define DECLARE_STREAMABLE_INLINES(cls)
Definition objstrm.h:1538
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition window.h:92
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
char tchar
Definition defs.h:77
std::string tstring
Definition defs.h:79
#define public_data
Definition defs.h:207
#define _OWLCLASS
Definition defs.h:338