15#if defined(BI_COMP_BORLANDC)
25#include <initializer_list>
44using ::GetDlgItemText;
45using ::SetDlgItemText;
46using ::CheckDlgButton;
70{return ::IsDlgButtonChecked(GetParent(ctrl), GetDlgCtrlID(ctrl)) ==
BST_CHECKED;}
76{return ::IsDlgButtonChecked(GetParent(ctrl), GetDlgCtrlID(ctrl)) ==
BST_UNCHECKED;}
82{return ::IsDlgButtonChecked(GetParent(ctrl), GetDlgCtrlID(ctrl)) ==
BST_INDETERMINATE;}
123{
return IsChecked(GetDlgItem(parent, ctrl));}
667 template <
class TCtrl,
class TGet,
class TSet,
class TTransfer>
671 typedef typename std::remove_reference<TDataConstRef>::type
TDataConst;
672 typedef typename std::remove_cv<TDataConst>::type TData;
683 template <
class TCtrl,
class TArg1,
class TGet,
class TSet,
class TTransfer>
687 typedef typename std::remove_reference<TDataConstRef>::type
TDataConst;
688 typedef typename std::remove_cv<TDataConst>::type TData;
699 template <
class TCtrl,
class TDataSource,
class R,
class A,
class TTransfer>
708 template <
class TCtrl,
class TArg1,
class TDataSource,
class R,
class A,
class TTransfer>
717 template <
class TCtrl,
class TData>
727 template <
class TCtrl,
class TData>
737 template <
class TCtrl,
class TData>
741 template <
class TCtrl,
class TData,
class TArg1>
751 template <
class TCtrl,
class TData>
761 template <
class TCtrl,
class TData>
771 template <
class TCtrl,
class TData>
775 template <
class TCtrl,
class TData>
785 template <
class TCtrl,
class TData>
789 template <
class TCtrl,
class TData>
799 template <
class TCtrl,
class TData>
809 template <
class TCtrl,
class TData>
819 template <
class TCtrl,
class TData>
823 template <
class TCtrl,
class TData,
class TArg1>
833 template <
class TCtrl,
class TData>
843 template <
class TCtrl,
class TData>
853 template <
class TCtrl,
class TData>
863 template <
class TCtrl,
class TData>
873 template <
class TCtrl,
class TData>
877 template <
class TCtrl,
class TData>
890template <
class TCtrl,
class D,
class R,
class A>
897template <
class TCtrl,
class D,
class R,
class A>
904template <
class TCtrl,
class D,
class R,
class A>
912template <
class TCtrl,
class TArg1,
class D,
class R,
class A>
919template <
class TCtrl,
class D,
class R,
class A>
926template <
class TCtrl,
class D,
class R,
class A>
934template <
class TCtrl,
class D,
class R,
class A>
941template <
class TCtrl,
class D,
class R,
class A>
949template <
class TCtrl,
class D,
class R,
class A>
956template <
class TCtrl,
class D,
class R,
class A>
963template <
class TCtrl,
class D,
class R,
class A>
970template <
class TCtrl,
class D,
class R,
class A>
978template <
class TCtrl,
class TArg1,
class D,
class R,
class A>
985template <
class TCtrl,
class D,
class R,
class A>
992template <
class TCtrl,
class D,
class R,
class A>
999template <
class TCtrl,
class D,
class R,
class A>
1006template <
class TCtrl,
class D,
class R,
class A>
1013template <
class TCtrl,
class D,
class R,
class A>
1021template <
class TCtrl,
class D,
class R,
class A>
1033template <
class TCtrl,
class G,
class S>
1040template <
class TCtrl,
class G,
class S>
1047template <
class TCtrl,
class G,
class S>
1055template <
class TCtrl,
class TArg1,
class G,
class S>
1062template <
class TCtrl,
class G,
class S>
1069template <
class TCtrl,
class G,
class S>
1077template <
class TCtrl,
class G,
class S>
1084template <
class TCtrl,
class G,
class S>
1092template <
class TCtrl,
class G,
class S>
1099template <
class TCtrl,
class G,
class S>
1106template <
class TCtrl,
class G,
class S>
1113template <
class TCtrl,
class G,
class S>
1121template <
class TCtrl,
class TArg1,
class G,
class S>
1128template <
class TCtrl,
class G,
class S>
1135template <
class TCtrl,
class G,
class S>
1142template <
class TCtrl,
class G,
class S>
1149template <
class TCtrl,
class G,
class S>
1156template <
class TCtrl,
class G,
class S>
1164template <
class TCtrl,
class G,
class S>
1174template <
class TDataSource>
1363 {
return IsChecked(std::begin(
id), std::end(
id));}
1389 {
return IsUnchecked(std::begin(
id), std::end(
id));}
1505template <
class TDataSource,
class TDialogBase = TDialog>
1560template <
class TValue>
1569 template <
int N,
class TGet,
class TSet>
1577 template <
int N,
class D,
class R,
class A>
1580 Getter(std::bind(
get,
d)),
1589 {
return static_cast<int>(std::find(Begin, End, Getter()) - Begin);}
1598 Setter(Begin[index]);
1605 std::function<
TValue()> Getter;
1612#if defined(BI_COMP_BORLANDC)
An interface object that represents a transfer buffer for a TComboBox.
Dialog derivative of TDelegatedTransferWindow.
TWindow mix-in Delegates the job of transferring data to the given function object.
void TTransferFunctionSignature(const TTransferInfo &)
std::function< TTransferFunctionSignature > TTransferFunction
Typically used to obtain information from a user, a dialog box is a window inside of which other cont...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Maps between application-specific value and a selection index, such as a radio-button group index or ...
int Get() const
Uses the stored getter to get the application-specific value, then converts it to a selection index.
void Set(int index)
Converts the given selection index to an application-specific value, then calls the stored setter,...
TSelectionIndexMapper(const TValue(&values)[N], TGet get, TSet set)
Constructs a new mapper given an array of values, a getter and a setter.
TSelectionIndexMapper(const TValue(&values)[N], D *d, R(D::*get)() const, void(D::*set)(A))
Overload; specialized for member functions.
TSystemTime is a class derived from the structure SYSTEMTIME.
Dialog class derived from TTransferWindow Provides convenient initialization of the dialog and transf...
TTransferDialog(TWindow *parent, TResId id, TDataSource &ds, TModule *m=0)
Mix-in class template providing support for data transfer to and from controls.
void DisableDlgItem(const std::initializer_list< int > &id, bool disabled=true)
Disables (or enables) all the controls in the given initializer list.
void EnableDlgItem(const int(&id)[N], bool enabled=true)
Enables (or disables) all the controls in the given array.
void HideDlgItem(const int(&id)[N], bool hidden=true)
Hides (or shows) all the controls in the given array.
virtual void DoSetData(const TTransferInfo &, const TDataSource &)
Transfers the state of the given data source into the window.
bool IsChecked(int ctrl) const
Returns true if the given control has BST_CHECKED state.
void CheckDlgButton(int ctrl, bool checked=true)
Sets the state of the given control to BST_CHECKED (or BST_UNCHECKED).
virtual void TransferData(TTransferDirection d)
TWindow override Initialises the transfer info and dispatches to DoTransferData.
void SetData(const TDataSource &ds)
Transfers the state of the given data source into the window.
void DisableDlgItem(It first, It last, bool disabled=true)
Disables (or enables) all the controls in the given sequence.
int GetSelectedRadioButtonIndex(int firstCtrl) const
See owl::GetSelectedRadioButtonIndex.
void EnableDlgItem(const std::initializer_list< int > &id, bool enabled=true)
Enables (or disables) all the controls in the given initializer list.
void ShowDlgItem(const std::initializer_list< int > &id, bool visible=true)
Shows (or hides) all the controls in the given initializer list.
void DisableDlgItem(const int(&id)[N], bool disabled=true)
Disables (or enables) all the controls in the given array.
bool IsChecked(const std::initializer_list< int > &id) const
Returns true if any control in the given initializer list has BST_CHECKED state.
void ShowDlgItem(int ctrl, bool visible=true)
Shows (or hides) the given control.
bool IsUnchecked(const int(&id)[N]) const
Returns true if any control in the given array has BST_UNCHECKED state.
bool IsIndeterminate(int ctrl) const
Returns true if the given control has BST_INDETERMINATE state.
bool IsUnchecked(It first, It last) const
Returns true if any control in the given sequence has BST_UNCHECKED state.
void CheckDlgButton(int ctrl, int state)
Resolves an integer state argument.
void HideDlgItem(const std::initializer_list< int > &id, bool hidden=true)
Hides (or shows) all the controls in the given initializer list.
void HideDlgItem(int ctrl, bool hidden=true)
Hides (or shows) the given control.
bool IsIndeterminate(const std::initializer_list< int > &id) const
Returns true if any control in the given initializer list has BST_INDETERMINATE state.
TTransferWindow(TDataSource &ds)
void ShowDlgItem(It first, It last, bool visible=true)
Shows (or hides) all the controls in the given sequence.
void EnableDlgItem(int ctrl, bool enabled=true)
Enables (or disables) the given control.
TDataSource GetData() const
Function style overload Requires that the data source type is a value type with a default constructor...
void GetData(TDataSource &ds) const
Transfer the state of the window into the given data source.
void ShowDlgItem(const int(&id)[N], bool visible=true)
Shows (or hides) all the controls in the given array.
void UncheckDlgButton(int ctrl, bool unchecked=true)
Sets the state of the given control to BST_UNCHECKED (or BST_CHECKED).
virtual void DoGetData(const TTransferInfo &, TDataSource &) const
Transfers the state of the window into the given data source.
virtual void DoTransferData(const TTransferInfo &i, TDataSource &ds)
Transfers data between window and data source in the direction specified by the given transfer inform...
void EnableDlgItem(It first, It last, bool enabled=true)
Enables (or disables) all the controls in the given sequence.
bool IsChecked(const int(&id)[N]) const
Returns true if any control in the given array has BST_CHECKED state.
bool IsUnchecked(int ctrl) const
Returns true if the given control has BST_UNCHECKED state.
bool IsIndeterminate(const int(&id)[N]) const
Returns true if any control in the given array has BST_INDETERMINATE state.
bool IsChecked(It first, It last) const
Returns true if any control in the given sequence has BST_CHECKED state.
void SetSelectedRadioButtonIndex(int firstCtrl, int selIndex)
See owl::SetSelectedRadioButtonIndex.
void SetSelectedRadioButtonIndex(HWND firstCtrl, int selIndex)
See owl::SetSelectedRadioButtonIndex.
bool IsIndeterminate(It first, It last) const
Returns true if any control in the given sequence has BST_INDETERMINATE state.
void CheckDlgButton(int ctrl, uint state)
using TWindow::CheckDlgButton;
void DisableDlgItem(int ctrl, bool disabled=true)
Disables (or enables) the given control.
int GetSelectedRadioButtonIndex(HWND firstCtrl) const
See owl::GetSelectedRadioButtonIndex.
bool HideDlgItem(It first, It last, bool hidden=true)
Hides (or shows) all the controls in the given sequence.
bool IsUnchecked(const std::initializer_list< int > &id) const
Returns true if any control in the given initializer list has BST_UNCHECKED state.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
uint IsDlgButtonChecked(int buttonId) const
Indicates if the child button specified in the integer parameter, buttonId, is checked,...
virtual bool EnableWindow(bool enable)
Allows the given window to receive input from the keyboard of mouse.
HWND GetDlgItem(int childId) const
Retrieves the handle of a control specified by childId.
int GetDlgItemText(int childId, TCHAR *text, int maxValue) const
Retrieves the text of a control specified by childId.
void CheckDlgButton(int buttonId, uint check)
Places a check mark in (or removes a check mark from) the button specified in buttonId.
virtual bool ShowWindow(int cmdShow)
Displays this TWindow in a given state.
HWND GetHandle() const
Returns the handle of the window.
Definition of TDialog class and TDialogAttr struct.
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
@ tdSetData
Set data from the buffer into the window.
@ tdGetData
Get data from the window into the buffer.
void Transfer(const TTransferInfo &i, const TCtrl &ctrl, TGet get, TSet set, TTransfer transfer)
Object Windows Library (OWLNext Core)
void TransferScrollBarData(const TTransferInfo &, HWND ctrl, TScrollBarData &data)
Transfers all the data for a scroll bar control.
void TransferHotKeyData(const TTransferInfo &, HWND ctrl, uint16 &key)
Transfers the hotkey value of a hotkey control.
void TransferComboBoxExData(const TTransferInfo &, HWND ctrl, TComboBoxExData &data)
Transfers all the data for an extended combo box control.
std::ostringstream tostringstream
void DDX_HotKey(const TTransferInfo &i, int id, uint16 &key)
Transfers the hotkey value of a hotkey control.
void SetDlgItemText(HWND ctrl, const tstring &text)
String overload.
void DDX_IPAddress(const TTransferInfo &i, int id, uint32 &data)
Transfers the address for a IP address control as a 32-bit value.
void DDX_CBIndex(const TTransferInfo &i, int id, int &selIndex)
Transfers the selection index of a combo box control.
void TransferCheckListData(const TTransferInfo &, HWND ctrl, TCheckListData &data)
Transfers all the data for a check list box.
void SetSelectedRadioButtonIndex(HWND firstCtrl, int selIndex)
Selects the control with the given zero-based index in the group of controls starting with the given ...
void DDX_CBString(const TTransferInfo &i, int id, tstring &selString)
Transfers the selection string of a combo box control.
void DDX_Check(const TTransferInfo &i, int id, UINT &state)
Transfers the state of the checkbox to the given integer variable.
void TransferRadioButtonData(const TTransferInfo &, HWND ctrl, int &selIndex)
Transfers the index of the selected radio button within a group.
void TransferComboBoxData(const TTransferInfo &, HWND ctrl, TComboBoxData &data)
Transfers all the data for a combo box control.
void DDX_LBString(const TTransferInfo &i, int id, tstring &selString)
Transfers the selection string of a list box control.
void DDX_DateTimeCtrl(const TTransferInfo &i, int id, TSystemTime &selTime)
Transfers the selected date and time of a date and time picker control.
void DDX_LBStringExact(const TTransferInfo &i, int id, tstring &selString)
Transfers the exact selection string of a list box control.
void DDX_LBIndex(const TTransferInfo &i, int id, int &selIndex)
Transfers the selection index of a list box control.
void TransferListBoxData(const TTransferInfo &, HWND ctrl, TListBoxData &data)
Transfers all the data for a list box control.
void DDX_MonthCalCtrl(const TTransferInfo &i, int id, TSystemTime &curSel)
Transfers the selected date and time of a calendar control.
void TransferEditData(const TTransferInfo &i, HWND ctrl, T &value)
Transfers the lexical conversion of the text contents of an edit control.
void TransferStaticData(const TTransferInfo &i, HWND ctrl, T &value)
Transfers the lexical conversion of the text contents of a static control.
void DDX_Scroll(const TTransferInfo &i, int id, int &position)
Transfers the current position of a scroll bar control.
bool IsChecked(HWND ctrl)
Returns true if the given control has BST_CHECKED state.
std::istringstream tistringstream
void DDX_Radio(const TTransferInfo &i, int id, int &selIndex)
Transfers the index of the selected radio button within a group.
void DDX_CBStringExact(const TTransferInfo &i, int id, tstring &selString)
Transfers the exact selection string of a combo box control.
void TransferIPAddressData(const TTransferInfo &, HWND ctrl, TIPAddressBits &data)
Transfers the address of a IP address control as an object.
void TransferMonthCalendarData(const TTransferInfo &, HWND ctrl, TMonthCalendarData &data)
Transfers all the data for a calendar control.
void TransferDateTimePickerData(const TTransferInfo &, HWND ctrl, TDateTimePickerData &data)
Transfers all the data for a date and time picker control.
void TransferDlgItemText(const TTransferInfo &, HWND ctrl, tstring &text)
Transfers the text contents of a control.
void TransferCheckBoxData(const TTransferInfo &, HWND ctrl, bool &b)
Transfers the state of the checkbox to the given bool variable.
void DDX_Slider(const TTransferInfo &i, int id, int &position)
Transfers all the data for a slider control.
void CheckDlgButton(HWND ctrl, bool checked=true)
Sets the state of the given control to BST_CHECKED (or BST_UNCHECKED).
void UncheckDlgButton(HWND ctrl, bool unchecked=true)
Sets the state of the given control to BST_UNCHECKED (or BST_CHECKED).
tstring GetDlgItemText(HWND ctrl)
String overload.
void TransferSliderData(const TTransferInfo &, HWND ctrl, TScrollBarData &data)
Transfers all the data for a slider control.
void DDX_Text(const TTransferInfo &i, int id, T &value)
Transfers the lexical conversion of the text contents of a static control.
bool IsIndeterminate(HWND ctrl)
Returns true if the given control has BST_INDETERMINATE state.
bool IsUnchecked(HWND ctrl)
Returns true if the given control has BST_UNCHECKED state.
int GetSelectedRadioButtonIndex(HWND firstCtrl)
Returns the zero-based index of the selected radiobutton in the group of controls starting with the g...
Used to pass information to transfer functions.
TTransferDirection Operation
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data, TArg1 arg1)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data, const TTransferFormat &f)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data, const TTransferFormat &f)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data, TArg1 arg1)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data, const TTransferFormat &f)
void operator()(const TTransferInfo &i, const TCtrl &ctrl, TData &data)