15#include <owl/picklist.rh>
29 TWindow(parent, nullptr, nullptr),
60 TWindow(parent, nullptr, nullptr),
160 int initialSelection,
165 TDialog(parent, templateId ? templateId :
TResId(IDD_PICKLISTDIALOG), module),
166 List(this, IDC_LIST, module),
167 Result(initialSelection),
169 NewedStrings(!strings)
181 int initialSelection,
186 :
TDialog(parent, templateId ? templateId :
TResId(IDD_PICKLISTDIALOG), module),
187 List(this, IDC_LIST, module),
188 Result(initialSelection),
190 NewedStrings(!strings)
212 if (List.GetHandle())
224 if (List.GetHandle())
226 return Strings->Size()-1;
233AddToList(
tstring& str,
void* param)
236 if (list && list->GetHandle())
237 list->AddString(str);
250 Strings->ForEach(owl::AddToList, &List);
254 if (List.GetCount() > Result) {
255 List.SetSelIndex(Result);
256 List.SetCaretIndex(Result,
false);
266 int index = List.GetSelIndex();
#define PRECONDITION(condition)
Typically used to obtain information from a user, a dialog box is a window inside of which other cont...
void CloseWindow(int retValue=IDCANCEL) override
Overrides the virtual function defined by TWindow and conditionally shuts down the dialog box.
void SetupWindow() override
Overrides the virtual function defined in TWindow.
TDialog(TWindow *parent, TResId resId, TModule *module=nullptr)
Constructor for a TDialog object.
An interface object that represents a corresponding list box element.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
bool PumpWaitingMessages()
The inner message loop.
The PickListDialog allows selection of an item from a list in a dialog with OK and Cancel buttons.
int AddString(LPCTSTR str)
Adds a string to the Strings list and to the List box if it has already been created.
void CmCancel()
User-selected Cancel.
void SetupWindow() override
Override from TDialog.
~TPickListDialog() override
Deletes any allocated string.
void ClearStrings()
Clears all strings from the list.
void CmOK()
User-selected OK. Gets selection from the listbox and returns it.
TPickListDialog(TWindow *parent, TStringArray *strings=0, int initialSelection=0, TResId templateId=0, LPCTSTR title=0, TModule *module=0)
Initialize the dialog.
TPoint is a support class, derived from tagPOINT.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
static void GetCursorPos(TPoint &pos)
Retrieves the cursor's current position (in window screen coordinates) and copies the values into the...
tstring LoadString(uint id) const
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
TWindow(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be cre...
virtual bool Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
bool IsWindow() const
Returns true if an HWND is being used.
void SetCaption(LPCTSTR title)
Copies title to an allocated string pointed to by title.
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Object Windows Library (OWLNext Core).
TObjectArray< tstring > TStringArray
EV_LBN_DBLCLK(IDC_LIST, CmOK)
LRESULT TResult
Result type.
EV_COMMAND(IDOK, CmOkCancel)
#define REINTERPRET_CAST(targetType, object)
Definition of classes TPickListPopup & TPickListDialog.