OWLNext    7.0
Borland's Object Windows Library for the modern age
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
19namespace owl {class _OWLCLASS TConfigFile;};
20
21namespace 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
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
86 {
87 tbftCharArray, tbftString, tbftComboBoxData
88 };
89 TTransferBufferFieldType GetTransferBufferFieldType() const;
90 void SetTransferBufferFieldType(TTransferBufferFieldType);
91
92 /// @}
93
94 protected:
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
119};
120
121/// @}
122
124
125#include <owl/posclass.h>
126
127} // OWL namespace
128
129#endif // OWL_MEMCBOX_H sentry.
130
You can use TComboBox to create a combo box or a combo box control in a parent TWindow,...
Definition combobox.h:47
Save/Load configuration parameters Base abstract class.
Definition configfl.h:48
TTransferBufferFieldType TransferBufferFieldType
Definition memcbox.h:97
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
Definition of class TComboBox and TComboBoxData the base class for all combobox controls.
#define DECLARE_RESPONSE_TABLE(cls)
Definition eventhan.h:436
#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
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define _OWLCLASS
Definition defs.h:338