xBrowse edit dialog and navigation

xBrowse edit dialog and navigation

Postby reds » Wed May 29, 2019 11:09 am

I want to include navigation prompts in my edit dialog
i.e. Top,Bottom,Skip

How do I update the record object to contain the details of the newly selected browse row.

Regards
Peter
reds
 
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse edit dialog and navigation

Postby nageswaragunupudi » Wed May 29, 2019 3:16 pm

Please try
Code: Select all  Expand view  RUN

XBROWSER "CUSTOMER.DBF" FASTEDIT
 

You can see the edit dialogs with navigation buttons and also when the dialog is saved, xbrowse is updated automatically
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse edit dialog and navigation

Postby Silvio.Falconi » Wed May 29, 2019 9:16 pm

Nages, I think reds mean for the oldest test there was on samples folder FIVEDEMO.PRG where on edit dialog there are buttons
top bottom prev and next to scroll records having the edit dialog

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xBrowse edit dialog and navigation

Postby reds » Thu May 30, 2019 11:43 am

Yes the demo example that Silvio has given is what I want to acheive

I want to have my edit dialog be able to navigate through the records,so when I move through the
browse the record object gets updated to reflect the new browse record that has focus.

Regards
Peter
reds
 
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse edit dialog and navigation

Postby nageswaragunupudi » Thu May 30, 2019 11:45 am

reds wrote:Yes the demo example that Silvio has given is what I want to acheive

I want to have my edit dialog be able to navigate through the records,so when I move through the
browse the record object gets updated to reflect the new browse record that has focus.

Regards
Peter

Very shortly I will post a generic sample.
May I know the FWH version you are using?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse edit dialog and navigation

Postby reds » Thu May 30, 2019 1:09 pm

18.12

Many thanks
Peter
reds
 
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse edit dialog and navigation

Postby nageswaragunupudi » Fri May 31, 2019 1:01 pm

Image

Mr. Peter,
Is this what you want?

Sample for DBF:

Code: Select all  Expand view  RUN
#include "fivewin.ch"

REQUEST DBFCDX

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

function Main()

   CreateTestDbf()

   USE TESTEDIT NEW VIA "DBFCDX" SHARED

   TestBrowse()   // Browse and Edit
   TestEdit()     // Edit without browse

   CLOSE TESTEDIT

return nil

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

INIT PROCEDURE PrgInit

   SET DATE BRITISH
   SET CENTURY ON
   SET TIME FORMAT TO "HH:MM:SS"
   SET DELETED ON

   FWNumFormat( "B", .t. )  // "B" for British
   SetGetColorFocus()

return

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

static function TestBrowse()

   local oDlg, oFont, oBar, oBrw

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 650,600 PIXEL TRUEPIXEL FONT oFont
   DEFINE BUTTONBAR oBar OF oDlg SIZE 100,32 2010

   @ 40,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "TESTEDIT" AUTOCOLS ;
      CELL LINES NOBORDER FOOTERS FASTEDIT

   WITH OBJECT oBrw
      :nEditTypes       := EDIT_GET
      WITH OBJECT :id
         :cEditPicture  := "@L 9999"
      END
      WITH OBJECT :Married
         :SetCheck()
         :nFooterType   := AGGR_COUNT
         :bSumCondition := { |v,o| v } // count married only
      END
      WITH OBJECT :Salary
         :nFooterType   := AGGR_SUM
      END
      :nStretchCol   := 2
      :MakeTotals()
      //
      :bEdit         := { |oRec| MyEditDlg( oRec ) }  // Standard for all browses
      //
      :CreateFromCode()
   END

   // --> Add/Edit/Delete Actions common to all browses
   DEFINE BUTTON OF oBar PROMPT "Add"     ACTION oBrw:EditSource( .t. )
   DEFINE BUTTON OF oBar PROMPT "Edit"    ACTION oBrw:EditSource()
   DEFINE BUTTON OF oBar PROMPT "Delete"  ACTION oBrw:Delete()
   // <-- End of standard buttons


   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

return nil

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

static function TestEdit()

   local oRec

   oRec  := FW_Record():New( "TESTEDIT" )
   oRec:bEdit := { |o| MyEditDlg( o ) }
   oRec:Edit( nil, .t. )  // 2nd parameter .t. to enable navigation

return nil

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

static function MyEditDlg( oRec )

   local oDlg, oFont,oBold, oItalic, oBtn, oSay

   // Note: If oRec:RecNo is 0, it is a new record for append

   DEFINE FONT oFont   NAME "TAHOMA" SIZE 0,-14
   DEFINE FONT oBold   NAME "TAHOMA" SIZE 0,-15 BOLD
   DEFINE FONT oItalic NAME "TAHOMA" SIZE 0,-12 ITALIC

   DEFINE DIALOG oDlg SIZE 400,260 PIXEL TRUEPIXEL FONT oFont TITLE "FW_Record Demo"

   @ 20,50 SAY oSay PROMPT { || If( oRec:RecNo == 0, "NEW EMPLOYEE", "EDIT EMPLOYEE : " + STRZERO( oRec:ID, 4 ) ) } ;
      SIZE 300,24 PIXEL OF oDlg CENTER VCENTER UPDATE FONT oBold

   @  70, 30 SAY "Name"    SIZE 120,24 PIXEL OF oDlg CENTER
   @  70,150 SAY "Married" SIZE 100,24 PIXEL OF oDlg CENTER
   @  70,270 SAY "Salary"  SIZE 100,24 PIXEL OF oDlg CENTER

   @ 100, 30 GET oRec:Name SIZE 120,26 PIXEL OF oDlg UPDATE VALID !Empty( oRec:Name )
   @ 100,200 CHECKBOX oRec:Married PROMPT "" SIZE 26,26 PIXEL OF oDlg UPDATE
   @ 100,270 GET oRec:Salary SIZE 100,26 PIXEL OF oDlg UPDATE PICTURE "99,999.99" RIGHT ;
         VALID ( oRec:Salary > 0 )

   @ 150,30 SAY { || If( oRec:RecNo == 0, "", ;
      "Last modified " + TTOC( oRec:updt ) ) } SIZE 340,24 PIXEL OF oDlg UPDATE CENTER ;
      FONT oItalic

   // valid for entire record. This is checked before saving
   oRec:bValid := <||
      if Empty( oRec:Name )
         MsgAlert( "Name can not be empty" )
         return .f.
      endif
      if oRec:Salary <= 0.00
         MsgAlert( "Salary should be a positive number" )
         return .f.
      endif
      return .t.
      >

   // --> Following button actions should exactly be the same for all dialogs

   @ 200, 20 BTNBMP oBtn RESOURCE FWBitmap( "top2" )      SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "First"  ;
            WHEN oRec:CanGoUp() ACTION ( oRec:GoTop(), oDlg:Update() )
   @ 200, 55 BTNBMP oBtn RESOURCE FWBitmap( "previous2" ) SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Previous"  ;
            WHEN oRec:CanGoUp() ACTION ( oRec:GoUp(), oDlg:Update() )
   @ 200, 90 BTNBMP oBtn RESOURCE FWBitmap( "next2" )     SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Next"  ;
            WHEN oRec:CanGoDn() ACTION ( oRec:GoDown(), oDlg:Update() )
   @ 200,125 BTNBMP oBtn RESOURCE FWBitmap( "bottom2" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Last"  ;
            WHEN oRec:CanGoDn() ACTION ( oRec:GoBottom(), oDlg:Update() )
   @ 200,160 BTNBMP oBtn RESOURCE FWBitmap( "new16" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "New"  ;
            WHEN !Empty( oRec:RecNo ) ACTION ( oRec:Load( .t. ), oDlg:Update() )

   @ 200,278 BTNBMP oBtn RESOURCE FWBitmap( "undo16" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Undo"  ;
            WHEN oRec:Modified() ACTION ( oRec:Undo(), oDlg:Update(), oDlg:SetFocus() )
   oBtn:lCancel   := .t.
   @ 200,313 BTNBMP oBtn RESOURCE FWBitmap( "save" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Save"  ;
            WHEN oRec:Modified() ACTION ( oRec:Save( .t. ), oDlg:Update() )
   @ 200,348 BTNBMP oBtn RESOURCE FWBitmap( "exit2" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Close"  ;
            ACTION ( oDlg:End() )
   oBtn:lCancel   := .t.

   // <-- End of buttons


   oDlg:bPainted := { || oDlg:Box( oSay:nTop-1, oSay:nLeft-1, oSay:nBottom+2, oSay:nRight+2 ) }

   ACTIVATE DIALOG oDlg CENTERED VALID oRec:CloseMsg()

   RELEASE FONT oFont, oBold, oItalic

return nil

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

static function CreateTestDbf()

   local aCols := { ;
      { "ID",     "+",  4, 0 }, ;
      { "NAME",   "C", 10, 0 }, ;
      { "MARRIED","L",  1, 0 }, ;
      { "SALARY", "N",  8, 2 }, ;
      { "UPDT",   "=",  8, 0 }  }

   local aData := { ;
      { "One",    .t., 20000 }, ;
      { "Two",    .f., 30000 }, ;
      { "Three",  .t., 35000 }  }

   DBCREATE( "TESTEDIT", aCols, "DBFCDX", .T., "TED" )
   FW_ArrayToDBF( aData, "NAME,MARRIED,SALARY" )
   CLOSE TED

//   XBROWSER "TESTEDIT.DBF" FASTEDIT

return nil

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


We recommend using Record object created by FW_Record class (also known as TDatarow class in all previous versions) for editing any table, whether DBF, TDatabase, ADO, Mariadb RowSet, Dophin Query, etc. You use exactly the same code for any datasource and the class takes care of navigation and saving data.

Usage:
1) Prepare a dialog similar to the above function MyDlgEdit( oRec ), using the record object.

For navigation and save buttons use the exact actions used in the sample, for all dialogs.

You can use the same code for a table of the same structure on any database.

2) Link this function to Browse with
Code: Select all  Expand view  RUN

oBrw:bEdit := { |oRec| Yourfunction (oRec ) }
 


3) For Add/Edit/Delete actions of Browse, please use the methods oBrw:EditSource( .t. ), oBrw:EditSource() and oBrw:Delete(). Always use these methods only. This provides the same functionality irrespective of the datasource.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse edit dialog and navigation

Postby Silvio.Falconi » Fri May 31, 2019 4:14 pm

Nages,
I compile it
then I press the first button "Add" and the exe make an error


Image

change this line

DEFINE BUTTON OF oBar PROMPT "Add" ACTION oBrw:EditSource( .t. )

instead of

DEFINE BUTTON OF oBar PROMPT "Add" ACTION oBrw:EditSoure( .t. )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xBrowse edit dialog and navigation

Postby Silvio.Falconi » Fri May 31, 2019 8:02 pm

is it compatible with tdatabase ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xBrowse edit dialog and navigation

Postby nageswaragunupudi » Sat Jun 01, 2019 12:45 am

Thanks for the correction. I corrected the source code above.
The code for xbrowse and edit dialog is the same for TDatabase also.
You can link the edit dialog directly to the tdatabase object and need not link it with xbrowse.

This is the code for TDatabase. Please note that the same xbrowse and dialog code works without changes.
Code: Select all  Expand view  RUN
#include "fivewin.ch"

REQUEST DBFCDX

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

function Main()

   local oDbf

   CreateTestDbf()

   oDbf        := TDatabase():Open( nil, "TESTEDIT", "DBFCDX", .T. )
   oDbf:bEdit  := { |oRec| MyEditDlg( oRec ) }

   TestBrowse( oDbf )   // Browse and Edit
   TestEdit( oDbf )     // Edit without browse

   oDbf:Close()

return nil

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

INIT PROCEDURE PrgInit

   SET DATE BRITISH
   SET CENTURY ON
   SET TIME FORMAT TO "HH:MM:SS"
   SET DELETED ON

   FWNumFormat( "B", .t. )  // "B" for British
   SetGetColorFocus()

return

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

static function TestBrowse( oDbf )

   local oDlg, oFont, oBar, oBrw

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 650,600 PIXEL TRUEPIXEL FONT oFont
   DEFINE BUTTONBAR oBar OF oDlg SIZE 100,32 2010

   @ 40,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oDbf AUTOCOLS ;
      CELL LINES NOBORDER FOOTERS FASTEDIT

   WITH OBJECT oBrw
      :nEditTypes       := EDIT_GET
      WITH OBJECT :id
         :cEditPicture  := "@L 9999"
      END
      WITH OBJECT :Married
         :SetCheck()
         :nFooterType   := AGGR_COUNT
         :bSumCondition := { |v,o| v } // count married only
      END
      WITH OBJECT :Salary
         :nFooterType   := AGGR_SUM
         :cFooterPicture:= NUMPICT( 10, 2 )
      END
      :nStretchCol   := 2
      :MakeTotals()
      //
      :CreateFromCode()
   END

   // --> Add/Edit/Delete Actions common to all browses
   DEFINE BUTTON OF oBar PROMPT "Add"     ACTION oBrw:EditSource( .t. )
   DEFINE BUTTON OF oBar PROMPT "Edit"    ACTION oBrw:EditSource()
   DEFINE BUTTON OF oBar PROMPT "Delete"  ACTION oBrw:Delete()
   // <-- End of standard buttons


   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

return nil

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

static function TestEdit( oDbf )

   local oRec

   oRec  := oDbf:Record()
   oRec:Edit( nil, .t. )  // 2nd parameter .t. to enable navigation

return nil

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

static function MyEditDlg( oRec )

   local oDlg, oFont,oBold, oItalic, oBtn, oSay

   // Note: If oRec:RecNo is 0, it is a new record for append

   DEFINE FONT oFont   NAME "TAHOMA" SIZE 0,-14
   DEFINE FONT oBold   NAME "TAHOMA" SIZE 0,-15 BOLD
   DEFINE FONT oItalic NAME "TAHOMA" SIZE 0,-12 ITALIC

   DEFINE DIALOG oDlg SIZE 400,260 PIXEL TRUEPIXEL FONT oFont TITLE "FW_Record Demo"

   @ 20,50 SAY oSay PROMPT { || If( oRec:RecNo == 0, "NEW EMPLOYEE", "EDIT EMPLOYEE : " + STRZERO( oRec:ID, 4 ) ) } ;
      SIZE 300,24 PIXEL OF oDlg CENTER VCENTER UPDATE FONT oBold

   @  70, 30 SAY "Name"    SIZE 120,24 PIXEL OF oDlg CENTER
   @  70,150 SAY "Married" SIZE 100,24 PIXEL OF oDlg CENTER
   @  70,270 SAY "Salary"  SIZE 100,24 PIXEL OF oDlg CENTER

   @ 100, 30 GET oRec:Name SIZE 120,26 PIXEL OF oDlg UPDATE VALID !Empty( oRec:Name )
   @ 100,200 CHECKBOX oRec:Married PROMPT "" SIZE 26,26 PIXEL OF oDlg UPDATE
   @ 100,270 GET oRec:Salary SIZE 100,26 PIXEL OF oDlg UPDATE PICTURE "99,999.99" RIGHT ;
         VALID ( oRec:Salary > 0 )

   @ 150,30 SAY { || If( oRec:RecNo == 0, "", ;
      "Last modified " + TTOC( oRec:updt ) ) } SIZE 340,24 PIXEL OF oDlg UPDATE CENTER ;
      FONT oItalic

   // valid for entire record. This is checked before saving
   oRec:bValid := <||
      if Empty( oRec:Name )
         MsgAlert( "Name can not be empty" )
         return .f.
      endif
      if oRec:Salary <= 0.00
         MsgAlert( "Salary should be a positive number" )
         return .f.
      endif
      return .t.
      >

   // --> Following button actions should exactly be the same for all dialogs

   @ 200, 20 BTNBMP oBtn RESOURCE FWBitmap( "top2" )      SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "First"  ;
            WHEN oRec:CanGoUp() ACTION ( oRec:GoTop(), oDlg:Update() )
   @ 200, 55 BTNBMP oBtn RESOURCE FWBitmap( "previous2" ) SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Previous"  ;
            WHEN oRec:CanGoUp() ACTION ( oRec:GoUp(), oDlg:Update() )
   @ 200, 90 BTNBMP oBtn RESOURCE FWBitmap( "next2" )     SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Next"  ;
            WHEN oRec:CanGoDn() ACTION ( oRec:GoDown(), oDlg:Update() )
   @ 200,125 BTNBMP oBtn RESOURCE FWBitmap( "bottom2" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Last"  ;
            WHEN oRec:CanGoDn() ACTION ( oRec:GoBottom(), oDlg:Update() )
   @ 200,160 BTNBMP oBtn RESOURCE FWBitmap( "new16" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "New"  ;
            WHEN !Empty( oRec:RecNo ) ACTION ( oRec:Load( .t. ), oDlg:Update() )

   @ 200,278 BTNBMP oBtn RESOURCE FWBitmap( "undo16" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Undo"  ;
            WHEN oRec:Modified() ACTION ( oRec:Undo(), oDlg:Update(), oDlg:SetFocus() )
   oBtn:lCancel   := .t.
   @ 200,313 BTNBMP oBtn RESOURCE FWBitmap( "save" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Save"  ;
            WHEN oRec:Modified() ACTION ( oRec:Save( .t. ), oDlg:Update() )
   @ 200,348 BTNBMP oBtn RESOURCE FWBitmap( "exit2" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "Close"  ;
            ACTION ( oDlg:End() )
   oBtn:lCancel   := .t.

   // <-- End of buttons


   oDlg:bPainted := { || oDlg:Box( oSay:nTop-1, oSay:nLeft-1, oSay:nBottom+2, oSay:nRight+2 ) }

   ACTIVATE DIALOG oDlg CENTERED VALID oRec:CloseMsg()

   RELEASE FONT oFont, oBold, oItalic

return nil

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

static function CreateTestDbf()

   local oDbf
   local aCols := { ;
      { "ID",     "+",  4, 0 }, ;
      { "NAME",   "C", 10, 0 }, ;
      { "MARRIED","L",  1, 0 }, ;
      { "SALARY", "N",  8, 2 }, ;
      { "UPDT",   "=",  8, 0 }  }

   local aData := { ;
      { "One",    .t., 20000 }, ;
      { "Two",    .f., 30000 }, ;
      { "Three",  .t., 35000 }  }

   oDbf  := TDatabase():Create( "TESTEDIT", aCols, "DBFCDX", "*" )
// oDbf:Append( "NAME,MARRIED,SALARY", aData )  // This also works
   oDbf:ArrayToDbf( aData, "NAME,MARRIED,SALARY" ) // This also works
   oDbf:Close()

return nil

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

 


You can test if this works with TData also.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse edit dialog and navigation

Postby Silvio.Falconi » Sat Jun 01, 2019 7:05 am

Thanks Nages,

for now I prefer to use tdatabase because in tdata there are many problems that I still can't solve: unfortunately I have two or three modules made with tdata that I have to convert to tdatabase. I want to ask you a question:

I'd like to open the client file from a simple function so that I can also load the indexes for example:

oCustomers: = OpenTData ("Customers", {"TAG01", "TAG02", "TAG03"})
oCustomers: SetOrder ("TAG01")
oCustomers: gotop ()


but i don't know how i did it with

Function OpenData (cDbf, aIdx)
LOCAL oDbf
Locals

oDbf: = TDatabase (): Open (nil, cDbf, "DBFCDX", .T.)

IF VALTYPE (aIdx) == "A"
FOR i: = 1 TO LEN (aIdx)
DBSETINDEX (aIdx [i])
NEXT
ENDIF

return oDbf


or perhaps not need open the indexes
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xBrowse edit dialog and navigation

Postby nageswaragunupudi » Sat Jun 01, 2019 7:17 am

When you are using DBFCDX, you need not open indexes separately. You need to do that for DBFNTX only.
If you open the DBF with DBFCDX all the index tags in the .cdx file are all automatically opened.

Just open the DBF and set order to any tag you want.
Use oDbf:SetOrder( "tagname" ) followed by oDbf:GoTop()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse edit dialog and navigation

Postby Silvio.Falconi » Sat Jun 01, 2019 7:32 am

ok

on normal code I opened all files and then on each procedure I made

SELECT CU (CU AREA OF CUSTOMER)

now how I can make to not repeat the string each time tdatabase()......
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xBrowse edit dialog and navigation

Postby TimStone » Sat Jun 01, 2019 6:17 pm

I use a a split dialog. In the upper half are all the edit fields, and in the lower half is the xbrowse. As the highlight bar is moved, the data for the edit fields is changed. It allows my clients the opportunity to see ALL data on a record, move quickly between records, edit instantly ( no popup delays ), and of course with indexed scrolling in the xbrowse, records are quickly found. (Open the image in a new window so you can see all the fields that are editable at once ). The coding behind this makes it work very quickly, and safely. I've used this display method dating back to the DOS coding in the 80's and 90's and it adapts quite well to Windows.

Image
Last edited by TimStone on Sun Jun 02, 2019 2:56 am, edited 3 times in total.
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: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: xBrowse edit dialog and navigation

Postby Silvio.Falconi » Sat Jun 01, 2019 6:45 pm

I wrong the message
Last edited by Silvio.Falconi on Sun Jun 02, 2019 11:46 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 84 guests