Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memo in grids
Message
De
05/08/1998 09:54:17
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/08/1998 09:22:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00124027
Message ID:
00124044
Vues:
20
>It's to all
>
>Well, I have a table with memo fields and I'm using a grid. I don't know how to show this memo fields in an appropiate interface better than its ugly text field for this case!!!
>
>Need help urgently. Stopped.
You could add an editbox control to column, set currentcontrol to it and set sparse = .f. (if want to show contents all the time). Another alternative could be this class that you would put instead of editbox control. It expands at gotfocus (if in editmode) and shrinks to size of a regular one line textbox. Some retouching to use in grids is needed though.
**************************************************
*-- Class:        expandedit (c:\temp\test.vcx)
*-- ParentClass:  editbox
*-- BaseClass:    editbox
*-- one line expanding edit box
*
DEFINE CLASS expandedit AS editbox


	Height = 25
	Width = 145
	Name = "expandedit"

	*-- original height when got focus
	PROTECTED orgheight

	*-- original width when got focus
	PROTECTED orgwidth

	*-- Expanded height of editbox
	PROTECTED expandedheight

	*-- Expanded width of editbox
	PROTECTED expandedwidth
	nrec = .F.


	PROCEDURE Init
		with this
			.orgheight = .height
			.orgwidth  = .width
			do case
				case .parent.baseclass="Page"		&& We are in a pageframe
					.ExpandedHeight	= .parent.parent.pageheight - .top - 4
					.ExpandedWidth	= .parent.parent.pagewidth - .left - 4
				case .parent.baseclass="Column"		&& We are in a grid
					.ExpandedHeight	= .parent.parent.height - .parent.parent.headerheight ;
									- iif(.parent.parent.scrollbars%2=1,sysmetric(8),0)
					.ExpandedWidth	= .parent.parent.width
					.orgheight		= .parent.parent.rowheight
					.orgwidth		= .parent.width
					.BorderStyle	= 0
				otherwise
					.ExpandedHeight	= .parent.height - .top - 4
					.ExpandedWidth	= .parent.width - .left - 4
			endcase
		endwith
	ENDPROC


	PROCEDURE GotFocus
		WITH this
			thisform.lockscreen = .t.
			IF ( !isnull(evaluate(.controlsource)) and ;
					!empty(evaluate(.controlsource)) ) or ;
					!.readonly
				if .parent.baseclass="Column"		&& We are in a grid
					.parent.parent.rowheight = .ExpandedHeight
					.parent.width = .ExpandedWidth
				else
					.height	= .ExpandedHeight
					.width	= .ExpandedWidth
				endif
				.refresh
			ENDIF
			.zorder(0)
			thisform.lockscreen = .f.
		ENDWITH
	ENDPROC


	PROCEDURE LostFocus
		with this
			if .parent.baseclass="Column"		&& We are in a grid
				.parent.parent.rowheight	= .OrgHeight
				.parent.width				= .OrgWidth
			else
				.height = .orgheight
				.width  = .orgwidth
			endif
			.refresh
		endwith
	ENDPROC


	PROCEDURE RightClick
		keyboard "{TAB}"
	ENDPROC


ENDDEFINE
*
*-- EndDefine: expandedit
**************************************************
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform