StyleBrowse( oBrw ) ???

StyleBrowse( oBrw ) ???

Postby TimStone » Tue Dec 06, 2022 3: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: StyleBrowse( oBrw ) ???

Postby alerchster » Tue Dec 06, 2022 4:08 am

Hello Tim

That is on the End of Fivedbu.prg!

Code: Select all  Expand view
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
User avatar
alerchster
 
Posts: 92
Joined: Mon Oct 22, 2012 4:43 pm

Re: StyleBrowse( oBrw ) ???

Postby Marc Venken » Tue Dec 06, 2022 9: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: Select all  Expand view
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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1426
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Fivedbu - Import/Export

Postby TimStone » Tue Dec 06, 2022 6:56 pm

OK ... I initially searched for it and couldn't find it in my 2210 file. Now I see it.

Next question.

Code: Select all  Expand view
  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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: StyleBrowse( oBrw ) ???

Postby Antonio Linares » Tue Dec 06, 2022 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: StyleBrowse( oBrw ) ???

Postby TimStone » Tue Dec 06, 2022 8: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: StyleBrowse( oBrw ) ???

Postby Antonio Linares » Wed Dec 07, 2022 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: StyleBrowse( oBrw ) ???

Postby TimStone » 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: Select all  Expand view

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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: StyleBrowse( oBrw ) ???

Postby Antonio Linares » Thu Dec 08, 2022 8:50 am

thank you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests