FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible to switch from Browser to Rec.-View in a Listbox?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Possible to switch from Browser to Rec.-View in a Listbox?

Posted: Sun Feb 03, 2008 02:25 PM

Hello, from Germany

I want to switch from Browse-Mode
to Record-Mode to edit the selected
Record in a listbox.
The first browser is a < normal > browser
The 2. shows just 1 record with field- and type infos.

Picture :

http://www.pflegeplus.com/pictures/outlook.jpg

In the first Col, i want to show the fieldnames.
In the second Col, i want to edit the fields.
The Listbox needs to have a scrollbar.

That means, the MATRIX of the browser has to be different.
In a normal browser, you have for each var a col and
each record a row.
The browser i need, has to show just 1 record.
I need 1 col for the varnames and the second col
for the var-contents. In the browser, i want to skip
to another record.

In some DB-Tools, i have seen somthing like that.
I can put the Record-Informations in a 2 dimensional-Array.
It works, but i have so save the array back to the database.
Is there maybe another way, to create it directly with database-fields ?

Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Possible to switch from Browser to Rec.-View in a Listbox?

Posted: Mon Feb 04, 2008 09:56 AM
Uwe,

This will give you an idea about how to implement it:
METHOD SetEdit() CLASS TWBrowse

   ::bLogicLen = { || RecCount() * ( FCount() + 1 ) }
   ::cAlias = "_EDIT"

   ::Refresh()

return nil

   do case
         case ::cAlias == "_EDIT"
	         DbGoTop()
	         DbSkip( Int( nRow / ( FCount() + 1 ) ) )
		 nField = ( nRow + 1 ) % ( FCount() + 1 )
                 return If( nField == 0, If( nCol == 0, "-------------", "-------------------------------------" ),;
		           If( nCol == 0, FieldName( nField ), cValToChar( FieldGet( nField ) ) ) )

   @ 48, 20 LISTBOX oBrw FIELDS "", "" HEADERS "FieldName", "Value" ;
      OF oWnd SIZE 672, 363 ALIAS Alias()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 223
Joined: Thu Dec 01, 2005 03:34 PM

Possible to switch from Browser to Rec.-View in a Listbox?

Posted: Sat Feb 09, 2008 03:19 PM
Is this what you want?

- Roger

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM

Possible to switch from Browser to Rec.-View in a Listbox?

Posted: Sat Feb 09, 2008 03:26 PM

Roger

I like your database tool .. would you mind sharing the code ?? I would like to adapt it to ADO for Sql Server ..

Thanks,

Rick Lipkin

lipkinrm29063@yahoo.com

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

DB-Tools as a public-project

Posted: Sat Feb 09, 2008 04:18 PM

Hello, from Germany

I'm planning a project, all users of the forum can join.

The Tools will have a practical-section, that means,
to handle everything, what you need for database-administration.
As well, it is a sample, how all classes can work together :
xBrowse, Office2007, Outlook2003
Included, there will be a section, for tryouts of any problems.
For the moment, the tools are in German and English.
For other languages we need somebody for translation.

The actual release should be shown in the forum
like : DBTools_2_8.zip ( like FWH )
The Topic must have a Descripton of changes in the new release.

The Basics are nearly finished. I still have to do some cleanings
and the English-Translation.
With the time, it could be the answer of many questions.

Regards
Uwe König

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM

Possible to switch from Browser to Rec.-View in a Listbox?

Posted: Sat Feb 09, 2008 04:33 PM

It is a pleasure for me if I can colaborate for spanish translation.

Roger: Beatiful yours browse.

Un saludo



Manuel
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Possible to switch from Browser to Rec.-View in a Listbox?

Posted: Sat Feb 09, 2008 04:46 PM

Thanks to NageswaraRao we have a working sample for

Synchronization of row and redord browse with xBrowser

on

http://www.fwcodesnips.com

Regards,
Otto

Posts: 223
Joined: Thu Dec 01, 2005 03:34 PM

Possible to switch from Browser to Rec.-View in a Listbox?

Posted: Sat Feb 09, 2008 08:36 PM
Hi Rick,

Yes, glad to share my code for synchronizing a browse with a record-edit. Just click below to download a zip file with my stuff.

http://www.leadersoft.com/files/browedit.zip

And here is another screenshot with another version where I've synched a browse with folders in a companion record-edit dialog...



This example is from our election campaign management software, and anyone selected from the browse of registered voters on the left gets their record data displayed in tabs on the right. One can edit data on either the browse or the tabs, and updates are synchronized between the displays. Also one can doubleclick on the column heading to change the index and reorder the browse display. Note the buttons in the lower middle whereby cell editing of a field in any column can be be set to exit either down or right. In this case, the "List" button displays another dialog for demographically selecting voters' names for mailing, "walking" and phoning lists, etc.

- Roger
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Examples

Posted: Sat Feb 09, 2008 09:29 PM
Here is the way I handle it in a regular program ...



Tim
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: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Listbox in xBrowse for 1 Record

Posted: Sun Feb 10, 2008 12:46 PM

Hello Roger,

Your sample looks very nice.
When you open a unknown database,
you don't have a resource with the placed fields.
For your inhouse-software you create one.
For a DB-Tool, it is the only way, to create a Browser
together with a Listbox for the selected record
when you want to see the field-informations.
I have seen a tool DBADMIN ( it is done with Visual-Object )
There, they go to edit-mode for a single record
in a extra dialog with no field-Information and no
connection with the main-browser.
Like it is shown in your sample, it is much better
to handle.

Greetings from Germany
Uwe

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 223
Joined: Thu Dec 01, 2005 03:34 PM

Possible to switch from Browser to Rec.-View in a Listbox?

Posted: Tue Feb 12, 2008 07:44 PM

Glad you like it, Uwe.

Hopefully, you can adapt some of the concepts to do what you want to do, regardless of which browse tool you are using. Though I'm using a much advanced version of Tcbrowse, Tsbrowse is close enough to it that these concepts should be easy to implement there.

Good luck!

  • Roger

Continue the discussion