Disable mouse double click event on xBrowse ? (Solved)

Postby sambomb » Thu Dec 18, 2008 12:35 pm

I'm using 8.02 and xDev to compile with fwxh 8.02,
but what I mean to say is : What lib's you are using?
Last edited by sambomb on Thu Dec 18, 2008 12:47 pm, edited 1 time in total.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Postby anserkk » Thu Dec 18, 2008 12:43 pm

Dear Sambomb,

I am not using any other libraries other than the standard libs provided along with FWH.

If u check the code, u can understand. It is just a dialog, xBrowse with Array and a ButtonBMP

Ok, I think the BUTTONBMP is causing the problem to you. Just change the BUTTONBMP to BUTTON, may be that is the cause

Code: Select all  Expand view
@14.3,05 BUTTON oBtnCancel PROMPT "Cancel" OF oDlg ;
   SIZE 50,15 ACTION oDlg:End()


My OS is WinXp Service Pack 2

Regards

Anser
User avatar
anserkk
 
Posts: 1330
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby sambomb » Thu Dec 18, 2008 1:34 pm

This give me an error in the xBrowse declaration.
I don't remember of any samples of xBrowse declaration from code to check what are wrong.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Postby anserkk » Thu Dec 18, 2008 2:53 pm

Dear Sambomb,

If I am not wrong, I think the xBrowse command declaration of array columns ie Columns 2,3 was implemented only from FWH 8.05 onwards.

Code: Select all  Expand view
@ 0,100 XBROWSE oBrwMenu ;
    COLUMNS 2, 3 ;
    HEADERS "Menu", "Status" ;
    OF oDlg ;
    ARRAY aMenu 


I think we will have to modify he xBrowse column declaration to

Code: Select all  Expand view
oCol:=oBrwMenu:AddCol()

or

ADD TO oBrwMenu ARRAY ELEMENT 2 HEADER "Menu" PICTURE <pic>
......
ADD TO oBrwMenu ARRAY ELEMENT 3 HEADER "Status" PICTURE <pic>

or
Local nCur:=1
@ 0, 0 XBROWSE oBrw FIELDS aMenu[ nCur, 2 ],;
                               aMenu[ nCur, 3 ],;
           HEADERS "Menu", "Status";
           ARRAY aMenu



I can't test the syntax right now as I am out of my office. May be tomorrow morning I can get the syntax.

Regards

Anser
User avatar
anserkk
 
Posts: 1330
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby sambomb » Thu Dec 18, 2008 3:34 pm

so the erro is this!
My fivewin is 8.02 with some 8.04 classes
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Postby sambomb » Thu Dec 18, 2008 4:25 pm

Problem solved!
I changed my xBrowse.ch and the problem with the syntax erro was solved, but now I have this error:
Array acess in this line: oBrwMenu:aCols[1]:nWidth:=350

I think that is something with my version of fivewin.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Postby anserkk » Fri Dec 19, 2008 4:51 am

Anybody any help ?

I have already spent hours trying to solve this problem.

I think I can solve the problem if I know how to ignore a mouse double clcik event on a particular column of xBrowse.

I am repeating the Problem Description once more
Problem : Double click event on a column in xBrowse is avtivating a GET, which I do not want. I want to ignore the double click event.

I am trying to do a CheckOn,CheckOff on an xBrowse column by either using a Enter Key, or Mouse Click. Enter key and mouse click is working fine, but double click is activating a GET (which I dont want).

A sample self containing code is posted in this thread itself.

Screen Snapshot

Image


I have searched this forumn for the past 2 days and found nothing regarding ignoring a double click event.

Is this possible Or Am I moving in a wrong direction ?.

Mr.Antonio, Any hint ?

Regards

Anser
User avatar
anserkk
 
Posts: 1330
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby anserkk » Sat Dec 20, 2008 10:11 am

Code: Select all  Expand view
oBrwMenu:bLDblClick:={|nRow, nCol| if(oBrwMenu:nColSel == 2, MsgInfo("Col 2"),MsgInfo("Some other Column") )}


With the above code, If I double clcik on any column OTHER THAN THE 2nd COLUMN, the MsgInfo displays the mesage "Some other Column"

but If I double click on the 2nd column MsgInfo("Col 2") is not getting executed at all and instead the GET is activated.

Regards

Anser
User avatar
anserkk
 
Posts: 1330
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby Daniel Garcia-Gil » Sat Dec 20, 2008 2:50 pm

ya vi que resolviste el problema, te respondi en el foro de español...

http://forums.fivetechsoft.com/viewtopic.php?t=14034
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Postby Detlef Hoefner » Sun Dec 21, 2008 2:34 pm

Anser,

i played a little with your code and modified the program.

At first i must state that in all answers to your questions it was supposed that nCol gives you the column number of the actual browse column.
Code: Select all  Expand view
oBrwMenu:bLDblClick:={|nRow, nCol| ... }

This is wrong.
To get the real column number you must use
Code: Select all  Expand view
oBrwMenu:MouseColPos( nCol )

With the Row number it's the same.

Now my version of your program.
I avoided a colum get.
Code: Select all  Expand view
#Include "FiveWin.ch"
#Include "xBrowse.ch"

////////////////
PROCEDURE Main()
////////////////
Local oDlg, oBrwMenu, oBtnCancel
Local aClrCol :={ { 0, nRGB( 192, 221, 255 ) }, { 0, nRGB( 221, 245, 255 ) } } // Xbrowse Alternative Column colours
Local aMenu   :={;
                    {  1, "Masters                       ", .F., .T. },;
                    {  2, "     Account Groups           ", .F., .F. },;
                    {  3, "     Account Heads            ", .F., .F. },;
                    {  4, "     Exit                     ", .F., .F. },;
                    {  5, "Transactions                  ", .F., .T. },;
                    {  6, "     Voucher Entry            ", .F., .F. },;
                    {  7, "     Sales Postings           ", .F., .T. },;
                    {  8, "          From GDMS           ", .F., .T. },;
                    {  9, "               Test sub menu 1", .F., .F. },;
                    { 10, "          From PDMS           ", .F., .F. },;
                    { 11, "     Test Menu                ", .F., .F. },;
                    { 12, "Reports                       ", .F., .T. },;
                    { 13, "     Trial Balance            ", .F., .F. },;
                    { 14, "     Profit & Loss Statement  ", .F., .F. },;
                    { 15, "     Balance Sheet            ", .F., .F. },;
                    { 16, "     Statement of Account     ", .F., .F. },;
                    { 17, "     Debtor                   ", .F., .F. },;
                    { 18, "Tools                         ", .F., .T. },;
                    { 19, "     Select Financial Year    ", .F., .F. },;
                    { 20, "     Calculator               ", .F., .F. },;
                    { 21, "Users                         ", .F., .T. },;
                    { 22, "     Create User              ", .F., .F. },;
                    { 23, "     Set user Permissions     ", .F., .F. } ;
                }



   DEFINE DIALOG oDlg FROM 70,20 to 630,690 TITLE "Test" PIXEL

   @ 0,100 XBROWSE oBrwMenu ;
       COLUMNS 2, 3 ;
       HEADERS "Menu", "Status" ;
       OF oDlg ;
       ARRAY aMenu   // should not use AUTOCOLS now

   oBrwMenu:lHScroll      := .F.  // Horizontal Scroll Bar not required
   oBrwMenu:lFooter       := .T.
   oBrwMenu:nMarqueeStyle :=  MARQSTYLE_HIGHLROWRC // MARQSTYLE_HIGHLROWMS MS can be used to place rec point on a partucular record and move futher using mouse scroll         

   // Sub Menu in different colour and Menu's in different Coclour
   oBrwMenu:bClrStd           :=  { || if( oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ], aClrCol[ 1 ], aClrCol[ 2 ] ) }
   oBrwMenu:lUpdate           := .t.
   oBrwMenu:aCols[ 1 ]:nWidth := 350
   
   // Alternative way to display BMP, if multiple conditions and more than 2 bitmaps are there
   oBrwMenu:aCols[ 2 ]:AddResource( "CheckOn"  )
   oBrwMenu:aCols[ 2 ]:AddResource( "CheckOff" )
 
   // Checkbox should be displayed only if the menu type is not a Submenu
   oBrwMenu:aCols[ 2 ]:bBmpData := { || if( oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ],;
                                            0,;
                                            if( oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ],;
                                                1,;
                                                2;
                                              );
                                          );
                                   }
 
   oBrwMenu:aCols[ 2 ]:nWidth        := 50
   oBrwMenu:aCols[ 2 ]:bStrData      := { || NIL }
   oBrwMenu:aCols[ 2 ]:nDataStrAlign := AL_CENTER

   // here the permission is changed when lDblClick happens exactly on column 2
   // -------------------------------------------------------------------------
   oBrwMenu:bLDblClick := { | nRow, nCol | if( !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ] .and. oBrwMenu:MouseColPos( nCol ) == 2,;
                                               (;
                                                  oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ] := !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ],;
                                                  oBrwMenu:Refresh();
                                               ),;
                                               NIL;
                                             );
                         
                          }
/*

   // here the permission is changed when lDblClick happens on whole row
   // ------------------------------------------------------------------
   oBrwMenu:bLDblClick := { | nRow, nCol | if( !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ] .and. oBrwMenu:MouseColPos( nCol ) == 2,;
                                               (;
                                                  oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ] := !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ],;
                                                  oBrwMenu:Refresh();
                                               ),;
                                               NIL;
                                             );
                          }

*/
   oBrwMenu:bKeyDown := { | nKey | if( !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ],; // Is submenu the do nothing, bwhen will take care
                                       if ( nKey  == VK_SPACE,;
                                            (;
                                               oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ] := !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ],;
                                               oBrwMenu:Refresh();
                                            ),;
                                            NIL;
                                          ),;
                                       NIL;
                                     );
                        }
                       
   oBrwMenu:CreateFromCode()

   @14.3, 05 BUTTON oBtnCancel PROMPT "Cancel" OF oDlg SIZE 50,15 ACTION oDlg:End()     
   
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT (;
                  oBrwMenu:nLeft   := 220,;
                  oBrwMenu:nHeight := oDlg:nHeight - 35,;
                  oBrwMenu:nWidth  := 450,;
                  oBrwMenu:SetFocus();
              )

RETURN


Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby anserkk » Mon Dec 22, 2008 5:56 am

Dear Daniel and Detlef,

Thankyou for the support.

Is this possible Or Am I moving in a wrong direction ?.


As I doubted, I was moving in the wrong direction.

For the code to work successfully, I had to eliminate the following lines (GET), Detlef you are right.

Code: Select all  Expand view
oBrwMenu:aCols[2]:nEditType  := EDIT_GET
oBrwMenu:aCols[2]:bEditvalue := { || space(0) }


Detlef,

With the command

Code: Select all  Expand view
oBrwMenu:nColSel


I am able to get the xBrowse column no. So I believe that the commands

oBrwMenu:MouseColPos( nCol )
and
oBrwMenu:nColSel

gives the same result.

Once again I thank Daniel & Detlef.

Regards

Anser
User avatar
anserkk
 
Posts: 1330
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 12 guests