GENERIC BROWSE OBJECT CLASS
by: Danny A. del Pilar
---------------------------

NOTE: The Actual code for generic browse object class (source code) is not uploaded with these files because this Generic Browse Object Class is in its infancy stage. It's not a tbrowse class but instead utilized a call to define browse. I hope that I can build a tbrowse class or modify the clipper's tbrowse class. But due to some work load I cannot accomodate more than what I can take. So instead of doing it, I concentrated my effort with this browse object class to quickly help me build a prototype.

------------------------------------------------------------------------------

Well, the screenshot attached with this has traces it's roots back to my clipper days.

I call it generic browse object class because I want all the tables on my application to be loaded in the same user interface. Because I want them to learn the applications in 30 minutes pretty much like those application I developed using clipper. So I wont spend much time in training them with the interface and how to use the program. Although help is there but I believed that making it simple for users/customers makes them come back for more. Besides, I wanted to design the User Interface as ergonomics as I can so that in my own littleway (with few wrist, hand and finger movements) I can help them prevent Carpal Tunnel Syndrome. 

Below is just a sample code on how to call the CLASS GenericBrwObj. You might notice that I
still used the begin and end sequence block just like clipper. Because as much as possible I want to maintain a single point of entry and single point of exit for every routine. Though it's not easy in doing it this way with Windows (and not recommened actually). Perhaps sometime in the future when I have a clear set of mind for sure I will re create it again. For now my goal is to make a prototype so I stick with that goal by hook or by crook. LOL!

Well with this, I was trying to build a template for rapid application prototyping for presentation to clients and or customers after the initial conceptualization of application design and data/table normalization. So while I am developing the application itself, I can issue a candidate released for their testing/familiarization but of limited capability so that I can capture the adjustment early rather than do the adjustment after the implementation.

And in doing this, I can utilized code reused which truly help to shorten development time for a new application. So for now this is what I wanted to do....

Regards,


Danny

Regards,


Danny del Pilar <dhaine_adp@yahoo.com>



------------ Here is a sample routine on how to call the CLASS GenericBrwObj --------

DECLARE WINDOW frmGenBrowse
***************
function Main()

   PRIVATE lBTNExtra1 := FALSE
   PRIVATE lBTNExtra2 := FALSE

   PRIVATE oTable

   BEGIN SEQUENCE
   oTable := GenericBrwObj():New()

   IF TableDefinitions() = Failure
      BREAK
   ENDIF

   oTable:BeginBrowseDisplay()

   END SEQUENCE
   RETURN NIL




**********************************
static function TableDefinitions()

   LOCAL lRetVal   := Failure
   LOCAL lDispMsg  := FALSE
   LOCAL cMsgTitle := "File Open Error"
   LOCAL cBrkMsg   := ""
   
   BEGIN SEQUENCE

   IF .NOT. NETUSE( (LoanType), "LOANTYPE", Shared, ReadWrite )
      cBrkMsg  := "Cannot open file: " + LoanTypes
      lDispMsg := TRUE
      BREAK
   ENDIF
   ORDLISTADD( ( LoanType ) )
   ORDSETFOCUS( "LoanCode", ( LoanType ) )
   DBGOTOP()
   
   oTable:cWndTitle  := "Available Loan Scheme"
   oTable:cMainAlias := "LOANTYPE"
   oTable:cMainFocus := "LoanCode"
   oTable:cMainFile  := LoanType
   oTable:cImageHome := ImageHome
   
   oTable:acFields_  := { "LOANTYPE->F1", "LOANTYPE->F2" }
   oTable:acHeaders_ := { "Code","Description" }
   oTable:anWidths_  := { 200, 300 }     

   oTable:bTaskAdd  := {|| GraphicUserInterface( "ADD" ) }
   oTable:bTaskEdit := {|| GraphicUserInterface( "EDIT" ) }
   oTable:bTaskExit := {|| BrowseWindowCloseEvent() }
   oTable:bTaskWndInterActiveClose := { || BrowseWindowInterActiveClose() }
   oTable:bKpressCtrlEnter := ""
   oTable:bTaskDblClick := {|| GraphicUserInterface( "EDIT" ) }

   lRetVal := Success
   END SEQUENCE
   IF lDispMsg
      MSGSTOP( cBrkMsg + ".DBF", cMsgTitle )
   ENDIF
   RETURN lRetVal


