I noticed from your error log that you are using a very old version of Xbase++ (build 331).
I get completely different results than you do because I don't know what version (builld) of eXpress++ you are using.
You need to tell me this before I can help you.
DCCHART Sample
Re: DCCHART Sample
The eXpress train is coming - and it has more cars.
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: DCCHART Sample
Hi Roger,
I'm using Express++ 1.9.260
Regards,
Andy
I'm using Express++ 1.9.260
Regards,
Andy
Re: DCCHART Sample
ok, i see why the change i gave you made no improvement.
You are still using Xbase++ 331 which doesn't support the GetPointerPos() function, therefore the code never even gets compiled. If you put a Sleep(10) where shown below, you will see an improvement.
As far as your error is concerned when clicking the mouse.
I don't get that error if the WTF is removed from the code block.
You are still using Xbase++ 331 which doesn't support the GetPointerPos() function, therefore the code never even gets compiled. If you put a Sleep(10) where shown below, you will see an improvement.
As far as your error is concerned when clicking the mouse.
I don't get that error if the WTF is removed from the code block.
Code: Select all
#if XPPVER > 1900345
nSeconds := Seconds()
aPos := GetPointerPos()
IF Empty(::toolTipWindow) .OR. !::toolTipWindow:isVisible()
DO WHILE Seconds() - nSeconds < .3
aPos1 := GetPointerPos()
IF aPos1[1] # aPos[1] .OR. aPos1[2] # aPos[2]
Sleep(0)
RETURN nil
ENDIF
ENDDO
ENDIF
#endif
Sleep(10) // <<<<<<<<<<<<<<<<<< add this
The eXpress train is coming - and it has more cars.
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: DCCHART Sample
Hi Roger,
It will run the :showtooltip method, but when it hits this code in _dcrmcht.prg , it fails. Because aData is nil
I know the aData is nil from putting (wtf aData) in the DCREAD like so.
How can I make sure that that aData is not nil? Isn't aData should be populated from the DCADDBARGROUP, etc commands?
I'm using xbase 1.9.331 and express++ 1.9.260
Regards,
Andy
I received the error not when I click the mouse, but when I start the sample and the mouse moves. Which is fromrdonnay wrote:As far as your error is concerned when clicking the mouse.
I don't get that error if the WTF is removed from the code block
Code: Select all
oRmChart:mouseMove :={|nMouseButton,b,nX,nY,aData| oRMChart:showToolTip( nMouseButton, nX, nY, aData )}
Code: Select all
nRegion := aData[5,2]
I know the aData is nil from putting (wtf aData) in the DCREAD like so.
Code: Select all
DCREAD GUI ;
SETAPPWINDOW ;
FIT ;
TITLE 'DCRMCHART Sample Program' ;
OPTIONS GetOptions ;
EVAL {||oRMChart:RMCToolTipWidth := 100, ;
oRMChart:RMCUserWatermark := 'eXpress++ RMChart System', ;
oRMChart:RMCUserWMAlignment := RMC_TEXTRIGHT, ;
oRMChart:RMCUserWMFontSize := 32, ;
oRMChart:RMCUserWMLucent := 40, ;
oRmChart:mouseDown := ;
{|a,b,c,d,e,o|wtf e, aData := e,nWhich := a,o:=Thread():new(),o:start({||BrowseCallbackData(nWhich,aData,oRMChart)})}, ;
oRmChart:mouseMove := ;
{|nMouseButton,b,nX,nY,aData| oRMChart:showToolTip( nMouseButton, nX, nY, aData )}, ;
oRmChart:draw(), (wtf aData) }
I'm using xbase 1.9.331 and express++ 1.9.260
Regards,
Andy
Re: DCCHART Sample
Andy, i think inside a codeblock, you need to have the wtf in parenthesis.. i.e.
{|o| (wtf e), rest of codeblock here }
{|o| (wtf e), rest of codeblock here }
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: DCCHART Sample
I just made the following change to _DCRMCHT.PRG.
This change will be in next release.
You should do the same.
This change will be in next release.
You should do the same.
Code: Select all
IF Valtype(aData) == 'O' .AND. aData:isDerivedFrom('VtRecord')
aData := aData:value
ELSE <<<<<<<<<<<<<<<< add this
RETURN nil <<<<<<<<<<<<<<< add this
ENDIF
The eXpress train is coming - and it has more cars.
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: DCCHART Sample
Hi Roger,
This is what I come up with to address the memory consumption issue in _dcrmcht.prg.
Note the Sleep(25)
Now, the memory consumption is very minimal. Thanks Roger for the help and the hints.
Regards,
Andy
This is what I come up with to address the memory consumption issue in _dcrmcht.prg.
Note the Sleep(25)
Code: Select all
METHOD DC_XbpRMChart:ShowToolTip( nMouseButton, nX, nY, aData )
LOCAL GetList, GetOptions, nSeriesIndex, nDataIndex, nRegion, oRegion, aPos, ;
lStatus := .f., nNumLines, nHeight, aColor, nColor, nSeconds, aPos1
Sleep(25) <<<<<<<<<<<<< without this, this method will return nil (adata is nil) thousands of times per second. Never reaching the sleep(10) below
IF !::toolTipEnable
RETURN nil
ENDIF
IF Valtype(aData) == 'O' .AND. aData:isDerivedFrom('VtRecord')
aData := aData:value
ELSE <<<<<<<<<<<<<<<< add this from Roger
RETURN nil <<<<<<<<<<<<<<<< add this from Roger
ENDIF
.
.
.
Regards,
Andy