Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I use the Super Mover?
Message
From
17/07/2001 03:19:37
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00530918
Message ID:
00531393
Views:
16
Hi Chris,

In my private feeling, effective.. and OOP by Markus quite different.
Effective.. was wonderful how to make and treat DE and related things
for logical and physical design..etc and i corrected my framework along with
their good ideas.
As for OOP, i felt it was 123 for design. i regret why i bought this book
so late. From next project, i kept it in mind to follow his rule and would
like stronly recommed you to read this if you feel you are short of OOP.

Following is my poor code to adapt _mover in my form.

* _mover is designed for one column listbox.
* first, fill each list box with array... and
* get the values selected on save.

method : fillcursor
LOCAL loObj,lcCustno,akind[1,2],aselet[1,2],i,j

loObj=Thisform.cgpageframe1.page1

select customer
lcCustno=ALLT(EVAL("KIND"))

&& cuskind is the name of my subclassed mover object
&& make empty both list boxes
loObj.cuskind.lstLeft.clear()
loObj.cuskind.lstRight.clear()

select name from cuskind where code $ lcCustno into array aSelet
store _tally to i
IF i > 0
  && fill left list box with suitable data..
  loObj.cuskind.initselections(@aselet)
ENDIF

select name from cuskind where !EMPTY(name) and  !(code $ lcCustno) into 
                  array akind
store _tally to j

IF j > 0
  && fill right list box in case some values already saved in field
  loObj.cuskind.initchoices(@aKind)
ENDIF
Then your _mover will show selected and not selected items in both list box.
After selection, get the selected items and save somewhere.

method : savekind()
LOCAL aSelected[1,1],loObj,i,j,ty[1,1],t,lcVal

loObj=Thisform.cgpageframe1.page1

&& copied selected items to my preferable array to handle 
=ACOPY(loObj.cuskind.aSelections,aSelected)

i=ALEN(aSelected,1)
lcVal=''

FOR j=1 to i
 select code from cuskind where name=aSelected(j,1) into array ty
 
 IF _tally > 0
  && i saved values like this..101103105..outlawed normalization..^^;;
  lcVal=IIF(LEN(ALLT(lcVal)) > 0,allt(lcVal)+allt(ty[1,1]),allt(ty[1,1]))
 ENDIF
ENDFOR

loObj.cusspec.value=lcVal
i only subclassed from _mover and didn't add or change my method
of properties. You can adjust it whatever shape you want.

Hope ths helps.

RGDS
HK.Lee
MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform