OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
memcbox.h
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows, OWL NExt
3
// Copyright 1998-1999 by Yura Bidus. All Rights reserved.
4
//
5
/// \file
6
/// Class definition for TMemComboBox (TComboBox).
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_MEMCBOX_H)
// Sentry, use file only if it's not already included.
10
#define OWL_MEMCBOX_H
11
12
#include <
owl/private/defs.h
>
13
#if defined(BI_HAS_PRAGMA_ONCE)
14
# pragma once
15
#endif
16
17
#include <
owl/combobox.h
>
18
19
namespace
owl
{
class
_OWLCLASS
TConfigFile
;};
20
21
namespace
owl
{
22
23
#include <
owl/preclass.h
>
24
25
/// \addtogroup newctrl
26
/// @{
27
//
28
/// \class TMemComboBox
29
// ~~~~~ ~~~~~~~~~~~~
30
/// class remember old user selections.
31
/// Saves strings in registry under:
32
/// \code
33
/// CURRENT_USER\Software\OWL NExt\History Lists\[Name]
34
/// \endcode
35
/// Where [Name] - parameter passed in constructor.
36
/// Override CreateConfigFile(); to customize this
37
/// Support Transfer mechanizm, to pass value to Edit part of ComboBox.
38
/// No ComboBox transfer Data,
39
/// Use as transfer structure: tchar buffer[textLimit];
40
/// textLimit - parameter passed in constructor.
41
/// Example:
42
/// \code
43
/// struct TXFer{
44
/// uint16 CheckBox1;
45
/// uint16 CheckBox2;
46
/// tchar Edit1[255];
47
/// tchar MemComboBox[255];
48
/// };
49
/// \endcode
50
//
51
52
// If you use this class as is, all programs will share common data,
53
// Example Find dialog, all programms can share Search string data
54
// Common values, use them, and send me your suggestions
55
#define HL_SearchText "hlSearchText"
56
#define HL_ReplaceText "hlReplaceText"
57
#define HL_GotoLine "hlGotoLine"
58
#define HL_BinGoto "hlBinGoto"
59
#define HL_BlockIndent "hlBlockIndent"
60
#define HL_RightMargin "hlRightMargin"
61
#define HL_GutterWidth "hlGutterWidth"
62
#define HL_UndoLimit "hlUndoLimit"
63
#define HL_TabStops "hlTabStops"
64
#define HL_OtherText "hlOtherText"
65
66
class
_OWLCLASS
TMemComboBox
:
public
TComboBox
{
67
typedef
TComboBox
Inherited;
68
public
:
69
TMemComboBox
(
TWindow
* parent,
int
id
,
int
x,
int
y,
int
w,
int
h,
const
tstring
& name,
70
uint
textLimit = 255,
uint
itemLimit = 25,
TModule
* = 0);
71
TMemComboBox
(
TWindow
* parent,
int
resId,
const
tstring
& name,
72
uint
textLimit = 255,
uint
itemLimit = 25,
TModule
* = 0);
73
74
//
75
/// TWindow override; transfers data of the configured type to or from the given buffer.
76
/// See SetTransferBufferFieldType.
77
//
78
auto
Transfer
(
void
* buffer,
TTransferDirection
) ->
uint
override
;
79
80
/// \name Accessors and mutators for setting the transfer buffer field type
81
/// These are used by the Safe Buffer Transfer machinery, and should not be
82
/// used in general. TODO: Consider making these private with friend access.
83
/// @{
84
85
enum
TTransferBufferFieldType
86
{
87
tbftCharArray
,
tbftString
,
tbftComboBoxData
88
};
89
TTransferBufferFieldType GetTransferBufferFieldType()
const
;
90
void
SetTransferBufferFieldType(TTransferBufferFieldType);
91
92
/// @}
93
94
protected
:
95
tstring
Name
;
96
uint
ItemLimit
;
97
TTransferBufferFieldType
TransferBufferFieldType
;
98
99
void
LoadContents
();
100
void
SaveContents
();
101
102
void
CleanupWindow
()
override
;
103
void
SetupWindow
()
override
;
104
105
void
EvKillFocus
(HWND hWndGetFocus);
106
virtual
TConfigFile
*
CreateConfigFile
();
107
virtual
void
AddToList
(LPTSTR text);
108
virtual
tstring
GetSectionName
();
109
110
private
:
111
112
// Transfer implementations for different field types
113
//
114
uint
TransferCharArray(
void
* buffer,
TTransferDirection
direction);
115
uint
TransferString(
void
* buffer,
TTransferDirection
direction);
116
117
DECLARE_RESPONSE_TABLE(
TMemComboBox
);
118
DECLARE_STREAMABLE_OWL
(
TMemComboBox
, 1);
119
};
120
121
/// @}
122
123
DECLARE_STREAMABLE_INLINES
(
owl::TMemComboBox
);
124
125
#include <
owl/posclass.h
>
126
127
}
// OWL namespace
128
129
#endif
// OWL_MEMCBOX_H sentry.
130
owl::TComboBox::TComboBox
TComboBox(TWindow *parent, int id, int x, int y, int w, int h, uint32 style, uint textLimit, TModule *module=0)
Constructs a combo box object with the specified parent window (parent), control ID (Id),...
Definition
combobox.cpp:178
owl::TConfigFile
Save/Load configuration parameters Base abstract class.
Definition
configfl.h:48
owl::TMemComboBox
Definition
memcbox.h:66
owl::TMemComboBox::EvKillFocus
void EvKillFocus(HWND hWndGetFocus)
Definition
memcbox.cpp:144
owl::TMemComboBox::CreateConfigFile
virtual TConfigFile * CreateConfigFile()
Definition
memcbox.cpp:139
owl::TMemComboBox::SaveContents
void SaveContents()
Definition
memcbox.cpp:113
owl::TMemComboBox::TTransferBufferFieldType
TTransferBufferFieldType
Definition
memcbox.h:86
owl::TMemComboBox::tbftCharArray
@ tbftCharArray
Definition
memcbox.h:87
owl::TMemComboBox::tbftString
@ tbftString
Definition
memcbox.h:87
owl::TMemComboBox::tbftComboBoxData
@ tbftComboBoxData
Definition
memcbox.h:87
owl::TMemComboBox::ItemLimit
uint ItemLimit
Definition
memcbox.h:96
owl::TMemComboBox::TransferBufferFieldType
TTransferBufferFieldType TransferBufferFieldType
Definition
memcbox.h:97
owl::TMemComboBox::Name
tstring Name
Definition
memcbox.h:95
owl::TMemComboBox::Transfer
auto Transfer(void *buffer, TTransferDirection) -> uint override
TWindow override; transfers data of the configured type to or from the given buffer.
Definition
memcbox.cpp:165
owl::TMemComboBox::TMemComboBox
TMemComboBox(TWindow *parent, int id, int x, int y, int w, int h, const tstring &name, uint textLimit=255, uint itemLimit=25, TModule *=0)
Definition
memcbox.cpp:41
owl::TMemComboBox::GetSectionName
virtual tstring GetSectionName()
Definition
memcbox.cpp:62
owl::TMemComboBox::CleanupWindow
void CleanupWindow() override
Definition
memcbox.cpp:67
owl::TMemComboBox::SetupWindow
void SetupWindow() override
Definition
memcbox.cpp:75
owl::TMemComboBox::AddToList
virtual void AddToList(TCHAR *text)
Definition
memcbox.cpp:157
owl::TMemComboBox::LoadContents
void LoadContents()
Definition
memcbox.cpp:84
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
combobox.h
Definition of class TComboBox and TComboBoxData the base class for all combobox controls.
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::tstring
std::string tstring
Definition
defs.h:79
owl::uint
unsigned int uint
Definition
number.h:25
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
memcbox.h
Generated by
1.18.0