OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
commdial.h
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows
3
// Copyright (c) 1992, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Definition of Common Dialog abstract base class
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_COMMDIAL_H)
10
#define OWL_COMMDIAL_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
19
#if !defined(_INC_COMMDLG)
20
# include <commdlg.h>
21
#endif
22
23
#include <cderr.h>
24
25
26
namespace
owl
{
27
28
#include <
owl/preclass.h
>
29
30
31
/// \addtogroup commdlg
32
/// @{
33
/// \class TCommonDialog
34
// ~~~~~ ~~~~~~~~~~~~~
35
/// Derived from TDialog, TCommonDialog is the abstract base class for TCommonDialog
36
/// objects. It provides the basic functionality for creating dialog boxes using the
37
/// common dialog DLL. The ObjectWindows classes that inherit this common dialog
38
/// functionality include
39
/// - \c \b TChooseColorDialog - a modal dialog box that lets a user select
40
/// colors for an application.
41
/// - \c \b TChooseFontDialog - a modal dialog box that lets a user select
42
/// fonts for an application.
43
/// - \c \b TReplaceDialog a modeless dialog box that lets a user specify a
44
/// text selection to replace.
45
/// - \c \b TFindDialog a modeless dialog box that lets a user specify a text
46
/// selection to find.
47
/// - \c \b TFileOpenDialog - a modal dialog box that lets a user specify a
48
/// file to open.
49
/// - \c \b TFileSaveDialog - a modal dialog box that lets a user specify a
50
/// file to save.
51
/// - \c \b TPrintDialog - a modal dialog box that lets a user specify printer
52
/// options.
53
///
54
/// Each common dialog class uses a nested class, TData, that stores the attributes
55
/// and user-specified data. For example, the TChooseColorDialog::TData class stores
56
/// the color attributes the user selects in response to a prompt in a common dialog
57
/// box. In fact, to create a common dialog box, you construct a TData object first,
58
/// then fill in the data members of the TData object before you even construct the
59
/// common dialog box object. Finally, you either execute a modal dialog box or
60
/// create a modeless dialog box.
61
///
62
class
_OWLCLASS
TCommonDialog
:
public
TDialog
{
63
public
:
64
TCommonDialog
(
TWindow
* parent, LPCTSTR title =
nullptr
,
TModule
* module =
nullptr
);
65
TCommonDialog
(
TWindow
* parent,
const
tstring
& title,
TModule
* =
nullptr
);
66
~TCommonDialog
()
override
;
67
68
auto
DoExecute
() ->
int
override
;
69
70
protected
:
71
const
tstring
&
GetCDTitle
()
const
;
72
73
// Override virtual functions defined by class TWindow
74
//
75
auto
PerformCreate
() ->
THandle
override
;
76
void
SetupWindow
()
override
;
77
78
// Default behavior inline for message response functions
79
//
80
void
CmOkCancel
();
//EV_COMMAND(IDOK or IDCANCEL
81
void
EvClose
();
//EV_CLOSE
82
void
CmHelp
();
//EV_COMMAND(pshHelp,
83
84
protected_data
:
85
tstring
CDTitle;
///< Stores the optional caption displayed in the common dialog box.
86
87
private
:
88
TCommonDialog
(
const
TCommonDialog
&);
89
TCommonDialog
& operator=(
const
TCommonDialog
&);
90
91
DECLARE_RESPONSE_TABLE(
TCommonDialog
);
92
DECLARE_CASTABLE;
93
};
94
95
/// @}
96
97
#include <
owl/posclass.h
>
98
99
100
101
//----------------------------------------------------------------------------
102
// Inline implementations
103
//
104
105
//
106
/// Return the title from the common dialog.
107
//
108
inline
const
tstring
&
TCommonDialog::GetCDTitle
()
const
109
{
110
return
CDTitle;
111
}
112
113
//
114
/// Responds to a click on the dialog box's OK or Cancel button by calling
115
/// DefaultProcessing to let the common dialog DLL process the command.
116
//
117
inline
void
TCommonDialog::CmOkCancel
()
118
{
119
DefaultProcessing
();
120
}
121
122
//
123
/// Responds to a WM_CLOSE message by calling DefaultProcessing to let the common
124
/// dialog DLL process the command.
125
//
126
inline
void
TCommonDialog::EvClose
()
127
{
128
DefaultProcessing
();
129
}
130
131
//
132
/// Default handler for the pshHelp push button (the Help button in the dialog box).
133
//
134
inline
void
TCommonDialog::CmHelp
()
135
{
136
DefaultProcessing
();
137
}
138
139
}
// OWL namespace
140
141
142
#endif
// OWL_COMMDIAL_H
owl::TCommonDialog::EvClose
void EvClose()
Responds to a WM_CLOSE message by calling DefaultProcessing to let the common dialog DLL process the ...
Definition
commdial.h:126
owl::TCommonDialog::GetCDTitle
const tstring & GetCDTitle() const
Return the title from the common dialog.
Definition
commdial.h:108
owl::TCommonDialog::TCommonDialog
TCommonDialog(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Invokes a TWindow constructor, passing the parent window parent, and constructs a common dialog box t...
Definition
commdial.cpp:34
owl::TCommonDialog::PerformCreate
auto PerformCreate() -> THandle override
Default handler for a modeless common dialog.
Definition
commdial.cpp:82
owl::TCommonDialog::CmOkCancel
void CmOkCancel()
Responds to a click on the dialog box's OK or Cancel button by calling DefaultProcessing to let the c...
Definition
commdial.h:117
owl::TCommonDialog::DoExecute
auto DoExecute() -> int override
Default handler for a modal common dialog.
Definition
commdial.cpp:95
owl::TCommonDialog::CmHelp
void CmHelp()
Default handler for the pshHelp push button (the Help button in the dialog box).
Definition
commdial.h:134
owl::TCommonDialog::SetupWindow
void SetupWindow() override
Assigns the caption of the dialog box to CDTitle if CDTitle is non-blank.
Definition
commdial.cpp:68
owl::TDialog::TDialog
TDialog(TWindow *parent, TResId resId, TModule *module=nullptr)
Constructor for a TDialog object.
Definition
dialog.cpp:103
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
owl::TWindow
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition
window.h:414
owl::TWindow::DefaultProcessing
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
Definition
window.cpp:852
owl::TWindow::THandle
HWND THandle
TWindow encapsulates an HWND.
Definition
window.h:418
dialog.h
Definition of TDialog class and TDialogAttr struct.
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::tstring
std::string tstring
Definition
defs.h:79
protected_data
#define protected_data
Definition
defs.h:208
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
commdial.h
Generated by
1.18.0