Page 1 of 2

DC_XbpBrowse:itemRbDown

Posted: Fri Jun 05, 2020 7:37 am
by Tom
Hi, Roger.

If columns of a browse were deleted, DC_XbpBrowse:itemRbDown with Xbase++ 2.0 leads to a wrong column number. The deleted columns still count. This is a problem with RBSELECT.

Besides, DC_MsgBox() doesn't reflect the settings handed to DC_GetOptDefault(). Especially if a scalefactor is set, this leads to a lack of beauty. 8-)

Re: DC_XbpBrowse:itemRbDown

Posted: Wed Jun 10, 2020 12:48 pm
by rdonnay
Tom -

I will look into this and get back to you.

Re: DC_XbpBrowse:itemRbDown

Posted: Mon Jun 15, 2020 1:00 pm
by rdonnay
DC_MsgBox() doesn't reflect the settings handed to DC_GetOptDefault(). Especially if a scalefactor is set, this leads to a lack of beauty.
Tom -

Try putting this somewhere at the beginning of your application:

DC_MsgBoxExpress(.f.)

The DCMSGBOX (DC_MsgBox()) command and function default to using the EXPRESS clause of DCREAD GUI. This insures that whatever DC_GetOptDefault() you have, that message boxes alway appear the same. This will be overridden by DC_MsgBoxExpress(.f.) and should give you your default look and the beauty you desire.

Re: DC_XbpBrowse:itemRbDown

Posted: Tue Jun 16, 2020 12:49 am
by Tom
Thanks!

Do you need sample code for the browse behaviour thing?

Re: DC_XbpBrowse:itemRbDown

Posted: Sun Jun 21, 2020 7:56 am
by rdonnay
Do you need sample code for the browse behaviour thing?
Yes, Please!!

Re: DC_XbpBrowse:itemRbDown

Posted: Mon Aug 03, 2020 7:45 am
by Tom
Here's the sample. The browse is build, column 3 is deleted before the dialog is shown. If you now right-click on a column from #3 on, the cursor will jump to the next column.

Code: Select all

FUNCTION MAIN()
LOCAL GetList := {}, GetOptions := {}, oBrowse, aColumns := {}, aDir := Directory()

DCGET OPTIONS HIDE

aColumns := Array(Len(aDir[1]))

@ 1,1 DCBROWSE oBrowse DATA aDir SIZE 100,25 RBSELECT

FOR nCtr := 1 to Len(aDir[1])
  DCBROWSECOL ELEMENT nCtr HEADER Str(nCtr,2,0) WIDTH 10 PARENT oBrowse OBJECT aColumns[nCtr]
NEXT

DCREAD GUI ADDBUTTONS OPTIONS GetOptions TITLE 'Browse Test' FIT ;
       EVAL {|o|oBrowse:DelColumn(3),o:Show()}
RETURN NIL
Edit: This worked perfect with Xbase++ 1.9 SL1. The behaviour came with 2.0 and the change in _DCXBROW.PRG you added here:

Code: Select all

METHOD DC_XbpBrowse:itemRbDown( aPos, aValues )

LOCAL nRow := aValues[2]
LOCAL nCol

IF ::rightButtonSelect

  #if XPPVER > 02000000
    nCol := aValues[1]:columnPos // <<<<<<<
  #else
    nCol := ::ColNum ( aValues[1] )
  #endif
  ::xbpBrowse:gotoItem( nRow, nCol )
  ::colPos := nCol
ENDIF

::XbpBrowse:itemRbDown( aPos, aValues )

RETURN self

Re: DC_XbpBrowse:itemRbDown

Posted: Thu Aug 06, 2020 1:27 am
by Tom
Push. 8-)

Re: DC_XbpBrowse:itemRbDown

Posted: Sat Aug 08, 2020 11:09 am
by rdonnay
Sorry, I wasn't getting my mail notifications. Something has happened to the board's ability to talk to Gmail.

I am seeing no difference in behavior between 1.9 and 2.0.

Right clicking on any cell works fine for me.

I am using Xbase+ build 1176, eXpress ++ build 267.

Re: DC_XbpBrowse:itemRbDown

Posted: Sun Aug 09, 2020 2:46 am
by Tom
Hi, Roger.

Did you check my sample? Right clicking behaves wrong if a column was deleted. It seems you established an iVar "ColumnPos" for columns in Xbase++ 2.0, which is used to set the cursor positiion. This number is wrong if a column was deleted. Maybe I have to set it manually.

Re: DC_XbpBrowse:itemRbDown

Posted: Sun Aug 09, 2020 6:37 am
by rdonnay
Yes, I DID compile and run your sample and I see no difference in behavior between 1.9 and 2.0.

I will look at the source code again to see if I can figure out why you are having the problem.
I use the International version of Xbase++ and you use the German version, but I don't see why that would make a difference.

Can you make a short video of the behavior so I can see what you are seeing?