Página 1 de 1

TbrwColumn event setting after create()

Publicado: Mié May 16, 2007 1:37 pm
por Gejza Horvath
Hi,
I want to set the OnDrawCell event handling on the fly for TbrColumn object. When I set it
in the IDE, the generated code looks like this:
WITH OBJECT TArrayBrwColumn():New( ::oDBBrowse1 )
:cHeader := "Column1"
:cFooter := "Spolu"
:nWidth := 129
:nFooterImage := 10
:OnDrawCell := "RowColoring"
:Create()
END
and works fine.
The displayed dataset in the oDbfBrowse2 is dynamically changed by user, so I don't know
at the design time, which columns will be displayed, but I want to set the OnDrawCell
event, therefore I try:
METHOD FormInitialize( oSender ) CLASS TForm2
AEVAL(::oDbfBrowse2:aCols,{|x| x:OnDrawCell := "RowColoring"})
RETURN Nil
Executing the FormInitialize() method I get this error:
******************************* Error log file ********************************
Date: 16.05.2007
Time: 13:32:15
Available Memory: 147364
Current Area: 2
---------------------------- Compiler Information -----------------------------
Xailer Version: Xailer 1.3.2 Version 1.3b
Compiler: xHarbour build 0.99.61 Intl. (SimpLex) PCode Version: 7
C/C++ Compiler: Borland C++ 5.5.1
Windows Platform: Windows XP Professional 5.01.2600 Service Pack 2
--------------------- Internal Error Handling Information ---------------------
Subsystem Call: BASE
System Code: 1004
Default Status: .F.
Description: No exported method
Operation: RowColoring
Arguments:
Involved File:
Dos Error Code: 0
Trace Through:
(b)TFORM2:FORMINITIALIZE (50)
AEVAL (0)
TFORM2:FORMINITIALIZE (50)
TFORM2:ONINITIALIZE (0)
TFORM2:NEW (183)
TFORM1:OPTIONLIST2ITEM1CLICK (104)
TOPTIONITEM:ONCLICK (0)
TOPTIONITEM:CLICK (273)
TOPTIONLIST:WMLBUTTONDOWN (0)
RUNFORM (0)
TAPPLICATION:RUN (208)
MAIN (17)
***************************************************
It isn't possible set this event after the control is created?
Gejza Horvath

TbrwColumn event setting after create()

Publicado: Mié May 16, 2007 4:23 pm
por ignacio
Gejza,
>
> The displayed dataset in the oDbfBrowse2 is dynamically changed by user,
> so I don't know at the design time, which columns will be displayed, but I
> want to set the OnDrawCell
Take a look at method TBrowse:ColAtIndex()
> AEVAL(::oDbfBrowse2:aCols,{|x| x:OnDrawCell := "RowColoring"})
Check the method RowColoring is defined on your TFORM??? module.
If is definded maybe is not working due the use of a code-block on the
OnDrawCell asignment of the event. Try to do the same job without AEVAL() or
do the following:
AEVAL(::oDbfBrowse2:aCols,{|x| x:OnDrawCell := {|oCol|
oCol:oParent:RowColoring()})
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
news:[email=464aed3b@ozsrv2.ozlan.local...]464aed3b@ozsrv2.ozlan.local...[/email]
> Hi,
>
> I want to set the OnDrawCell event handling on the fly for TbrColumn
> object. When I set it in the IDE, the generated code looks like this:
>
> WITH OBJECT TArrayBrwColumn():New( ::oDBBrowse1 )
> :cHeader := "Column1"
> :cFooter := "Spolu"
> :nWidth := 129
> :nFooterImage := 10
> :OnDrawCell := "RowColoring"
> :Create()
> END
> and works fine.
>
> The displayed dataset in the oDbfBrowse2 is dynamically changed by user,
> so I don't know at the design time, which columns will be displayed, but I
> want to set the OnDrawCell event, therefore I try:
>
> METHOD FormInitialize( oSender ) CLASS TForm2
> AEVAL(::oDbfBrowse2:aCols,{|x| x:OnDrawCell := "RowColoring"})
> RETURN Nil
>
> Executing the FormInitialize() method I get this error:
>
> ******************************* Error log file
> ********************************
>
> Date: 16.05.2007
> Time: 13:32:15
> Available Memory: 147364
> Current Area: 2
>
> ---------------------------- Compiler
> Information -----------------------------
>
> Xailer Version: Xailer 1.3.2 Version 1.3b
> Compiler: xHarbour build 0.99.61 Intl. (SimpLex) PCode Version: 7
> C/C++ Compiler: Borland C++ 5.5.1
> Windows Platform: Windows XP Professional 5.01.2600 Service Pack 2
>
> --------------------- Internal Error Handling
> Information ---------------------
>
> Subsystem Call: BASE
> System Code: 1004
> Default Status: .F.
> Description: No exported method
> Operation: RowColoring
> Arguments:
> Involved File:
> Dos Error Code: 0
>
> Trace Through:
> (b)TFORM2:FORMINITIALIZE (50)
> AEVAL (0)
> TFORM2:FORMINITIALIZE (50)
> TFORM2:ONINITIALIZE (0)
> TFORM2:NEW (183)
> TFORM1:OPTIONLIST2ITEM1CLICK (104)
> TOPTIONITEM:ONCLICK (0)
> TOPTIONITEM:CLICK (273)
> TOPTIONLIST:WMLBUTTONDOWN (0)
> RUNFORM (0)
> TAPPLICATION:RUN (208)
> MAIN (17)
> ***************************************************
>
> It isn't possible set this event after the control is created?
>
>
> Gejza Horvath
>
>

TbrwColumn event setting after create()

Publicado: Jue May 17, 2007 4:18 pm
por Gejza Horvath
Ignacio,
thanks, this code does the job:
FOR i := 1 TO LEN(::oDbfBrowse2:aCols)
::oDbfBrowse2:aCols:OnDrawCell := "RowColoring"
NEXT
Gejza Horvath
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
news:464b13cd$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gejza,
>
>>
>> The displayed dataset in the oDbfBrowse2 is dynamically changed by user, so I don't
>> know at the design time, which columns will be displayed, but I want to set the
>> OnDrawCell
>
> Take a look at method TBrowse:ColAtIndex()
>
>> AEVAL(::oDbfBrowse2:aCols,{|x| x:OnDrawCell := "RowColoring"})
>
> Check the method RowColoring is defined on your TFORM??? module.
>
> If is definded maybe is not working due the use of a code-block on the OnDrawCell
> asignment of the event. Try to do the same job without AEVAL() or do the following:
>
> AEVAL(::oDbfBrowse2:aCols,{|x| x:OnDrawCell := {|oCol| oCol:oParent:RowColoring()})
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> http://www.xailer.com
>
>
> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
> news:[email=464aed3b@ozsrv2.ozlan.local...]464aed3b@ozsrv2.ozlan.local...[/email]
>> Hi,
>>
>> I want to set the OnDrawCell event handling on the fly for TbrColumn object. When I set
>> it in the IDE, the generated code looks like this:
>>
>> WITH OBJECT TArrayBrwColumn():New( ::oDBBrowse1 )
>> :cHeader := "Column1"
>> :cFooter := "Spolu"
>> :nWidth := 129
>> :nFooterImage := 10
>> :OnDrawCell := "RowColoring"
>> :Create()
>> END
>> and works fine.
>>
>> The displayed dataset in the oDbfBrowse2 is dynamically changed by user, so I don't
>> know at the design time, which columns will be displayed, but I want to set the
>> OnDrawCell event, therefore I try:
>>
>> METHOD FormInitialize( oSender ) CLASS TForm2
>> AEVAL(::oDbfBrowse2:aCols,{|x| x:OnDrawCell := "RowColoring"})
>> RETURN Nil
>>
>> Executing the FormInitialize() method I get this error:
>>
>> ******************************* Error log file ********************************
>>
>> Date: 16.05.2007
>> Time: 13:32:15
>> Available Memory: 147364
>> Current Area: 2
>>
>> ---------------------------- Compiler Information -----------------------------
>>
>> Xailer Version: Xailer 1.3.2 Version 1.3b
>> Compiler: xHarbour build 0.99.61 Intl. (SimpLex) PCode Version: 7
>> C/C++ Compiler: Borland C++ 5.5.1
>> Windows Platform: Windows XP Professional 5.01.2600 Service Pack 2
>>
>> --------------------- Internal Error Handling Information ---------------------
>>
>> Subsystem Call: BASE
>> System Code: 1004
>> Default Status: .F.
>> Description: No exported method
>> Operation: RowColoring
>> Arguments:
>> Involved File:
>> Dos Error Code: 0
>>
>> Trace Through:
>> (b)TFORM2:FORMINITIALIZE (50)
>> AEVAL (0)
>> TFORM2:FORMINITIALIZE (50)
>> TFORM2:ONINITIALIZE (0)
>> TFORM2:NEW (183)
>> TFORM1:OPTIONLIST2ITEM1CLICK (104)
>> TOPTIONITEM:ONCLICK (0)
>> TOPTIONITEM:CLICK (273)
>> TOPTIONLIST:WMLBUTTONDOWN (0)
>> RUNFORM (0)
>> TAPPLICATION:RUN (208)
>> MAIN (17)
>> ***************************************************
>>
>> It isn't possible set this event after the control is created?
>>
>>
>> Gejza Horvath
>>
>>
>
>
>