BROWSE vs TBROWSE observation in Harbour MiniGUI

44 views
Skip to first unread message

Grigory Filatov

unread,
Oct 23, 2025, 2:46:27 AM (5 days ago) Oct 23
to Harbour Minigui
Hi there,

Please write comments to the following observation.

The two programs, browse_demo.prg and tbrowse_demo.prg, both display and edit database records, but they differ in the type of grid control used — BROWSE versus TBROWSE. These two controls represent different generations of data browsing components, each with distinct behavior, customization, and rendering capabilities.

Major Conceptual Differences

| Feature                      | BROWSE Control                                        | TBROWSE Control                                                                                       |
|------------------------------|-------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| Library Source               | Built into MiniGUI core                               | From the TSBrowse library (#include "tsbrowse.ch")                                                    |
| Control Syntax               | Declared using @ ... BROWSE oBrowse                   | Declared using DEFINE TBROWSE oBrowse ... END TBROWSE                                                 |
| API Style                    | Procedural and simple; few configuration points       | Object-oriented with extended configuration via WITH OBJECT oBrw ... END WITH                         |
| Customization Level          | Basic (headers, widths, and event callbacks only)     | Advanced (colors, scroll styles, header alignment, cell margins, grid line styles, wheel lines, etc.) |
| Appearance                   | Classic Clipper-like table; Windows-native look       | Modernized grid control with stylized lines and color support                                         |
| Event Model                  | Simple ON DBLCLICK and refresh call                   | Multiple object methods (:Refresh(), :SetAlign(), :SetColor(), etc.)                                  |
| Performance and Sync         | Uses SET BROWSESYNC ON; depends on workarea buffering | Independent dataset handler; finer control over refresh and redraw                                    |
| Scrolling / Navigation       | Fixed standard scrolling behavior                     | Customizable (:nWheelLines, :lNoHScroll, :ResetVScroll() etc.)                                        |
| Column Reordering or Sorting | Not supported                                         | Optionally disable or enable via flags like :lNoChangeOrd                                             |

Code-Level Differences

1. Browser Definition:
   - browse_demo.prg directly declares an inline @ 10,10 BROWSE oBrowse ..., assigning headers and fields.
   - tbrowse_demo.prg defines a TBrowse block with extended initialization and a setup procedure called BrowseSetup() to configure many attributes after creation.

2. Styling and Configuration:
   - The TBrowse version uses multiple object methods (:SetColor, :SetAlign, :nHeightCell, :nLineStyle) for customized display.
   - The basic Browse version uses MiniGUI defaults without explicit cell or header styling.

3. Handling Record Selection:
   - Both versions open a modal child window on double-click to edit records.
   - The TBrowse demo explicitly refreshes the control via oBrowse:Refresh(.F.) after saving, while the Browse demo performs oMainWin.oBrowse.Refresh and displays confirmation with MsgInfo.

4. UI Feedback and Behavior:
   - TBrowse disables column moving or reorder via .lNoChangeOrd, and allows line-coded grid backgrounds like COLOR_GRID_INACTIVE.
   - The basic Browse lacks custom scroll control or per-column alignment.

5. Rendering and Responsiveness:
   - TBrowse provides smoother visual updates and wheel-based scrolling (:nWheelLines), supporting Windows-like experience.
   - Browse is simpler and more compatible with legacy Harbour MiniGUI scripts.

Summary

- BROWSE is simpler, procedural, and easier for basic DBF data viewing and editing—suitable for quick demos or small tools.  
- TBROWSE (TSBrowse) is a modern, object-oriented grid offering rich appearance, scroll behavior, and flexible formatting—ideal for professional UIs or responsive layouts.  

In short, *browse_demo.prg* demonstrates classic Harbour BROWSE, while *tbrowse_demo.prg* showcases a fully featured TBROWSE with style customization, color handling, and improved UX options.

I've attached completed source code of these examples for your review.

Your feedback is welcome.

Regards,
Grigory
browse-test.zip

Grigory Filatov

unread,
Oct 23, 2025, 6:12:19 AM (5 days ago) Oct 23
to Harbour Minigui
Sorry, I forgot to add a screenshot of this app:
tbrowse.png

четверг, 23 октября 2025 г. в 08:46:27 UTC+2, Grigory Filatov:
Reply all
Reply to author
Forward
0 new messages