TbrwColumn event setting after create()
Publicado: Mié May 16, 2007 1:37 pm
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
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