OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
draglist.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of class TDragList, a listbox that has dragging capabilities for
7/// items.
8//
9// The owner of a TDragList should have in its response table:
10// EV_REGISTERED(DRAGLISTMSGSTRING, xxx)
11//----------------------------------------------------------------------------
12
13#if !defined(OWL_DRAGLIST_H)
14#define OWL_DRAGLIST_H
15
16#include <owl/private/defs.h>
17#if defined(BI_HAS_PRAGMA_ONCE)
18# pragma once
19#endif
20
21#include <owl/defs.h>
22
23#include <owl/eventhan.h>
24#include <owl/listbox.h>
25#include <owl/commctrl.h>
26
27
28namespace owl {
29
30#include <owl/preclass.h>
31
32/// \addtogroup commctrl
33/// @{
34/// \class TDragList
35// ~~~~~ ~~~~~~~~~
36/// TDragList is a draggable list box. A draggable list box is a list box which can
37/// be used to drag items to change their position. The program responds to drag
38/// events accordingly. Typical usage includes a list of fields that can be
39/// reordered.
40//
42 public:
43
44 /// Enumeration used to specify the type of cursor to be displayed
45 /// during a drag operation. The cursor provides feedback to the user
46 /// about whether the object being dragged can be dropped and the
47 /// operation resulting from the drop.
48 //
50 dlStop = DL_STOPCURSOR, ///< stop cursor - item cannot be dropped now
51 dlCopy = DL_COPYCURSOR, ///< copy cursor - item dragged will be copied
52 dlMove = DL_MOVECURSOR, ///< move cursor - item dragged will be moved
53 };
54
55 // Constructors
56 //
57 TDragList(TWindow* parent,
58 int id,
59 int x, int y, int w, int h,
60 TModule* module = 0);
61
62 TDragList(TWindow* parent, int resourceId, TModule* module = 0);
63
64 // Override these virtual functions for handling dragging events
65 //
66 virtual bool BeginDrag(int item, const TPoint& point);
67 virtual TCursorType Dragging(int item, const TPoint& point);
68 virtual void Dropped(int item, const TPoint& point);
69 virtual void CancelDrag(int item, const TPoint& point);
70
71 // Wrappers for the common control functions
72 //
73 void DrawInsert(int item);
74 int ItemFromPoint(const TPoint& p, bool scroll = true);
75
76 protected:
77 void SetupWindow() override;
78
79 private:
80 TResult DragNotify(TParam1, TParam2);
81
83};
84
85//
86/// \class TDragListEventHandler
87// ~~~~~ ~~~~~~~~~~~~~~~~~~~~~
88/// A TEventHandler mix-in.
89/// This class is designed to handle the drag list notifications and
90/// forward the messages from the parent window to the TDragList class.
91//
98/// @}
99
100#include <owl/posclass.h>
101
102
103} // OWL namespace
104
105
106#endif // OWL_DRAGLIST_H
107
A TEventHandler mix-in.
Definition draglist.h:92
DECLARE_RESPONSE_TABLE(TDragListEventHandler)
TDragList is a draggable list box.
Definition draglist.h:41
TCursorType
Enumeration used to specify the type of cursor to be displayed during a drag operation.
Definition draglist.h:49
TEventHandler is a base class from which you can derive classes that handle messages.
Definition eventhan.h:162
An interface object that represents a corresponding list box element.
Definition listbox.h:43
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
Definition of classes for CommonControl encapsulation.
Definition of TEventHandler and related classes & macros.
#define DECLARE_RESPONSE_TABLE(cls)
Definition eventhan.h:436
Definition of class TListBox and TlistBoxData.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
LRESULT TResult
Result type.
Definition dispatch.h:52
General definitions used by all ObjectWindows programs.
#define _OWLCLASS
Definition defs.h:338