xBrowse edit dialog and navigation

User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: xBrowse edit dialog and navigation

Post by TimStone »

This original post was about edits with a browse. I was responding to that post with a method I use to make editing of a browse list easier and faster. It's a concept my clients really appreciate. I really don't see how that relates to your question following it. I was strictly addressing the question of edit controls and a faster means of moving through a lot of data. It has absolutely no relationship to the database ( though I do use tdatabase / tdata / trecord ) since I built the same concept back with Clipper and DOS ... and in fact, it probably dates all the way back to dBase II ...
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse edit dialog and navigation

Post by reds »

Mr Rao

Thanks for the demo program,yes that is what I was after


On a GET I tried using VAR oRec:Fieldget() but I get a "invalid value" compiler error

I tried using field number and field name as a parameter

Yet this method works ok for MSGINFO(orec:fieldget(2)) or MSGINFO(orec:fieldget("FIRST"))

Not a problem as I will use oRec:adata[nFieldNumber][2]

Thanks
Peter
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse edit dialog and navigation

Post by nageswaragunupudi »

They are not safe.

Please use oRec:fieldname

When we made this class this is how we expect the usage to be.
Regards

G. N. Rao.
Hyderabad, India
shri_fwh
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: xBrowse edit dialog and navigation

Post by shri_fwh »

Hi Tim,

The screen design is good specially the Icon's on the Title bars. May I ask you to provide the code ( Just Toolbar ) along with Icons ? Thanks in advance...!

Thanks
Shridhar
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse edit dialog and navigation

Post by reds »

Mr Rao

When when adding a new record in a lot of cases the blank fields will need to be auto filled
with data from the previous edit dialog.So I was going to make a copy of oRec:Data and on the
new blank record overwrite the current oRec:aData and oRec:aOrg with data from the copy.

Is there a better way of doing this ?

Regards
Peter
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: xBrowse edit dialog and navigation

Post by TimStone »

All of my coding uses an .RC file for screens. The bar is standard FWH.

Control in .rc file:

Code: Select all

    CONTROL                 "", 100, "TBar", 0|WS_CHILD|WS_VISIBLE, 0,0, 660, 30
 
Code for the button bar:

Code: Select all

   // Define the button bar
   REDEFINE BUTTONBAR oBarInv ID 100 SIZE 60,55 OF oDiw 2015
          oBarInv:bClrGrad := aPubGrad

   DEFINE BUTTON oBtn1 OF oBarInv RESOURCE "HRADD" PROMPT "Add" TOOLTIP "Add a new part record"  ;
      ACTION ( oLbxin:gobottom(), ::oInventory:AddNewPart(), oLbxin:refresh( ),;
       ::oPart:load(), oDiw:update( ), oNum:setfocus( ) ) GROUP LABEL "Parts" 

   DEFINE BUTTON oBtn2 OF oBarInv RESOURCE "HRSAVE" PROMPT "Save" TOOLTIP "Save this record" ;
      ACTION ( ::oPart:save( ), oLbxin:refresh(), oDiw:update( ), oLbxin:setfocus( ), oLbxin:skip(0) )

   DEFINE BUTTON oBtn4 OF oBarInv RESOURCE "HRDELETE" PROMPT "Delete" TOOLTIP "Delete the selected part";
      ACTION ( ::oInventory:DeletePart( ), oLbxin:skip(1), ::oPart:load(), oDiw:update(), oLbxin:setfocus( ) ) ;

//. Add in more buttons here
//

     DEFINE BUTTON oBtn0 OF oBarInv RESOURCE "HRHELP" PROMPT "Help" TOOLTIP "OnLine Manual" ;
        ACTION WinExec( "hh asw10.chm" ) GROUP BTNRIGHT

     DEFINE BUTTON oBtn7 OF oBarInv RESOURCE "HREXIT" PROMPT "Exit" TOOLTIP "Exit inventory" ;
       ACTION ( oDiw:end( ), ::oInventory:end( ) ) BTNRIGHT


 
You can also define the menus for buttons ... and it all works quite smoothly. You will notice that I'm using data objects. I use tData / tRecord. The browse references the file as a tData object. A tRecord object is created, and each time a new record is highlighted, the :load() places the values of that record into that object. The gets all reference the tRecord object. It is very smooth.

You can add as many buttons as you wish

The icons are all created inhouse for this application, and are proprietary so I can't post them. However, I use Axialis Icon Workshop to create them, and save them as .bmp files ( 32x32 ) then include them all in the .rc file.
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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse edit dialog and navigation

Post by nageswaragunupudi »

reds wrote:Mr Rao

When when adding a new record in a lot of cases the blank fields will need to be auto filled
with data from the previous edit dialog.So I was going to make a copy of oRec:Data and on the
new blank record overwrite the current oRec:aData and oRec:aOrg with data from the copy.

Is there a better way of doing this ?

Regards
Peter
For prefilling data you may consider the methods:
1) oRec:Copy() and oRec:Paste()
2) oRec:CopyFrom( oOtherRec )
3) oRec:SetDefault( cField, uValue, [lCanModify] )
or
oRec:SetDefault( { { field, value},....} )
SetDefaut values are used only when appending

For example, you can try this:

Code: Select all

   @ 200,160 BTNBMP oBtn RESOURCE FWBitmap( "new16" )   SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "New"  ;
            WHEN !Empty( oRec:RecNo ) ACTION ( oRec:Copy(),oRec:Load( .t. ),oRec:Paste(), oDlg:Update() )
 
Regards

G. N. Rao.
Hyderabad, India
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse edit dialog and navigation

Post by reds »

Thanks for that I will take a look at these

On your example code I want to replace the checkbox and show a bitmap file as below but it never changes from the intial setting.

Also I would like to use the toggle switch (green for on) bitmap that is used in the browser default edit dialog,where
is this located.

Thanks
Peter

Code: Select all

  @ 100,190  BTNBMP  NOBORDER OF oDlg  SIZE 30,15;
               FILE  IIF( oRec:MARRIED, "..\bitmaps\on.bmp", "..\bitmaps\off.bmp"  )     ;
                         ACTION ( oRec:MARRIED := ! oRec:MARRIED, ;
                             ::SetImages( IIF( oRec:MARRIED, "..\bitmaps\on.bmp", "..\bitmaps\off.bmp"  ) )  ) UPDATE
     //  @ 100,200 CHECKBOX oRec:Married PROMPT "" SIZE 26,26 PIXEL OF oDlg UPDATE

 
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse edit dialog and navigation

Post by nageswaragunupudi »

Also I would like to use the toggle switch (green for on) bitmap that is used in the browser default edit dialog,where
is this located.
That is not a bitmap. It is a control, SWITCH control. Please see fivewin.ch for usage.

In the example, I posted above, instead of checkbox, use this code:

Code: Select all

   @ 103,180 SWITCH oRec:Married SIZE 40,18 PIXEL OF oDlg UPDATE OVALSTYLE BORDERSIZE 1 THUMBSIZE 1
 
Image
Regards

G. N. Rao.
Hyderabad, India
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse edit dialog and navigation

Post by reds »

Any idea why the bitmap doesn't refresh with new value

Thanks for Switch info,though doesn't appear to be setup to run with a resource file

Regards
Peter
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse edit dialog and navigation

Post by nageswaragunupudi »

Please try this:

Code: Select all

   @ 100,190 BTNBMP oBtn ;
      FILE "c:\fwh\bitmaps\on.bmp", nil, "c:\fwh\bitmaps\off.bmp" ;
      SIZE 26,26 PIXEL OF oDlg CENTER NOBORDER UPDATE ;
      ACTION ( oRec:Married := !oRec:Married, ::Refresh() )
   oBtn:bBmpNo := { || If( oRec:Married, 1, 3 ) }
 
Regards

G. N. Rao.
Hyderabad, India
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse edit dialog and navigation

Post by reds »

Belated thanks,now working fine
Regards
Peter
Post Reply