DCBROWSE - row cursor on/off

This forum is for eXpress++ general support.
Message
Author
Maxz
Posts: 49
Joined: Sun Jan 09, 2022 12:11 pm

DCBROWSE - row cursor on/off

#1 Post by Maxz »

I point out some strange behaviors in the DCBROWSE when i disable/enable highlight cursor in XBPBRW_CURSOR_ROW mode

// enable row cursor
oBrowse:cursorMode := XBPBRW_CURSOR_ROW
oBrowse:configure()
oBrowse:hilite()
oBrowse:refreshCurrent()
oBrowse:forceStable()

this works



// disable row cursor
oBrowse:cursorMode := XBPBRW_CURSOR_NONE
oBrowse:configure()
oBrowse:deHilite()
oBrowse:refreshCurrent()
oBrowse:forceStable()

the row cursor remains highlighted - then the row cursor stay hidden (if i try to move it using keyboard or mouse)

User avatar
Tom
Posts: 1173
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DCBROWSE - row cursor on/off

#2 Post by Tom »

Maybe you dehilite the browse before you set the cursor to "NONE"?
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Maxz
Posts: 49
Joined: Sun Jan 09, 2022 12:11 pm

Re: DCBROWSE - row cursor on/off

#3 Post by Maxz »

I'm trying all the combinations, for example:

oBrowse:deHilite()
oBrowse:refreshCurrent()
oBrowse:cursorMode := XBPBRW_CURSOR_NONE
oBrowse:configure()

the cursor always remains on

Maxz
Posts: 49
Joined: Sun Jan 09, 2022 12:11 pm

Re: DCBROWSE - row cursor on/off

#4 Post by Maxz »

in addition oBrowse:forceStable() return an object instead of logical value, as the xbase manual show:

":forceStable() returns .T. (true) when the display is stable. "

so I can't even create the usual loop to stabilize the browse:
do while !oBrowse:forceStable(); enddo

User avatar
Tom
Posts: 1173
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DCBROWSE - row cursor on/off

#5 Post by Tom »

Just call oBrowse:ForceStable() once, this contains the complete stabilization loop.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Maxz
Posts: 49
Joined: Sun Jan 09, 2022 12:11 pm

Re: DCBROWSE - row cursor on/off

#6 Post by Maxz »

<<msg to Roger>>
I looked at Roger's source (xbp_brw.prg) and I saw that the method that refreshes the line is PROTECTED
METHOD HiliteColumns // hilite the specified columns

I wanted to force the refresh of the line to turn it off but I do not know how to get around the problem
screen.jpg
screen.jpg (205.86 KiB) Viewed 4393 times

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: DCBROWSE - row cursor on/off

#7 Post by Auge_Ohr »

hi Maxz
Maxz wrote: Fri Feb 25, 2022 3:57 am ":forceStable() returns .T. (true) when the display is stable. "
"think GUI"
"o:Forcestable" was used with TBrowse but XbpBrowse() have Callback-Slot "o:stableBlock" for it

under Cl*pper you did "say" what have to do
under GUI you are waiting and "react" what User did

so "fill" Callback-Slot "o:stableBlock" for your "Action" when oBrowse is "stable"
greetings by OHR
Jimmy

Maxz
Posts: 49
Joined: Sun Jan 09, 2022 12:11 pm

Re: DCBROWSE - row cursor on/off

#8 Post by Maxz »

I found the way to solve the problem, after so many attempts:

cursor row enabled:
oBrowse:hilite()
AEval( oBrowse:aColumns, {|o| o:Redraw() } )


cursor row disabled:
oBrowse:deHilite()
AEval( oBrowse:aColumns, {|o| o:Redraw() } )

:dance:

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCBROWSE - row cursor on/off

#9 Post by rdonnay »

I just tested this and it works fine for me.

Code: Select all

STATIC FUNCTION CursorOn( oBrowse )

oBrowse:cursorMode := XBPBRW_CURSOR_ROW
oBrowse:configure()
oBrowse:hilite()
oBrowse:forceStable()
oBrowse:refreshCurrent()
SetAppFocus(oBrowse)

RETURN nil

* ------------

STATIC FUNCTION CursorOff( oBrowse )

oBrowse:cursorMode := XBPBRW_CURSOR_NONE
oBrowse:configure()
oBrowse:dehilite()
oBrowse:forceStable()
oBrowse:refreshCurrent()
SetAppFocus(oBrowse)

RETURN nil
The eXpress train is coming - and it has more cars.

Maxz
Posts: 49
Joined: Sun Jan 09, 2022 12:11 pm

Re: DCBROWSE - row cursor on/off

#10 Post by Maxz »

tried it but the on/off switch mechanism seams not work for me
attach, a small example to play ...
temp.zip
(62.18 KiB) Downloaded 292 times

Post Reply