30#include <owl/except.rh>
37 template <
class TRadioButtonFunc>
38 TRadioButtonFunc IterateRadioButtons(HWND first, TRadioButtonFunc f)
41 for (
int i = 0; h !=
nullptr; ++i)
46 h = c.GetWindow(GW_HWNDNEXT);
47 if (GetWindowLong(h, GWL_STYLE) & WS_GROUP)
53 struct TSetRadioButton
56 bool operator()(TRadioButton& c,
int i)
const
63 struct TGetRadioButton
66 bool operator()(TRadioButton& c,
int i)
68 bool found = c.IsWindowEnabled() && c.IsChecked();
78 TSetRadioButton f = {selIndex};
79 IterateRadioButtons(first, f);
84 TGetRadioButton f = {-1};
85 return IterateRadioButtons(first, f).index;
101 state = IsDlgButtonChecked(GetParent(ctrl), GetDlgCtrlID(ctrl));
111 template <
class TControlType>
112 TControlType& GetControlObject(HWND
const parent, HWND ctrl, TControlType* = 0)
116 TWindow* w = a.GetWindowPtr(ctrl);
117 if (!w)
TXWindow::Raise(a.GetWindowPtr(parent), IDS_TRANSFERCONTROLMISSING);
118 return dynamic_cast<TControlType&
>(*w);
211 if (selTime.length() == 0)
Definition of class TAppDictionary.
Definition of class TCheckBox.
Definition of class TCheckList, an ownerdrawn listbox to select multiple items.
#define PRECONDITION(condition)
TCheckList is an owner-drawn list box to select multiple items.
virtual uint Transfer(TCheckListData &data, TTransferDirection direction)
Safe overload.
An interface object that represents a transfer buffer for a TComboBox.
ComboBoxEx controls are combo box controls that provide native support for item images.
void Transfer(TComboBoxExData &data, TTransferDirection op)
Safe overload.
You can use TComboBox to create a combo box or a combo box control in a parent TWindow,...
virtual int SetSelString(LPCTSTR findStr, int startIndex=-1)
Selects a string of characters in the associated list box and sets the contents of the associated edi...
virtual int SetSelStringExact(LPCTSTR find, int startIndex=-1)
DLN added.
virtual int GetSelIndex() const
Returns the index of the list selection or a negative value if none exists.
virtual int SetSelIndex(int index)
Selects a string of characters in a combo box.
void Transfer(TComboBoxData &data, TTransferDirection direction)
bool SetTime(const TSystemTime &dt)
int GetTime(TSystemTime &dt) const
uint Transfer(TDateTimePickerData &data, TTransferDirection direction)
Safe overload.
TDelegatedTransferDialog(TWindow *parent, TResId id, TTransferFunction f, TModule *module=0)
std::function< TTransferFunctionSignature > TTransferFunction
virtual void TransferData(TTransferDirection d)
TWindow override Dispatches to the transfer function.
TDelegatedTransferWindow(TTransferFunction f)
TDialog(TWindow *parent, TResId resId, TModule *module=nullptr)
Constructor for a TDialog object.
THotKey encapsulates the hot-key control, a window that allows the user to enter a combination of key...
uint Transfer(uint16 &key, TTransferDirection direction)
Safe overload.
Also used as transfer buffer.
uint Transfer(TIPAddressBits &address, TTransferDirection direction)
Safe overload.
void SetAddress(const TIPAddressBits &address)
int GetAddress(TIPAddressBits &address) const
Used to transfer the contents of a list box.
An interface object that represents a corresponding list box element.
virtual int SetSelIndex(int index)
For single-selection list boxes.
void Transfer(TListBoxData &data, TTransferDirection direction)
virtual int SetSelStringExact(LPCTSTR str, int startIndex=-1)
Selects the item that matches the given string exactly.
virtual int GetSelString(TCHAR *str, int maxChars) const
For single-selection list boxes.
virtual int SetSelString(LPCTSTR str, int startIndex=-1)
For single-selection list boxes.
virtual int GetSelIndex() const
For single-selection list boxes.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
uint Transfer(TMonthCalendarData &data, TTransferDirection direction)
Safe overload.
bool GetCurSel(TSystemTime &tm) const
bool SetSelRange(const TSystemTime &minm, const TSystemTime &maxm)
bool SetCurSel(const TSystemTime &tm)
bool GetSelRange(TSystemTime &minm, TSystemTime &maxm) const
An abstract base class derived from TScrollBar, TSlider defines the basic behavior of sliders (contro...
void SetPosition(int thumbPos)
Sets the position of the thumb and always redraws.
auto GetPosition() const -> int override
Returns the slider's current thumb position.
TSystemTime is a class derived from the structure SYSTEMTIME.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
int GetWindowText(TCHAR *str, int maxCount) const
Copies the window's title into a buffer pointed to by string.
HWND GetHandle() const
Returns the handle of the window.
static void Raise(TWindow *win=nullptr, uint resourceId=IDS_INVALIDWINDOW)
Creates the TXWindow exception and throws it.
Definition of class TComboBoxEx.
Definition of class TComboBox and TComboBoxData the base class for all combobox controls.
Definition of class TDateTimePicker.
Definition of class TEdit.
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.
Definition of class THotKey.
Definition of class TListBox and TlistBoxData.
Definition of class TMonthCalendar.
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.
void SetDlgItemText(HWND ctrl, const tstring &text)
String overload.
void TransferCheckListData(const TTransferInfo &, HWND ctrl, TCheckListData &data)
Transfers all the data for a check list box.
TApplication * GetApplicationObject(uint pid=0)
Global function that calls GetApplication() on owl's app-dictionary.
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 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 TransferListBoxData(const TTransferInfo &, HWND ctrl, TListBoxData &data)
Transfers all the data for a list box control.
bool IsChecked(HWND ctrl)
Returns true if the given control has BST_CHECKED state.
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 CheckDlgButton(HWND ctrl, bool checked=true)
Sets the state of the given control to BST_CHECKED (or BST_UNCHECKED).
tstring GetDlgItemText(HWND ctrl)
String overload.
void TransferSliderData(const TTransferInfo &, HWND ctrl, TScrollBarData &data)
Transfers all the data for a slider control.
int GetSelectedRadioButtonIndex(HWND firstCtrl)
Returns the zero-based index of the selected radiobutton in the group of controls starting with the g...
Definition of class TRadioButton.
Definition of classes TSlider & TVSlider.
Definition of class TStatic, the class for static controls and base for any control that manages simp...
Used to pass information to transfer functions.
TTransferDirection Operation
Utilities for transferring data in and out of controls.