S_223FD
* ===================================================================
*
* Component : S_223FD
* Type : Form
* Ancestor : PRIM_FORM
*
* Description : Advanced List Views - Drag and Drop Also
*
* Disclaimer : The following material is supplied as example material
* only. No warranty concerning this material or its use
* in any way whatsoever is expressed or implied.
*
* ===================================================================
FUNCTION Options(*DIRECT)
BEGIN_COM Role(*EXTENDS #PRIM_FORM) Dragstyle(Automatic) Height(402) Layoutmanager(#SPLM_1) Left(188) Top(121) Width(668)
* The Left list Definition. Note the use of the DragStyle(Automatic) property
DEFINE_COM Class(#PRIM_LTVW) Name(#LEFTLIST) Displayposition(1) Dragstyle(Automatic) Fullrowselect(True) Height(375) Left(0) Parent(#LEFT_PANEL) Tabposition(1) Top(0) Width(305)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_1) Displayposition(1) Parent(#LEFTLIST) Sortonclick(True) Sortposition(2) Source(#EMPNO) Width(30)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_2) Displayposition(2) Parent(#LEFTLIST) Sortonclick(True) Sortposition(1) Source(#SURNAME) Width(36)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_3) Displayposition(3) Parent(#LEFTLIST) Sortonclick(True) Sortposition(3) Source(#SALARY) Width(45)
* The Right list Definition. Note the use of the DragStyle(Automatic) property
DEFINE_COM Class(#PRIM_LTVW) Name(#RIGHTLIST) Displayposition(1) Dragstyle(Automatic) Fullrowselect(True) Height(375) Left(0) Parent(#RIGHT_PANEL) Tabposition(1) Top(0) Width(351)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_4) Displayposition(1) Parent(#RIGHTLIST) Sortonclick(True) Sortposition(2) Source(#EMPNO) Width(30)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_5) Displayposition(2) Parent(#RIGHTLIST) Sortonclick(True) Sortposition(1) Source(#SURNAME) Width(40)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_6) Displayposition(3) Parent(#RIGHTLIST) Sortonclick(True) Sortposition(3) Source(#SALARY) Width(45)
* Layout management
DEFINE_COM Class(#PRIM_SPLM) Name(#SPLM_1) Orientation(Vertical)
DEFINE_COM Class(#PRIM_PANL) Name(#LEFT_PANEL) Displayposition(1) Height(375) Layoutmanager(#ATLM_LEFT_PANEL) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Width(305)
DEFINE_COM Class(#PRIM_PANL) Name(#RIGHT_PANEL) Displayposition(2) Height(375) Layoutmanager(#ATLM_RIGHT_PANEL) Left(309) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(0) Width(351)
DEFINE_COM Class(#PRIM_SPLI) Name(#SPLI_LEFT_PANEL) Manage(#LEFT_PANEL) Parent(#SPLM_1) Weight(1)
DEFINE_COM Class(#PRIM_SPLI) Name(#SPLI_RIGHT_PANEL) Manage(#RIGHT_PANEL) Parent(#SPLM_1)
DEFINE_COM Class(#PRIM_ATLM) Name(#ATLM_LEFT_PANEL)
DEFINE_COM Class(#PRIM_ATLI) Name(#ATLI_LEFT_LIST) Attachment(Center) Manage(#LEFTLIST) Parent(#ATLM_LEFT_PANEL)
DEFINE_COM Class(#PRIM_ATLM) Name(#ATLM_RIGHT_PANEL)
DEFINE_COM Class(#PRIM_ATLI) Name(#ATLI_RIGHT_LIST) Attachment(Center) Manage(#RIGHTLIST) Parent(#ATLM_RIGHT_PANEL)
* ===============================
* Handle main form initialization
* ===============================
EVTROUTINE Handling(#com_owner.Initialize)
Define #To_List *char 1 desc('Add to list') Default(L)
* Fill the left and right lists alternatively
Select Fields(#LeftList) From_File(PSLMST)
If '#To_List = L'
Add_Entry To_List(#LeftList)
Change #To_List R
Else
Add_Entry To_List(#RightList)
Change #To_List L
Endif
ENDSELECT
ENDROUTINE
* ===============================================
* Handle drag over either the left or right lists
* ===============================================
EVTROUTINE Handling(#LeftList.DragOver #RightList.DragOver) ACCEPTDROP(#AcceptDrop)
Set #AcceptDrop Value(True)
ENDROUTINE
* =================================
* Handle a drop into the right list
* =================================
EVTROUTINE Handling(#RightList.DragDrop)
* Go through the left list and move all the selected items
* (ie: the employees being dragged) into the right list.
SelectList #LeftList
Continue If('#LeftList.Currentitem.Selected *ne True')
Add_Entry #RightList
Dlt_Entry *Current #LeftList
EndSelect
ENDROUTINE
* ================================
* Handle a drop into the left list
* ================================
EVTROUTINE Handling(#LeftList.DragDrop)
* Go through the right list and move all the selected items
* (ie: the employees being dragged) into the left list.
SelectList #RightList
Continue If('#RightList.Currentitem.Selected *ne True')
Add_Entry #LeftList
Dlt_Entry *Current #RightList
EndSelect
ENDROUTINE
END_COM
* ===================================================================
*
* Component : S_223FD
* Type : Form
* Ancestor : PRIM_FORM
*
* Description : Advanced List Views - Drag and Drop Also
*
* Disclaimer : The following material is supplied as example material
* only. No warranty concerning this material or its use
* in any way whatsoever is expressed or implied.
*
* ===================================================================
FUNCTION Options(*DIRECT)
BEGIN_COM Role(*EXTENDS #PRIM_FORM) Dragstyle(Automatic) Height(402) Layoutmanager(#SPLM_1) Left(188) Top(121) Width(668)
* The Left list Definition. Note the use of the DragStyle(Automatic) property
DEFINE_COM Class(#PRIM_LTVW) Name(#LEFTLIST) Displayposition(1) Dragstyle(Automatic) Fullrowselect(True) Height(375) Left(0) Parent(#LEFT_PANEL) Tabposition(1) Top(0) Width(305)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_1) Displayposition(1) Parent(#LEFTLIST) Sortonclick(True) Sortposition(2) Source(#EMPNO) Width(30)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_2) Displayposition(2) Parent(#LEFTLIST) Sortonclick(True) Sortposition(1) Source(#SURNAME) Width(36)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_3) Displayposition(3) Parent(#LEFTLIST) Sortonclick(True) Sortposition(3) Source(#SALARY) Width(45)
* The Right list Definition. Note the use of the DragStyle(Automatic) property
DEFINE_COM Class(#PRIM_LTVW) Name(#RIGHTLIST) Displayposition(1) Dragstyle(Automatic) Fullrowselect(True) Height(375) Left(0) Parent(#RIGHT_PANEL) Tabposition(1) Top(0) Width(351)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_4) Displayposition(1) Parent(#RIGHTLIST) Sortonclick(True) Sortposition(2) Source(#EMPNO) Width(30)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_5) Displayposition(2) Parent(#RIGHTLIST) Sortonclick(True) Sortposition(1) Source(#SURNAME) Width(40)
DEFINE_COM Class(#PRIM_LVCL) Name(#LVCL_6) Displayposition(3) Parent(#RIGHTLIST) Sortonclick(True) Sortposition(3) Source(#SALARY) Width(45)
* Layout management
DEFINE_COM Class(#PRIM_SPLM) Name(#SPLM_1) Orientation(Vertical)
DEFINE_COM Class(#PRIM_PANL) Name(#LEFT_PANEL) Displayposition(1) Height(375) Layoutmanager(#ATLM_LEFT_PANEL) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Width(305)
DEFINE_COM Class(#PRIM_PANL) Name(#RIGHT_PANEL) Displayposition(2) Height(375) Layoutmanager(#ATLM_RIGHT_PANEL) Left(309) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(0) Width(351)
DEFINE_COM Class(#PRIM_SPLI) Name(#SPLI_LEFT_PANEL) Manage(#LEFT_PANEL) Parent(#SPLM_1) Weight(1)
DEFINE_COM Class(#PRIM_SPLI) Name(#SPLI_RIGHT_PANEL) Manage(#RIGHT_PANEL) Parent(#SPLM_1)
DEFINE_COM Class(#PRIM_ATLM) Name(#ATLM_LEFT_PANEL)
DEFINE_COM Class(#PRIM_ATLI) Name(#ATLI_LEFT_LIST) Attachment(Center) Manage(#LEFTLIST) Parent(#ATLM_LEFT_PANEL)
DEFINE_COM Class(#PRIM_ATLM) Name(#ATLM_RIGHT_PANEL)
DEFINE_COM Class(#PRIM_ATLI) Name(#ATLI_RIGHT_LIST) Attachment(Center) Manage(#RIGHTLIST) Parent(#ATLM_RIGHT_PANEL)
* ===============================
* Handle main form initialization
* ===============================
EVTROUTINE Handling(#com_owner.Initialize)
Define #To_List *char 1 desc('Add to list') Default(L)
* Fill the left and right lists alternatively
Select Fields(#LeftList) From_File(PSLMST)
If '#To_List = L'
Add_Entry To_List(#LeftList)
Change #To_List R
Else
Add_Entry To_List(#RightList)
Change #To_List L
Endif
ENDSELECT
ENDROUTINE
* ===============================================
* Handle drag over either the left or right lists
* ===============================================
EVTROUTINE Handling(#LeftList.DragOver #RightList.DragOver) ACCEPTDROP(#AcceptDrop)
Set #AcceptDrop Value(True)
ENDROUTINE
* =================================
* Handle a drop into the right list
* =================================
EVTROUTINE Handling(#RightList.DragDrop)
* Go through the left list and move all the selected items
* (ie: the employees being dragged) into the right list.
SelectList #LeftList
Continue If('#LeftList.Currentitem.Selected *ne True')
Add_Entry #RightList
Dlt_Entry *Current #LeftList
EndSelect
ENDROUTINE
* ================================
* Handle a drop into the left list
* ================================
EVTROUTINE Handling(#LeftList.DragDrop)
* Go through the right list and move all the selected items
* (ie: the employees being dragged) into the left list.
SelectList #RightList
Continue If('#RightList.Currentitem.Selected *ne True')
Add_Entry #LeftList
Dlt_Entry *Current #RightList
EndSelect
ENDROUTINE
END_COM