FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour StyleBrowse( oBrw ) ???
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
StyleBrowse( oBrw ) ???
Posted: Tue Dec 06, 2022 03:44 AM

The FiveDBU.prg in Samples references a function StyleBrowse( )

I cannot find that function anywhere. Is anyone familiar with it ?

Thanks.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 137
Joined: Mon Oct 22, 2012 04:43 PM
Re: StyleBrowse( oBrw ) ???
Posted: Tue Dec 06, 2022 04:08 AM
Hello Tim

That is on the End of Fivedbu.prg!
Code (fw): Select all Collapse
Static Function StyleBrowse( oBrw )

   WITH OBJECT oBrw
      :l2007               := .F.
      :nMarqueeStyle       := MARQSTYLE_HIGHLROW
      :lFullGrid           := .T.
      :lRowDividerComplete := .T.
      :lColDividerComplete := .T.
      //:nRowDividerStyle    := LINESTYLE_NOLINES
      :nColDividerStyle    := LINESTYLE_LIGHTGRAY
      :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
      :nHeaderHeight       := 23
      //:nFooterHeight     := oBrw:nHeaderHeight
      :nRowHeight          := oBrw:nHeaderHeight
      //:nStretchCol         := 1
      :nFreeze             := 1
      if lPijama
         :SetColor( CLR_BLACK, RGB( 232, 255, 232 ) )
      else
         :SetColor( nClrTxtBrw, nClrBackBrw )
      endif
   END

Return nil
Regards



Ing. Anton Lerchster
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: StyleBrowse( oBrw ) ???
Posted: Tue Dec 06, 2022 09:08 AM
This is my style browse. It is used by the programmers to layout xbrowse, when you are using maybe xbrowsers. The layout will be always the same then.

@ nTop,nLeft XBROWSE oBrw size nBreed,nHoogte PIXEL OF oTarget font oFont ;
DATASOURCE cDbf ;
....
StyleBrowse(oBrw, aBrwGet, aBrwEdit ,cData )
....

Code (fw): Select all Collapse
Static Function StyleBrowse( oBrwSel, aBarget, aEditget, cNaam )
   LOCAL hBmp    := ReadBitmap( 0, "bitmaps\search.bmp" )
   local cCol,cTemp
   DEFAULT aBarget:={}
   DEFAULT aEditget:={}
   DEFAULT cNaam:=""

   if lPijama  //  Make stripes in the browse
      oBrwSel:bClrStd = { || If( oBrwSel:KeyNo() % 2 == 0, ;
                            { If( ( oBrwSel:cAlias )->( Deleted() ), CLR_HRED, nClrTxtBrw ),;
                              CLR_BROWSE2 }, ;
                            { If( ( oBrwSel:cAlias )->( Deleted() ), CLR_HRED, nClrTxtBrw ),;
                              CLR_BROWSE1 } ) }
      oBrwSel:bClrSel = { || { If( ( oBrwSel:cAlias )->( Deleted() ), CLR_HRED, nClrBackBrw ),;
                              CLR_BROWSEROW } }
   else
      oBrwSel:bClrStd := { || { If( ( oBrwSel:cAlias )->( Deleted() ), CLR_HRED, nClrTxtBrw ),;
                          nClrBackBrw } }
      oBrwSel:bClrSel := { || { If( ( oBrwSel:cAlias )->( Deleted() ), CLR_HRED, nClrBackBrw ),;
                           MY_PAARS } }
   endif


   cClrBack     := Eval( oBrwSel:bClrSelFocus )[ 2 ]  //  I don't know what this is doing

   oBrwSel:SetChecks()
   oBrwSel:bRClickHeaders := { || XbrColSelector( oBrwSel, cNaam ) }  // Kies welke velden tezien zijn
   //oBrwSel:SetRecSelBmp( "set.bmp" ) // red arrow as record-selector

   WITH OBJECT oBrwSel
      :l2007               := .F.
      :lFooter          := .T.
      :bRecSelHeader    := {|| "Klant" }
      :bRecSelData      := {| o | o:KeyNo }
      :bRecSelFooter    := {| o | o:nLen }
      :oRecSelFont      := oFont  // optional
      :nRecSelWidth     := "99999" // required size

      :lColChangeNotify    := .T.
      :nMarqueeStyle       := MARQSTYLE_HIGHLROW

      //:lAllowRowSizing     := .F.
      //:lAllowSizings       := .f.

      //:lHScroll      := .F.
      :lFullGrid           := .T.
      :lMultiSelect        := .T.
      :lRowDividerComplete := .T.
      :lColDividerComplete := .T.
      :nColDividerStyle    := LINESTYLE_LIGHTGRAY
      :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
      :bClrSelFocus        := {|| { CLR_WHITE, CLR_BROWSECEL } } // CUANDO TIENE EL FOCUS
      :bClrRowFocus        := {|| { CLR_WHITE, CLR_BROWSEROW } }

      :nHeaderHeight       := 23
      :oHeaderFonts        := oBold
      :nHeadStrAligns      := AL_CENTER


      //:nFooterHeight     := oBrwSel:nHeaderHeight
      :nRowHeight          := oBrwSel:nHeaderHeight
      :nStretchCol         := NIL  // -2 // STRETCHCOL_WIDEST
      :nFreeze             := 1
      if lPijama
         :SetColor( CLR_BLACK, RGB( 232, 255, 232 ) ) // Pink
      else
         :SetColor( nClrTxtBrw, nClrBackBrw )
      endif
   END
   //  Toon de Bargetdata (Gets boven Bar)

   oBrwSel:lGetBar   := .T.  // Button to activate


   if len(aBarget)>0


      FOR EACH cCol in aBarget

         WITH OBJECT oBrwSel:oCol( cCol )

            :uBarGetVal    := uValBlank( :Value )

            :cBarGetPic    := :cEditPicture
            :bClrEdit      := {|| { CLR_BLACK, MY_LIGHTYELLOW } }

            :lBarGetOnKey := .T. // after having setfocus the oBrowse object, the end user can insert the characters directly into the get
//            :cBarGetBmp := hBmp // this for show the Bitmap on the get
            :bBarGetAction := {|| ( oBrwSel:cAlias )->( MARC_SETFILTER( oBrwSel ) ) } // this for show the bitmap on the get and associated a action
// //         :bBarGetAction := {|| ( oBrwSel:cAlias )->( SETFILTER( oBrwSel ) ) } // this for show the bitmap on the get and associated a action

         END

      NEXT


   endif
   */


   if len(aEditget)>0
      //xbrowser(aEditget) title oBrwSel:cAlias()
      FOR EACH cCol in aEditget
         //msginfo(cCol+oBrwSel:cAlias(),"Info")
         WITH OBJECT oBrwSel:oCol( cCol )
            :nEditType     := EDIT_GET
            :bClrHeader    := {|| { CLR_WHITE, CLR_BROWSEINDEX } }
            //msginfo(cCol+oBrwSel:cAlias(),"Info Done")
         END
      NEXT
   endif

   */
Return nil
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Fivedbu - Import/Export
Posted: Tue Dec 06, 2022 06:56 PM
OK ... I initially searched for it and couldn't find it in my 2210 file. Now I see it.

Next question.
Code (fw): Select all Collapse
   DEFINE BUTTON OF oBar PROMPT "Import" RESOURCE "code" //;
   //   ACTION ( TxtStruct( oBrwParent ), oBrw:SetFocus() )

   DEFINE BUTTON OF oBar PROMPT "Export" RESOURCE "edit" //;
   //   ACTION ( New( Alias(), cFileName ) ) //, oDlg:End() )
IMPORT and EXPORT have calls commented out. Do we have Import and Export actions for this file ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: StyleBrowse( oBrw ) ???
Posted: Tue Dec 06, 2022 08:22 PM

Dear Tim,

It seems as those action have not been implemented yet.

What actions would you suggest to implement for each action ?

What import and export should do ?

many thanks for your feedback

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: StyleBrowse( oBrw ) ???
Posted: Tue Dec 06, 2022 08:39 PM

In older versions, there were three functions:

IMPORT - allowed the user to import data from another file of the same structure

EXPORT - allowed the user to export data to a new file. This is especially useful since it supports the use of filters on the original data

EXCEL - We also had an option for exporting to an Excel spreadsheet.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: StyleBrowse( oBrw ) ???
Posted: Wed Dec 07, 2022 09:01 AM

Dear Tim,

> In older versions

Do you know what versions were them ?

Do you have a fivedbu.prg that contains them ?

We are going to look in our repo to see if we can find them

many thanks for your feedback

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: StyleBrowse( oBrw ) ???
Posted: Wed Dec 07, 2022 11:15 PM
Antonio,

In my own adaptation from older versions ( when we worked just with DBF files ), I used these. My File Editor is a Class, so these are methods. FiveDbu is a collection of functions ...
Code (fw): Select all Collapse
METHOD ExportDBF( ) CLASS MLSEditor

  LOCAL cDbfFileName := SPACE(10), cDbfFullName, retval
  MEMVAR cPath

  MsgGet( "Name the file to create", "Export Database", @cDbfFileName )

  cDbfFullName := cPath + TRIM(cDbfFileName) + ".dbf"
  retval := ::oDbf:CopyTo( cDbfFullName )

RETURN NIL



// ------------------------------------------------------------------------------------------------------------
METHOD ImportDBF(  ) CLASS MLSEditor

  LOCAL cDbfFileName, retval
  MEMVAR cPath

  // Lookup the file to edit
  cDbfFileName := cGetFile( "*.dbf", "Database Selector", , cPath )

  retval := ::oDbf:AppendFrom( cDbfFileName )

RETURN NIL
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: StyleBrowse( oBrw ) ???
Posted: Thu Dec 08, 2022 08:50 AM

thank you

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion