DC_XbpBrowse:itemRbDown

This forum is for eXpress++ general support.
Message
Author
User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

DC_XbpBrowse:itemRbDown

#1 Post 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-)
Best regards,
Tom

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

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

Re: DC_XbpBrowse:itemRbDown

#2 Post by rdonnay »

Tom -

I will look into this and get back to you.
The eXpress train is coming - and it has more cars.

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

Re: DC_XbpBrowse:itemRbDown

#3 Post 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.
The eXpress train is coming - and it has more cars.

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

Re: DC_XbpBrowse:itemRbDown

#4 Post by Tom »

Thanks!

Do you need sample code for the browse behaviour thing?
Best regards,
Tom

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

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

Re: DC_XbpBrowse:itemRbDown

#5 Post by rdonnay »

Do you need sample code for the browse behaviour thing?
Yes, Please!!
The eXpress train is coming - and it has more cars.

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

Re: DC_XbpBrowse:itemRbDown

#6 Post 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
Best regards,
Tom

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

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

Re: DC_XbpBrowse:itemRbDown

#7 Post by Tom »

Push. 8-)
Best regards,
Tom

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

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

Re: DC_XbpBrowse:itemRbDown

#8 Post 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.
The eXpress train is coming - and it has more cars.

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

Re: DC_XbpBrowse:itemRbDown

#9 Post 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.
Best regards,
Tom

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

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

Re: DC_XbpBrowse:itemRbDown

#10 Post 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?
The eXpress train is coming - and it has more cars.

Post Reply