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

Post Reply
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

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

Post by ukoenig »

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:
Last edited by ukoenig on Tue Feb 05, 2008 12:20 pm, edited 5 times in total.
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.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Uwe,

This will give you an idea about how to implement it:

Code: Select all

METHOD SetEdit() CLASS TWBrowse

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

   ::Refresh()

return nil    

Code: Select all

   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 ) ) ) )  

Code: Select all

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

Antonio Linares
www.fivetechsoft.com
User avatar
Roger Seiler
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA
Contact:

Post by Roger Seiler »

Is this what you want?

- Roger

Image
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

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
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

DB-Tools as a public-project

Post by ukoenig »

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.
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

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

Roger: Beatiful yours browse.
Un saludo

Manuel
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Thanks to NageswaraRao we have a working sample for

Synchronization of row and redord browse with xBrowser

on

http://www.fwcodesnips.com

Regards,
Otto
User avatar
Roger Seiler
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA
Contact:

Post by Roger Seiler »

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...

Image

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

Examples

Post by TimStone »

Here is the way I handle it in a regular program ...

Image

Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Listbox in xBrowse for 1 Record

Post by ukoenig »

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.
User avatar
Roger Seiler
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA
Contact:

Post by Roger Seiler »

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
Post Reply