| dnaile@cfl.rr.com 2006-12-27, 6:55 pm |
| I hope I can explain this correctly so that everybody can understand
this
I have a custom list box that is populated with a queue. This queue is
generated based on criteria in a file that sets the item as a default
item (this means to place it in the browse upon a new record being
created). I have 50 items in a file, 15 of them are marked as default,
so I now have a browse list pre populated with 15 items in column A,
the user is able to right click below the last item and add any or all
of the remaining items in the file to the browse, they all populate in
the order picked. The user is able to move the items (change order) up
or down, since the items are in a queue, the browse is refreshed every
time an items changes place. The end user would like to be able to add
blank lines to the browse, so as to move an item or two out to
themselves. My question is does anybody have any ideas on how to add
blank records to a queue, or maybe a place holder. so when the list
box is populated it will see it as a blank and move to the next row,
almost like adding or moving items up or down in excel.
The code below is code that moves the items up or down in the list box
or deletes the items. I have to give all of the credit to Gus @ Handy
Tools for creating this code.
Row LONG,AUTO
Choice LONG,AUTO
PopY LONG,AUTO
CODE
SELF.LastQueueAccessed = HPROP:TreatmentQ
CASE EVENT()
OF EVENT:Accepted
CASE KEYCODE()
OF MouseLeft
SELF.TreatmentCellsReselect(True)
PopY = MOUSEY()
ReCycle:
HIDE(HPROP:BrowseCoordCtl)
IF SELF.BrowseMouseDownRow <= RECORDS(SELF.TreatmentQ) THEN
!They've clicked somewhere on a treatment in the list.
Choice = POPUP('[' & PROP:Icon & '(' & CLIP(SELF.CancelIcon)
& ')]Cancel|-|[' & PROP:Icon & '(' & CLIP(SELF.MoveUpIcon) & ')]Move
Up|[' & PROP:Icon & '(' & CLIP(SELF.MoveDownIcon) & ')]Move Down|[' &
PROP:Icon & '(' & CLIP(SELF.RemoveIcon) & ')]Remove|-|' &
SELF. GetUnUsedTreatmentsList(HPROP:CategoryTr
eatment) &
'|',HPROP:TrtHotRegionWidth,PopY,True)
GET(SELF.TreatmentQ, SELF.BrowseMouseDownRow)
IF ERRORCODE() THEN
RETURN LEVEL:Benign
END
ELSE
!They've clicked down below the last treatment. Insert item
below the last one.
Choice = POPUP('[' & PROP:Icon & '(' & CLIP(SELF.CancelIcon)
& ')]Cancel|-|~[' & PROP:Icon & '(' & CLIP(SELF.MoveUpIcon) & ')]Move
Up|~[' & PROP:Icon & '(' & CLIP(SELF.MoveDownIcon) & ')]Move Down|~[' &
PROP:Icon & '(' & CLIP(SELF.RemoveIcon) & ')]Remove|-|' &
SELF. GetUnUsedTreatmentsList(HPROP:CategoryTr
eatment) &
'|',HPROP:TrtHotRegionWidth,PopY,True)
SELF.BrowseMouseDownRow = RECORDS(SELF.TreatmentQ) + 1
END
Row = SELF.BrowseMouseDownRow
CASE Choice
OF 2 !Move up
IF SELF.BrowseMouseDownRow = 1 THEN
SELF.TreatmentCellsReselect(False)
RETURN LEVEL:Benign
END
IF SELF.MoveTimeGridItem(SELF.TreatmentQ.TimeGrid_SYSID,
HPROP:MoveUp)
SELF.RefreshDataRows()
SELF.DrawGridRowLabels()
SELF.BrowseMouseDownRow = Row - 1 !Follow product to
previous row.
SELF.TreatmentCellsReselect(True)
GOTO Recycle:
END
OF 3 !Move Down
IF SELF.BrowseMouseDownRow = RECORDS(SELF.TreatmentQ) THEN
SELF.TreatmentCellsReselect(False)
RETURN LEVEL:Benign
END
IF SELF.MoveTimeGridItem(SELF.TreatmentQ.TimeGrid_SYSID,
HPROP:MoveDown)
SELF.RefreshDataRows()
SELF.DrawGridRowLabels()
SELF.BrowseMouseDownRow = Row + 1 !Follow product to
next row.
SELF.TreatmentCellsReselect(True)
GOTO Recycle:
END
OF 4 !Remove item.
IF SELF.RemoveTimeGridItem(SELF.TreatmentQ.TimeGrid_SYSID)
THEN
SELF.RefreshDataRows()
SELF.DrawGridRowLabels()
SELF.BrowseMouseDownRow = Row !Land on same row.
SELF.TreatmentCellsReselect(True)
END
ELSE
GET(SELF.TreatmentSelQ, Choice - 4) !Relative select on
the popup items created by SELF.GetUnUsedTreatmentsList()
IF NOT ERRORCODE() THEN
IF
SELF.InsertTreatmentByID(SELF.TreatmentSelQ.Treatment_SYSID) THEN
SELF.RefreshDataRows()
SELF.DrawGridRowLabels()
SELF.BrowseMouseDownRow = RECORDS(SELF.TreatmentQ)
SELF.TreatmentCellsReselect(True)
GOTO Recycle:
END
END
END
SELF.TreatmentCellsReselect(False)
END
Thank you for your time
Don Naile
|