Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anchor builder
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01124590
Message ID:
01124679
Vues:
9
Here is the class code. I don't understand, what's wrong:
**************************************************
*-- Class:        cntmover (c:\mmviscollect\libs\areportcontrols.vcx)
*-- ParentClass:  ccontainer (c:\mmortals\common30\libs\ccontrls.vcx)
*-- BaseClass:    container
*-- Time Stamp:   05/24/06 04:10:09 PM
*-- Mover container 
*
DEFINE CLASS cntmover AS ccontainer


	Anchor = 15
	Width = 379
	Height = 210
	BorderWidth = 1
	TabIndex = 1
	Name = "cntmover"


	ADD OBJECT lstinput AS clistbox WITH ;
		Anchor = 135, ;
		ColumnCount = 2, ;
		ColumnWidths = "250,0", ;
		RowSourceType = 0, ;
		Height = 180, ;
		ColumnLines = .F., ;
		Left = 4, ;
		TabIndex = 10, ;
		Top = 24, ;
		Width = 160, ;
		ZOrderSet = 11, ;
		Name = "lstInput"


	ADD OBJECT lstoutput AS clistbox WITH ;
		Anchor = 45, ;
		ColumnCount = 2, ;
		ColumnWidths = "250,0", ;
		RowSourceType = 0, ;
		Height = 180, ;
		ColumnLines = .F., ;
		Left = 211, ;
		TabIndex = 10, ;
		Top = 24, ;
		Width = 160, ;
		ZOrderSet = 11, ;
		Name = "lstOutput"


	ADD OBJECT cmdfeedtoright AS ccommandbutton WITH ;
		Top = 70, ;
		Left = 169, ;
		Height = 22, ;
		Width = 39, ;
		Anchor = 768, ;
		Caption = ">", ;
		Name = "cmdFeedToRight"


	ADD OBJECT cmdfeedalltoright AS ccommandbutton WITH ;
		Top = 92, ;
		Left = 169, ;
		Height = 22, ;
		Width = 39, ;
		Anchor = 768, ;
		Caption = ">>", ;
		Name = "cmdFeedAllToRight"


	ADD OBJECT cmdfeedtoleft AS ccommandbutton WITH ;
		Top = 118, ;
		Left = 169, ;
		Height = 22, ;
		Width = 39, ;
		Anchor = 768, ;
		Caption = "<", ;
		Name = "cmdFeedToLeft"


	ADD OBJECT cmdfeedalltoleft AS ccommandbutton WITH ;
		Top = 140, ;
		Left = 169, ;
		Height = 22, ;
		Width = 39, ;
		Anchor = 768, ;
		Caption = "<<", ;
		Name = "cmdFeedAllToLeft"


	ADD OBJECT lbloptions AS clabel WITH ;
		FontBold = .T., ;
		Caption = "Caption", ;
		Left = 4, ;
		Top = 4, ;
		Width = 44, ;
		Name = "lblOptions"


	*-- Refreshes the listbox
	PROCEDURE listrefresh
		*---------------------- Location Section ------------------------
		*   Library: 	Areportcontrols.vcx
		*   Class: 		Cntmover  
		*   Method: 	Listrefresh() 
		*----------------------- Usage Section --------------------------
		*)  Description: 
		*)

		*   Scope:      Public
		*   Parameters: 
		*$  Usage:      
		*$              
		*   Returns:  
		*--------------------- Maintenance Section ----------------------
		*   Change Log:
		*       CREATED 	05/24/2006 - NN 
		*		MODIFIED
		*----------------------------------------------------------------
		lparameters toThis
		local lnIndex, lnTotItem

		lnTotItem = toThis.listcount
		if !empty(m.lnTotItem)
			local array aListItem(m.lnTotItem)
			for lnIndex =  1 to m.lnTotItem
				aListItem(m.lnIndex) = toThis.list(m.lnIndex,1)
			next
			toThis.clear()
			for lnIndex =  1 to m.lnTotItem
				if !empty(aListItem(m.lnIndex))
					toThis.additem(aListItem(m.lnIndex))
				endif
			next
		endif
	ENDPROC


	PROCEDURE Refresh
		with this
			store .t. to ;
				.cmdFeedAllToRight.enabled, ;
				.cmdFeedToRight.enabled, ;
				.cmdFeedAllToLeft.enabled, ;
				.cmdFeedToLeft.enabled
			if .lstOutput.listcount = 0
				store .f. to ;
				.cmdFeedAllToLeft.enabled, ;
					.cmdFeedToLeft.enabled
			endif
			if .lstInput.listcount = 0
				store .f. to ;
					.cmdFeedAllToRight.enabled, ;
					.cmdFeedToRight.enabled
			endif
		endwith
	ENDPROC


	PROCEDURE lstinput.DblClick
		This.parent.cmdFeedToRight.Click()
	ENDPROC


	PROCEDURE lstoutput.DblClick
		this.Parent.cmdFeedToLeft.Click()
	ENDPROC


	PROCEDURE cmdfeedtoright.Click
		*---------------------- Location Section ------------------------
		*   Library: 	Areportcontrols.vcx
		*   Class: 		Cntmover
		*   Method: 	Cmdfeedtoright.Click()
		*----------------------- Usage Section --------------------------
		*)  Description:
		*)

		*   Scope:      Public
		*   Parameters:
		*$  Usage:
		*$
		*   Returns:
		*--------------------- Maintenance Section ----------------------
		*   Change Log:
		*       CREATED 	05/24/2006 - NN
		*		MODIFIED
		*----------------------------------------------------------------
		local lcSelect, lnIndex
		lnIndex = this.parent.lstInput.listindex
		if m.lnIndex # 0
			lcSelect = this.parent.lstInput.list(m.lnIndex,1)
			this.parent.lstOutput.additem(m.lcSelect)
			this.parent.lstInput.removelistitem(m.lnIndex)
		endif
		this.Parent.ListRefresh(this.Parent.lstInput) 
		this.parent.refresh()
	ENDPROC


	PROCEDURE cmdfeedalltoright.Click
		*---------------------- Location Section ------------------------
		*   Library: 	Areportcontrols.vcx
		*   Class: 		Cntmover
		*   Method: 	Cmdfeedalltoright.Click()
		*----------------------- Usage Section --------------------------
		*)  Description:
		*)

		*   Scope:      Public
		*   Parameters:
		*$  Usage:
		*$
		*   Returns:
		*--------------------- Maintenance Section ----------------------
		*   Change Log:
		*       CREATED 	05/24/2006 - NN
		*		MODIFIED
		*----------------------------------------------------------------
		local lcSelect, lnIndex, lnTotItem
		lnTotItem = this.parent.lstInput.listcount
		for lnIndex =  1 to m.lnTotItem
			lcSelect = this.parent.lstInput.list(m.lnIndex,1)
			this.parent.lstOutput.additem(m.lcSelect)
		next
		for lnIndex =  1 to m.lnTotItem
			this.parent.lstInput.removelistitem(m.lnIndex)
		next

		this.parent.refresh()
	ENDPROC


	PROCEDURE cmdfeedtoleft.Click
		*---------------------- Location Section ------------------------
		*   Library: 	Areportcontrols.vcx
		*   Class: 		Cntmover  
		*   Method: 	Cmdfeedtoleft.Click() 
		*----------------------- Usage Section --------------------------
		*)  Description: 
		*)

		*   Scope:      Public
		*   Parameters: 
		*$  Usage:      
		*$              
		*   Returns:  
		*--------------------- Maintenance Section ----------------------
		*   Change Log:
		*       CREATED 	05/24/2006 - NN 
		*		MODIFIED
		*----------------------------------------------------------------
		LOCAL lcSelect, lnIndex
		lnIndex = this.parent.lstOutput.ListIndex
		IF m.lnIndex # 0
			lcSelect = this.parent.lstOutput.LIST(m.lnIndex,1)
			this.parent.lstInput.AddItem(m.lcSelect)
			this.parent.lstOutput.RemoveListItem(m.lnIndex) 
		ENDIF
		this.Parent.ListRefresh(this.Parent.lstOutput)  
		this.parent.refresh()
	ENDPROC


	PROCEDURE cmdfeedalltoleft.Click
		*---------------------- Location Section ------------------------
		*   Library: 	Areportcontrols.vcx
		*   Class: 		Cntmover
		*   Method: 	Cmdfeedalltoleft.Click()
		*----------------------- Usage Section --------------------------
		*)  Description:
		*)

		*   Scope:      Public
		*   Parameters:
		*$  Usage:
		*$
		*   Returns:
		*--------------------- Maintenance Section ----------------------
		*   Change Log:
		*       CREATED 	05/24/2006 - NN
		*		MODIFIED
		*----------------------------------------------------------------
		local lcSelect, lnIndex, lnTotItem
		lnTotItem = this.parent.lstOutput.listcount
		for lnIndex =  1 to m.lnTotItem
			lcSelect = this.parent.lstOutput.list(m.lnIndex,1)
			this.parent.lstInput.additem(m.lcSelect)
		next
		for lnIndex =  1 to m.lnTotItem
			this.parent.lstOutput.removelistitem(m.lnIndex)
		next
		this.parent.refresh()
	ENDPROC


ENDDEFINE
*
*-- EndDefine: cntmover
**************************************************
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform