OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
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
28
namespace
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
//
41
class
_OWLCLASS
TDragList
:
public
TListBox
{
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
//
49
enum
TCursorType
{
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
82
DECLARE_RESPONSE_TABLE
(
TDragList
);
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
//
92
class
_OWLCLASS
TDragListEventHandler
:
virtual
public
TEventHandler
{
93
public
:
94
TResult
DragNotify
(
TParam1
,
TParam2
);
95
96
DECLARE_RESPONSE_TABLE
(
TDragListEventHandler
);
97
};
98
/// @}
99
100
#include <
owl/posclass.h
>
101
102
103
}
// OWL namespace
104
105
106
#endif
// OWL_DRAGLIST_H
107
owl::TDragListEventHandler
A TEventHandler mix-in.
Definition
draglist.h:92
owl::TDragListEventHandler::DragNotify
TResult DragNotify(TParam1, TParam2)
Forward the drag notification messages from the parent window to the drag listbox for it to handle.
Definition
draglist.cpp:160
owl::TDragListEventHandler::DECLARE_RESPONSE_TABLE
DECLARE_RESPONSE_TABLE(TDragListEventHandler)
owl::TDragList
TDragList is a draggable list box.
Definition
draglist.h:41
owl::TDragList::TDragList
TDragList(TWindow *parent, int id, int x, int y, int w, int h, TModule *module=0)
Constructor for creating a drag list dynamically.
Definition
draglist.cpp:26
owl::TDragList::TCursorType
TCursorType
Enumeration used to specify the type of cursor to be displayed during a drag operation.
Definition
draglist.h:49
owl::TDragList::dlCopy
@ dlCopy
copy cursor - item dragged will be copied
Definition
draglist.h:51
owl::TDragList::dlMove
@ dlMove
move cursor - item dragged will be moved
Definition
draglist.h:52
owl::TDragList::dlStop
@ dlStop
stop cursor - item cannot be dropped now
Definition
draglist.h:50
owl::TEventHandler
TEventHandler is a base class from which you can derive classes that handle messages.
Definition
eventhan.h:162
owl::TListBox::TListBox
TListBox(TWindow *parent, int id, int x, int y, int w, int h, TModule *module=0)
Constructs a list box object with the supplied parent window (parent) library ID (module),...
Definition
listbox.cpp:175
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
owl::TPoint
TPoint is a support class, derived from tagPOINT.
Definition
geometry.h:87
owl::TWindow
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition
window.h:414
commctrl.h
Definition of classes for CommonControl encapsulation.
eventhan.h
Definition of TEventHandler and related classes & macros.
DECLARE_RESPONSE_TABLE
#define DECLARE_RESPONSE_TABLE(cls)
Definition
eventhan.h:436
listbox.h
Definition of class TListBox and TlistBoxData.
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::TParam2
LPARAM TParam2
Second parameter type.
Definition
dispatch.h:55
owl::TParam1
WPARAM TParam1
First parameter type.
Definition
dispatch.h:54
owl::TResult
LRESULT TResult
Result type.
Definition
dispatch.h:52
defs.h
General definitions used by all ObjectWindows programs.
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
draglist.h
Generated by
1.18.0