Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11114

Re: bBrowser cell color

From Martin <Martin@spam.spam>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: bBrowser cell color
Date 2017-10-31 15:12 +0000
Organization A noiseless patient Spider
Message-ID <ota3s8$f5l$1@dont-email.me> (permalink)
References <781533f1-4af6-4b80-b38c-6e98fa1a30d8@googlegroups.com> <ot9p3r$orr$1@dont-email.me> <a204c48a-ab3e-4c0d-bba6-2289937e5976@googlegroups.com>

Show all headers | View raw


In this case I would put the colour flag back into the base server and 
run a simple condition which sets the colour rather than build condition 
on the fly.

I have often added an array server to a data server to create a special 
data server with everything merged in.

On 31/10/2017 13:32, ccyasa.sbassano@gmail.com wrote:
> El martes, 31 de octubre de 2017, 9:08:28 (UTC-3), Martin escribió:
>> What do you want to actually achieve?
>>
>> I have done some interesting things with this.
>>
>> On 27/10/2017 00:31, ... wrote:
>>> Hi everyone, there is a simple way to paint a cell indicating row (or recno) and column?
>>> Today, if i want to paint a cell i use color conditions on columns and puts as condition something like:
>>> Server:Recno = 1 .OR. Server:Recno = 7 .OR. Server:Recno = 23 .OR. and so on...
>>>
>>> but i think tha must be a better solution.
>>> Regards.
>>>
>>> Sebastián
>>>
> 
> Hi, the code that i use is similar to this one:
> 
> PROTECT METHOD _HighlightDifferencesBetweenAdjacentRecords() CLASS MyDialog
> 
> 	LOCAL aRecord:= {} AS ARRAY
> 	LOCAL aColorCondition:= {} AS ARRAY
> 	LOCAL cColorCondition:= NULL_STRING AS STRING
> 	LOCAL dwColumn:= 1 AS DWORD
> 	LOCAL oColumn AS bDataColumn
> 
> 	//	The table has more than one record and the comparable coluns are configured
> 	IF (SELF:oDCBBTable:Server:RecCount > 1) .AND. !Empty(SELF:aComparableColumns)
> 		SELF:oDCBBTable:SuspendNotification()
> 		SELF:oDCBBTable:Server:GoTop()
> 
> 		//	Initialize the color conditions array
> 		aColorCondition:= ArrayNew(SELF:oDCBBTable:Server:FCount)
> 		AEvalA(aColorCondition, {|aElement| aElement:= {}})
> 
> 		// Copy the current record to an array
> 		aRecord:= DataServerHelper{}:RecordAsArray(SELF:oDCBBTable:Server)
> 
> 		//	Move to second record, at this momente we have the first record in the array and the second record pointed by the table cursor.
> 		SELF:oDCBBTable:Server:Skip()
> 		DO WHILE !SELF:oDCBBTable:Server:EoF
> 			//	Collect the records with differences in the comparable columns
> 			FOR dwColumn:= 1 UPTO ALen(aRecord)
> 				IF (AScanExact(SELF:aComparableColumns, SELF:oDCBBTable:Server:FieldSym(dwColumn)) > 0)
> 					IF !(aRecord[dwColumn] == SELF:oDCBBTable:Server:FieldGet(dwColumn))
> 						AAdd(aColorCondition[dwColumn], "Server:RecNo = " + NTrim(SELF:oDCBBTable:Server:RecNo))
> 					ENDIF
> 				ENDIF
> 			NEXT
> 
> 			//	Copy the current record to the array
> 			aRecord:= DataServerHelper{}:RecordAsArray(SELF:oDCBBTable:Server)
> 
> 			//	Move to next record, the previous record is in the array and the cureent one is pointed by tehe table cursor
> 			SELF:oDCBBTable:Server:Skip()
> 		ENDDO
> 
> 		//	Add all the color conditions
> 		FOR dwColumn:= 1 UPTO ALen(aColorCondition)
> 			IF !Empty(aColorCondition[dwColumn])
> 				cColorCondition:= ArrayHelper{}:Join(" .OR. ", aColorCondition[dwColumn])
> 				oColumn:= SELF:oDCBBTable:GetOpenColumn(SELF:oDCBBTable:Server:FieldName(dwColumn))
> 				oColumn:ColorCondition:Clear()
> 				oColumn:ColorCondition:Add(;
> 					bColorCondition{;
> 						cColorCondition,;
> 						SELF:oDCBBTable:Server,;
> 						NIL,;
> 						Brush{Color{COLORRED}};
> 					};
> 				)
> 			ENDIF
> 		NEXT
> 
> 		//	Refresh the bBrowser
> 		SELF:oDCBBTable:Refresh()
> 		SELF:oDCBBTable:ResetNotification()
> 		SELF:oDCBBTable:Server:GoTop()
> 	ENDIF
> 
> 	RETURN NIL
> 
> The result is like that the one showed in the link:
> http://es.tinypic.com/view.php?pic=30b1suf&s=9
> 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-26 16:31 -0700
  Re: bBrowser cell color "Glen Townsley" <coogee.2015@gmail.com> - 2017-10-28 05:55 +1000
    Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-28 05:38 -0700
  Re: bBrowser cell color Martin <Martin@spam.spam> - 2017-10-31 12:08 +0000
    Re: bBrowser cell color "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2017-10-31 13:12 +0100
      Re: bBrowser cell color Martin <Martin@spam.spam> - 2017-10-31 15:06 +0000
    Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-31 06:32 -0700
      Re: bBrowser cell color James Martin <james@northwoodlumber.com> - 2017-10-31 10:33 -0400
        Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-31 07:58 -0700
        Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-31 08:00 -0700
      Re: bBrowser cell color Martin <Martin@spam.spam> - 2017-10-31 15:12 +0000
        Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-31 09:07 -0700

csiph-web