Page 1 of 1

Re: FWH 2006: XBrowse : Own built-in Buttonbar

Posted: Fri Apr 12, 2024 12:20 am
by TecniSoftware
Rao

He armado este ejemplo con un rowset pero con la clausula AUTOSORT y no ordena las columnas, solo al colocar // XbrSetupBar( oBrw ) vueve a ordernar, podria verificar si es asi o estoy haciendo algo mal ?

Muchas gracias.

Code: Select all | Expand

#include "fivewin.ch"

static aStr := { "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", ;
                 "209.250.245.152,fwh,fwhuser,FiveTech@2022" }

static oCn

//----------------------------------------------------------------------------//

function Main()
   local oDlg, oFont, oBrw
   local oRs, cSql

   FWSetLanguage( 1 )
   FW_SetUnicode( .t. )

   if ( oCn := maria_Connect( aStr[ 1 ], .t. ) ) = nil
      Return NIL
   EndIf

      TEXT INTO cSql
         SELECT C.ID AS CustID, C.FIRST AS CustName, C.AGE AS AG, C.STATE AS ST, S.NAME AS StateName
         FROM customer C
         LEFT OUTER JOIN states S ON C.STATE = S.CODE
         ORDER BY CUSTID
      ENDTEXT

      oRs := oCn:RowSet( cSql )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

   DEFINE DIALOG oDlg SIZE 600,470 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
      TITLE "XBROWSE : BUILT-IN BUTTON BAR"

   @  20,20 XBROWSE oBrw SIZE -20,400 PIXEL OF oDlg ;
      DATASOURCE oRs AUTOSORT AUTOCOLS CELL LINES NOBORDER

   XbrSetupBar( oBrw ) // Si lo anulo, funciona el AUTOSORT

   WITH OBJECT oBrw
      :nEditTypes    := EDIT_GET
      :SetChecks()
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

function XbrSetupBar( oBrw )

   oBrw:nTopBarHeight := 30
   oBrw:bOnAdjust := <||
      local oBtn
      @ 05,05 BTNBMP oBtn FILE "..\bitmaps\16X16\new.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
        ACTION oBrw:EditSource( .t. ) TOOLTIP "Add New Record"
      @ 05,45 BTNBMP oBtn FILE "..\bitmaps\edit.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
        ACTION oBrw:EditSource() TOOLTIP "Edit this record"
      @ 05,85 BTNBMP oBtn FILE "..\bitmaps\16x16\delete.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
        ACTION If( MsgNoYes( "Delete this row?" ),,oBrw:Delete() ) TOOLTIP "Delete This Record"

      return nil
      >

return nil
 

Re: FWH 2006: XBrowse : Own built-in Buttonbar

Posted: Fri Apr 12, 2024 9:51 am
by nageswaragunupudi
He armado este ejemplo con un rowset pero con la clausula AUTOSORT y no ordena las columnas, solo al colocar // XbrSetupBar( oBrw ) vueve a ordernar, podria verificar si es asi o estoy haciendo algo mal ?
Yes. This is a bug.
Thanks a lot for pointing out.
We are going to look into it and get back soon.

Re: FWH 2006: XBrowse : Own built-in Buttonbar

Posted: Tue Apr 16, 2024 3:34 am
by nageswaragunupudi
He armado este ejemplo con un rowset pero con la clausula AUTOSORT y no ordena las columnas, solo al colocar // XbrSetupBar( oBrw ) vueve a ordernar, podria verificar si es asi o estoy haciendo algo mal ?
Please modify xbrowse and apply this fix.
Please locate this line in the
METHOD HeaderLButtonUp( nMRow, nMCol, nFlags ) CLASS TXBrwColumn

Code: Select all | Expand

      if nMRow <= ::oBrw:nHeaderHeight  ;


Change this line as:

Code: Select all | Expand

      if nMRow < ::oBrw:HeaderHeight( .t. )  ;
This is fixed in the next version under relase.
Thanks for pointing out the bug.