Saturday, March 28, 2009

What is HWGUI ?

From : http://kresin.belgorod.su/hwgdoc.html HwGUI 2.16 reference manual by Alexander S.Kresin, Sept 2006


1.1. What is HwGUI

HwGUI is an add-on library for Harbour and xHarbour, intended for creating GUI applications. There are two versions of HwGUI - Win32 version, which is based on direct calls of Win32 API, and GTK version, which uses GTK2 library and can be used under any platform where GTK is implemented ( Linux, Windows, probably MacOS ). While developing HwGUI I tried to hide from the end user - Harbour programmer technical details of API calls and to build a set of commands and functions, which could allow easily create and manage GUI objects.


1.2. History of HwGUI


I began to work on HwGUI in August 2001 and the first version was released on August 21. My initial intention was to create a small and fast GUI lib mainly for my own needs. And already in October I had wrote the first small application with HwGUI for my firm, it reads the databases, created and managed with the accounting system, generates some documents and sends them by fax.

Firstly, from the initial release and til the 1.3 HwGUI didn't use the OOP paradigm - and I even had declared this as one of HwGUI features. My main motivations was speed and stability. Harbour's implementation of classes at that time had some bugs and I didn't want to add problems to myself. And, of course, access to object's variables is more slow than access to the array items. OOP is an additional level and using of it reduces application's performance.


But later I have arrived at a decision to make HwGUI OOP based - to simplify user interface and make it better structured and more convenient. So starting from the release 2.0 HwGUI is based on OOP paradigm.

Since the autumn'2003 HwGUI is hosted by SourceForge, and there is a group of developers working on it. Thanks to all of them for participation and contributions.

Yet another important milestone in HwGUI's timeline is a December,2005 - where a development of GTK version has been started, so HwGUI became a cross-platform tool.

Wednesday, March 25, 2009

What is Clip ?

CCH :
Just extracted this information from the Guestbook entry by Daniel Pascuel...


Preprocessor.
Fully compatible with CA-Clipper with some new possibilities.

Compiler.
slight incompability with CA-Clipper, which may be resolved easily, using the "search and replace" method. In addition it can compile to C program, byte-code, dynamic library and mixed C+byte-code.

Very fast and efficient OO-model.

Difference from CA-Clipper reveals itself in part of descriptions and making an object, but in part of using the ready objects syntax and logic of functioning is completely the same.
It is possible to write programs on CLIP, without using other syntax excepting OOP.
Initial support syntax from FS,CAVO,FoxPro.
C-API. has much more possibilities than CA-Clipper.

Full international support .
Including adjustment on any code page of any language on any keyboard (with stelnet emulator only or on consoles), substitution of string constants during execution and changing a logic of functioning with strings, given for functions alpha, digit, lower, upper, subscripted weight factors etc. Support two-bytes charsets BIG5, GB, may be Korean, Japan too.

GUI, based on GTK.
Provides using of all widgets and processing the events

Using of dynamic libraries, loading and execution of the byte-code from external files ( in run-time, too ).

Compatibility.
up to Clipper 5.3 (support of objects menu, button, check and other get-objects), as well as standard classes tbrowse,get,error.

Are implemented a lot of CA_Tools functions, including all functions for processing the lines, dates, files, mathematicians.

support all SIX functions and features

MEM,DBF,DBT,FPT,NTX,CTX,CDX,NSX...

VFP data types; datetime,currency

RDD allows to use your own drivers, as well as use a driver, combined from several different drivers.

RDD also allows to use only OO-style, without using of aliases

Multitask support.
Builtin simple non-preemptive multitask model

CODB - CLIP Object Data Base.
Library and utils for object storehouse

SQL.
libraries and classes for direct access to SQL-servers (PG,MySql,Oracle,Interbase)
ODBC and ODBC bridge to Windows drivers.
SQL-interpreter and commands, compatible with FoxPro
Other possibilities .

Overloading operators for objects.

Support of regular expressions.

function for TCP/IP sockets connections

COM_() functions

Rushmore like technology, but more fast and efficient.

Support of very-large-scale numbers with unlimited accuracy.

Support of graphic files PNG,GD,JPEG and primitives like lines, rectangles, firing ranges, circumferences etc.

Several common classes for word processorses, html/cgi programms.

Several utilities for interpreting the patterns of the documents, www_sql,clip_bl, clip_blank, clip_sql, clip_hindex, clip_hseek etc.

multiwindows interactive debugger.

Supported OS’es.
Linux, FreeBSD, OpenBSD, SPARC & x86 Solaris, IBM mainframe with TurboLinux, Win32 ( with CYGWIN development tools)

AND IS FREE !!!!!


Home Page
www.itk.ru/english/index.shtml

Download
sourceforge.net/project/showfiles.php?group_id=170673&package_id=194873&release_id=461153

Saturday, March 21, 2009

HMG: Grid versus Browse [Updated 25th March 2009]

CCH :
According to the MiniGUI Help File, a Browse control is a general purpose database browser.
while a control Grid is a container object that displays data in rows and columns, and is similar in appearance to a Browse window.

Q1. So, what are the differences ?

Q2. When to use BROWSE ?

Q3. When to use GRID ?

Sudip :

Q4. For browse control (for data editing), do we need to use table "EXCLUSIVELY" ?


Answers

1. Rathinagiri (HMG Forum) :

1.1 Browse controls are always linked with one table (that too a .dbf table).

1.2 Grid controls are for used for other purposes where, you wish to represent data in row,col format. For example, it may show a two dimensional array!

1.3 All the browse controls are grid controls but not vice versa.

2. MOL aka Malek, Poland (HMG Forum)

2.1 I think you will have problems with browsing huge tables (exhausting memory, etc) while using grid. Using Browse, I didn't found problems with database which has 100MB.

2.2 You need to open table in exclusive mode only when you want to add records or edit record via ALT-A, ALT-E.

2.3 If you open table in shared mode, you must write your own function to add, edit or delete rows.

2.4 WORKAREA property of Browse is available at control definition only.


3. Sudip, Kolkata, West Bengal India

3. 1 I just found a big difference in Grid and Browse in MiniGUI extended!
If you use SET AUTOADJUST ON. Then Grid will be auto adjusted, but normal Browse (not tsbrowse) will not! :)

3.2 As per help file (hmg_hlp.chm), we can set WORKAREA during definition of browse only! Cannot change on the fly!

3. Bicahi Esgici, HMG Forum, Turkey

Hi to all Clipper and especially HMG fans

I want give a humble answer to an unanswered question in Saturday, March 21, 2009 post HMG; Grid versus Browse;

Sudip ;

Q4. For browse control (for data editing), do we need to use table "EXCLUSIVELY" ?

A4. No. If your application will run in a single machine this doesn’t matter. In a network environment you can’t open your files exclusively. If so, only one user (who come first) can use your application. Than, you MUST use SHARED mode. BTW you don’t need specify SHARED mode option every open (USE); setting globally EXCLUSIVE OFF is sufficient.

When a file open by shared, editing need some considerations. Under Browse or not, you have LOCK every record before and UNLOCK after edit ( changing record pointer also issue an UNLOCK). LOCK ( .T.) property of BROWSE successfully achieve this duty for you.

While a BROWSE active, ALT-A allow row appending to table. This is only issued an APPEND BLANK command. This command automatically LOCK new appended (empty) record. So, doesn’t require any precaution.

Precaution required for operations intended multiple records, such as PACK, ZAP, APPEND FROM, DELETE FOR ... / ALL, RECALL FOR ... / ALL, REPLACE FOR ... / ALL, UPDATE ON ...

The best way for such operations is "close" application to network ( all user ) and performing on a single machine. Another way is using FLOCK() for a limited time.

I hope that this answer will be useful.

Regards and happy HMG’ing

Tuesday, March 17, 2009

Programming MDI with MiniGUI - Part II [Updated 22nd march 2009]

After tinkering with MDI programming and with the help of Grigory of HMG Extended Forum :-






Basic syntax for a Browse which works perfectly in a non-MDI environment is as follows :-

[ @ , ] BROWSE
[ ID ]
[ OF | PARENT | DIALOG ]
WIDTH
HEIGHT
HEADERS
WIDTHS
WORKAREA
FIELDS
[ VALUE ]
[ FONT SIZE ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP ]
[ BACKCOLOR ]
[ DYNAMICBACKCOLOR ]
[ DYNAMICFORECOLOR ]
[ FONTCOLOR ]
[ ON GOTFOCUS | ]
[ ON CHANGE | ]
[ ON LOSTFOCUS | ]
[ [ ON DBLCLICK | ] | [ EDIT | ALLOWEDIT [ INPLACE ] ] [ APPEND | ALLOWAPPEND] ]
[ ON HEADCLICK | ]
[ WHEN ]
[ VALID ]
[ VALIDMESSAGES ]
[ READONLY ]
[ LOCK ]
[ DELETE ]
[ NOLINES ]
[ IMAGE ]
[ JUSTIFY ]
[ NOVSCROLL ]
[ HELPID ]
[ BREAK ]

However, please note that for MDI environment:-

[ [ ON DBLCLICK | ] | [ EDIT | ALLOWEDIT [ INPLACE ] ] [ APPEND | ALLOWAPPEND] ]

a) EDIT/APPEND does not work
b) You may use EDIT INPLACE

This is exactly why I wrote my own UDF to replace them :-)

Update on 23rd March 2009

Finally, perfected (with the help of Grigory of HarbourMiniGUI Forum) TILING/CASCADE of Child Windows populated with different DBF

Mel Smith : From CA-Clipper to xHarbour+HMG

CCH: On reading a email from Sudip regarding Mel Smith's migration from CA-Clipper to xHarbourt+HMG, I wrote to Mel Smith on 16th March 2009 and obtained his consent to republish it here.

Mel Smith to Sudip

Sudip,

Many people are starting to use the 'IDE' method (and, apparently successfully).

However, I am 'old-fashioned' and so I hand-code everything, and I use the 'HBMAKE.EXE' utility of xHarbour to build my apps.

If you provide me with an email address that allows attachments (btw, Gmail does *not* allow attachments), I will forward my BLD.BAT file, my xxx.BC file that is a parameter to HBMAKE, and my main app plus one other module for you to see how I proceed.

My conversion procedure is usually:

1. Make a copy of the original Clipper 5.2e program and all its various modules
2. Convert this copy to proper xHarbour (fixing all previous bad styles to proper styling, etc, etc)
3. With all modules converted to xHarbour, run this console-style program to ensure it works as good or better than the Clipper app
4. Start windowizing:
a. Start with the Function Main() and build a main window.
b. Add the main menu to this window
c. In one of the menu options, call/activate a simple sub-function (e.g., build all indexes)
d. Go to this sub function and add a child window and carry on with the conversion.
e. Go to c. again :)))

I have included the Main Window definition from the Main Function from one of my apps below:


... there are 1480 lines of setup before the following initialization of the app's Main Window ...

BTW, I had an old app named ACT (for Accounting -- I always use 3 letters for my various apps)
When I started converting to 'windows' I just added a 'W' to the beginning of 'ACT' . Thus, WACT is the app name
Please don't assume the code below is 'Good' or 'Sophisticated'. It is *not* ! It is just *my* conversion of old stuff. But it does work., and it is quite simple. There are about 48 separated modules I had to convert. The fragment below is part of the Main module

You will note that some of the conversion has not been required or completed yet (i.e., the donothing() function refers to this

...
...
SET MULTIPLE OFF

SET NAVIGATION EXTENDED
cWIN := "WACT"

DEFINE WINDOW WACT ;
AT nMTOP,nMLEFT ;
WIDTH nMWIDTH HEIGHT nMHEIGHT ;
TITLE "Accounting Control for A/P, A/R and Payroll: " + GVERSION + ;
" ( on Drive " + GNETDRV+" )" + " Process Date : " + GTHEN ;
ICON "WORLD" ;
FONT "Arial" SIZE 12 ;
MAIN ;
ON INIT {|| (IIF(lRBLDIDX,(WACT.LABNDX.SHOW,WACT.NDXFIL.SHOW, ;
WACT.INDEXPROG.SHOW,RBLDIDX(lSETUPDBF:=.T.)),), ;
WACT.LABNDX.HIDE,WACT.NDXFIL.HIDE,WACT.INDEXPROG.HIDE, ;
(GABORT := .NOT. SETUPDATES(GDATE), ;
IIF(GABORT,DOMETHOD("WACT","RELEASE"),.T.)), ;
SETSTATUS(cWINSTATUS:=" Ready for Menu Selection"))}

DEFINE MAIN MENU
POPUP "Accounts &Payable"
ITEM " 1. Add/Edit A/P Transactions" ACTION {||MNTPAY(),DBCLOSEALL()}
ITEM " 2. Add/Edit C/R Transactions" ACTION DONOTHING() DISABLED
ITEM " 3. Load Suppliers" ACTION DONOTHING() DISABLED
ITEM " 4. Update Supplier A/P File" ACTION DONOTHING() DISABLED
ITEM " 5. Update Purchase Order File" ACTION {||MNTPCH(),DBCLOSEALL()}
ITEM " 6. Fix Vend Acct. Nos. in A/P" ACTION DONOTHING() DISABLED
ITEM " 7. P.O Report Menu" ACTION DONOTHING() DISABLED
ITEM " 8. A/P Reports / Cheques Menu" ACTION {||PAYREPS(),DBCLOSEALL()}
ITEM " 9. C/R Reports / Cheques Menu" ACTION DONOTHING() DISABLED
ITEM " A. Multi-Job Costing Tables" ACTION {|| LOADCOST("WACT"),DBCLOSEALL(), ;
SETPROPERTY("WACT","oSTOPSCAN","VISIBLE",.F.), ;
SETPROPERTY("WACT","oSTOPSCAN","ENABLED",.F.)}
ITEM " B. Job Costing for ONE Job" ACTION {||MNTJCS(),DBCLOSEALL()}
ITEM " X. Exit" ACTION DOMETHOD("WACT","Release")
END POPUP

POPUP "Accounts &Receivable"
ITEM " 1. Add/Edit A/R Transactions" ACTION DONOTHING() DISABLED
ITEM " 2. Fix Cust No. in A/R File " ACTION DONOTHING() DISABLED
ITEM " 3. Edit Customer Information" ACTION DONOTHING() DISABLED
ITEM " 4. Edit Customer Financials " ACTION DONOTHING() DISABLED
ITEM " 5. " ACTION DONOTHING() DISABLED
ITEM " 6. Receipts Input Processing" ACTION DONOTHING() DISABLED
ITEM " 7. " ACTION DONOTHING() DISABLED
ITEM " 8. Print Reports / Invoices " ACTION DONOTHING() DISABLED
ITEM " 9. " ACTION DONOTHING() DISABLED
ITEM " A. Change Txn Number Format " ACTION DONOTHING() DISABLED
ITEM " B. Import Spreadsheet Data " ACTION DONOTHING() DISABLED
END POPUP

POPUP "&Utilities"
ITEM " 1. View/Edit G/L Master " ACTION DONOTHING() DISABLED
ITEM " 2. View Admin Passwords " ACTION DONOTHING() DISABLED
ITEM " 3. Load C/R Register File" ACTION DONOTHING() DISABLED
ITEM " 4. Load G/L Accounts File" ACTION DONOTHING() DISABLED
ITEM " 5. Load Time-Sheet Files " ACTION DONOTHING() DISABLED
ITEM " 6. Load Employee File " ACTION DONOTHING() DISABLED
ITEM " 7. Re-Build Vendor Codes " ACTION DONOTHING() DISABLED
ITEM " 8. Set-Up P.O. Remarks " ACTION DONOTHING() DISABLED
ITEM " 9. Set-Up Div/EWO DBFs " ACTION DONOTHING() DISABLED
ITEM " A. Set-Up Work-Area DBFs " ACTION DONOTHING() DISABLED
END POPUP

POPUP "&Employees"
ITEM " 1. Browse Employee File " ACTION DONOTHING() DISABLED
ITEM " 2. Browse Job Desc File " ACTION DONOTHING() DISABLED
ITEM " 3. Browse Rates/Deductions " ACTION DONOTHING() DISABLED
ITEM " 4. Time-Sheet Entry System " ACTION {||MNTTBS(),DBCLOSEALL()}
ITEM " 5. Print Time and Expenses " ACTION {||TBSREPS(),DBCLOSEALL()}
ITEM " 6. Print Payroll Cheques " ACTION DONOTHING() DISABLED
ITEM " 7. Period-End Payroll " ACTION DONOTHING() DISABLED
ITEM " 8. Load Employees (AccPac) " ACTION DONOTHING() DISABLED
ITEM " 9. View TBS Time-Sheets " ACTION DONOTHING() DISABLED
ITEM " A. Browse Unions File " ACTION DONOTHING() DISABLED
END POPUP

POPUP "&Manager"
ITEM " 1. Rebuild Index Files" ACTION RBLDIDX(lSETUPDBF:=.T.)
ITEM " 2. Edit Company Information" ACTION {|| MNTSYS(),DBCLOSEALL()}
ITEM " 3. Run old DOS ACT System" ACTION DOOLDACT("WACT")
ITEM " 4. View / Edit Job Status" ACTION {|| MNTJOB("WACT"),DBCLOSEALL()}
ITEM " 5. View / Edit Job Rates" ACTION {|| MNTJRT(),DBCLOSEALL()}
ITEM " 6. Print Job(s) Status" ACTION DONOTHING() DISABLED
ITEM " 7. Test Send of Email" ACTION SENDMAIL()
ITEM " X. Exit" ACTION DOMETHOD("WACT","Release")
END POPUP

END MENU

@ (nMBOT-nMTOP)/2 - 40, 150 LABEL LABNDX AUTOSIZE ;
VALUE "Indexing File : " ;
INVISIBLE

cFIL2NDX := SPACE(20)

@ (nMBOT-nMTOP)/2 - 40, 300 TEXTBOX NDXFIL VALUE cFIL2NDX ;
WIDTH 300 ;
INVISIBLE

@ (nMBOT-nMTOP)/2,150 PROGRESSBAR INDEXPROG ;
RANGE 0,10000 ;
WIDTH 600 ;
HEIGHT 30 ;
SMOOTH ;
INVISIBLE ;
TOOLTIP "Indexing Progress"


@ nMBOT-86,000 LABEL STATPMPT OF WACT AUTOSIZE ;
VALUE "Status Line->" ;
FONT "Arial" SIZE 10

@ nMBOT-86,100 LABEL STATLINE OF WACT ;
VALUE cWINSTATUS ;
WIDTH 500 HEIGHT 30 ;
FONT "Arial" SIZE 10 ;
BOLD

@ nMCTRROW-(nBUTTH),nMCTRCOL-(nBUTTH) BUTTONEX oSTOPSCAN OF WACT;
CAPTION "Stop Scan"+CRLF+"of Job Cost"+CRLF+"Databases" ;
WIDTH nBUTTW+30 ;
HEIGHT nBUTTH+40 ;
FONTCOLOR RED ;
BACKCOLOR YELLOW ;
NOTABSTOP ;
BOLD ;
INVISIBLE ;
ACTION {||lESCPRESSED := .T.}

WACT.oSTOPSCAN.ENABLED := .F.
WACT.oSTOPSCAN.VISIBLE := .F.

ON KEY ESCAPE OF WACT ACTION {||nESCKEY:=K_ESC,THISWINDOW.RELEASE}

END WINDOW

Mel Smith

Monday, March 16, 2009

What is Xailer ?

CCH: I first heard of Xailer when I returned to comp.lang.clipper after a 12-year hiatus. I did download it and found it to be interesting and familiar given my Delphi background. I posted a basic question on comp.lang.clipper which was not answered. Since I could not even get started, I moved on.

However, the latest Poll on this blog clearly shows that perhaps Xailer (though a commercial product) may be a force to be reckoned with...

From http://xailer.com

Xailer is a complete 32 bits visual development environment for Xbase users, following the guide lines of other already existing programming environments (Delphi, Visual Basic,...). As any other complete visual environment includes:

* Form designer
* Professional Source code editor
* Property inspector
* Project manager
* Report generator
* Resource manager
* Integrated Debugger

And all these features are built over a unique interface, which is tremendously intuitive and permits the development of any project in record time.

However, Xailer still permits the use of the traditional programming approach that the Xbase programmers have been used to, which consist of the use of a personal programming editor, a 'Make' tool for the compiling and linking process, and of course, the possibility of designing the forms directly from source code with friendly commands like @ row, column. Besides, both systems (IDE and traditional) can be mixed without problem on the same project, so the flexibility is absolute.

We even have a tool, XEdit, a professional code editor and project manager completely written in Xailer. It includes neither the form designer nor the Resource Manager available in the IDE but will let you to program with Xailer in the classical way if you prefer.

However we believe that even in the short term the user will surely go for the visual environment due to the following reasons:

* Easiness and speed on form creation
* Complete access to the whole project
* It does not require the use of any external 'Make' tool
* It does not require the use of any external Resource manager tool
* Visual form designer
* Perfect conjunction of components and their properties in an unique module. That is, it completely removes the need of an external tool like 'Resource Workshop' and then establishes the property values of every component on the source code. The assignment of every component property will be done directly from the IDE, and there will be no reference to those assigned properties on the source code created by the user.

Xailer has been created not only to be a migration tool for other Xbase products, but also to be suitable for any user that knows the Xbase programming language or any of its flavors. We believe that is possible to catch the attention of all those Xbase programmers that are already using CA-Clipper, and those that jumped to another environment due it's limitations, such as the absence of an integrated development environment.

Xailer includes everything you need to get started and to create complete management applications, with no need to buy any other tool from a third party. The great advantage of Xailer over all the other development environments is its simplicity for being basically a development tool for management software based on the Xbase standard, although other database systems are also supported, like SQL.


Technical features

Xailer consist of two well defined modules: the GUI library which provides the functions and classes that form the Xailer real engine and the IDE environment (made with Xailer's GUI library) which permits the use of a unique visual interface for the creation of any development project.

Xailer uses the free xHarbour Open Source Compiler for the compilation process and the also free Borland C++ 5.5 compiler. It's planned that in the future we also support other compilers like Harbour and Microsoft MSVC compiler.

Xailer is compatible with all the operating systems of Microsoft starting from Windows 98 and is perfectly adapted to gain the maximum advantage of the new visual themes of Windows XP.

All the compiling and linking complexity is completely hidden to the user, but without losing the flexibility to include personal or third party libraries.

The class library has a tremendously simple and well structured hierarchy which can be adapted to your own needs, with no need to modify the library itself, just using the inheritance mechanism of any OOP system.

The integrated debugger will help you find errors easily, allowing step by step execution, entering or jumping over functions, establishing of break points, inspection of variables and objects, etc etc...

Xailer supports any ActiveX component, OCX controls included, and other third party component as well as components specifically made for Xailer. Xailer creates self-contained executables with no need for external DLL's, including the ActiveX components, OCX and/or DLL which the developer wants to use.

The robustness, reliability and speed are the three pillars on which Xailer flourishes, exceeding the rest of competitors on any of these aspects.

Migration

Xailer hasn't been designed to be a compatible tool with other actual tools, but to become the normal evolution of any Xbase programmer, greatly helping the migration from any tool to Xailer. For that purpose it includes the following features:

* Use of classical commands
* Possibility to use the same linear programming style of Clipper and other GUI libraries
* Conversion tool to convert standard resource dialogs to Xailer native format

The migration of any old project should not be very tedious, but there is no magic tool that automatically achieves that work. The biggest differences from a functional point of view are:

* Absence of conventional dialogs. Those are treated like simple forms with the 'bsDialog' property, that acquire a identical aspect and functionality.
* Absence of the REDEFINE command
* Control creation is done on two stages: New() and Create(), which permits to modify any component property after the object instantiation, but before the control creation.
* Global objects 'Application', 'Screen' and 'Printer'
* Ability to create new events on any control


Language

Xailer is completely designed and developed by Spanish spoken programmers, that is, it is a Spanish product, but it has been written following english conventions and the documentation is done in Spanish and English. The IDE and the GUI library supports up to 8 languages:

* English
* Spanish
* French
* Italian
* German
* Portugues
* Catalan
* Gallego


Who

Xailer is a commercial project lead by José F. Giménez and Ignacio Ortiz de Zúñiga, with the considerable collaboration of José Lalín and Pedro Gil.

Credits also with the backing and collaboration of well known Xbase world programmers.


GTWVG : Update by Pritpal Bedi

Hi Everybody

Here is the ChangeLog entry I committed today, may it interest you anyway;

2009-03-15 16;42 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* harbour/contrib/gtwvg/hbgtwvg.ch
+ #define HB_GTI_SETPOSANDSIZE
+ #define HB_GTI_HB_GTI_REFRESH
+ Two more events to manage new CUI-GUI objects.

+ #define GOBJ_OBJSTATE_*
+ #define GOBJ_OBJDATA_*
+ #define GOBJ_IMAGESOURCE_*
+ Constants to manage CUI=GUI objects.

* harbour/contrib/gtwvg/gtwvg.h
* harbour/contrib/gtwvg/wvggui.h
! Updated to be compilable for WinCE builds.

* harbour/contrib/gtwvg/gtwvg.c
! Updated to honor WinCE builds.
! Implemented double-buffering of console. Now flickering
should be the topic of the past.

* harbour/contrib/gtwvg/wvggui.c
! Updated to honor WinCE builds.

* harbour/contrib/gtwvg/wvgcuig.c
+ Implemented a highly optimized GUI controls for CUI consoles.
Implementation includes auto-destruction, data-substitution,
enable/disable feast, etc. These controls are almost identical
which are available with Wvt_Draw*() namespace but with a
great difference that these are tied to the urrent GT and
are handelled transparently by the GT itself. Developer
has only to define it. The only requirement is that
SaveScreen()/RestScreen() needs to be changed to new
Modal GT window. Appln screens will never get blurred. It
also employs optimized double-buffering and hence almost
eliminates screen flickering.

* harbour/contrib/gtwvg/wvgcore.c
* harbour/contrib/gtwvg/wvgsink.c
* harbour/contrib/gtwvg/wvgutils.c
* harbour/contrib/gtwvg/wvgwin.c
! Updated to honor WinCE builds.

* harbour/contrib/gtwvg/wvgcrt.prg
! A couple of methods fine-tuned.
! Modal GT’s more responsive to user needs.

* harbour/contrib/gtwvg/tests/demowvg.prg
! Demonstrated the latest implemention of CUI-GUI controls. See below.
Please try option in the main menu.
Also note the usage of Modal GT to simulate Alert() in new window.
Every GUI object returns a handle to it which may be used to
change its parameters.

; TOFIX( WINCE BUILDS ) - GetSystemDirectory()


/* IMPLEMENTATION OF CUI-GUI CONTROLS - A CODE PREVIEW



#xTranslate Alert( => MyAlert(

PROCEDURE GCUIConsole( oCrt )
LOCAL dDate ;= date()
LOCAL cName ;= pad( ’Some Usefule Name’ , 35 )
LOCAL cAdd1 ;= pad( ’Linda Goldman Avenue’, 35 )
LOCAL cAdd2 ;= pad( ’Excellent Street’ , 35 )
LOCAL cAdd3 ;= pad( ’Suit #415’ , 35 )
LOCAL nSlry ;= 9000
LOCAL nColGet ;= 8
LOCAL GetList ;= {}
LOCAL cLabel ;= "VOUCH, that GROWS with you"
LOCAL oTab, oStat, hBoxR, hTxt

SET SCOREBOARD OFF

SetColor( "N/W,N/GR*,,,N/W*" )
CLS
hb_gtInfo( HB_GTI_WINTITLE, "WVG Simplified yet Powerful CUI-GUI Console!" )

@ MaxRow(), 0 SAY PadC( "Navigate the Gets", maxcol()+1 ) COLOR "W+/B"

@ 2, nColGet SAY "<>"
@ 5, nColGet SAY "<" + PadC( "Name" , 33 ) + ">"
@ 8, nColGet SAY "<" + PadC( "Address", 33 ) + ">"
@ 15, nColGet SAY "<>"

@ 3, nColGet GET dDate ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 1 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,0 ) ), .t. }
@ 6, nColGet GET cName ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 2 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,0 ) ), ;
Wvg_SetGObjState( hBoxR, 3 ), .t. }
@ 9, nColGet GET cAdd1 ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 3 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,255 ) ), .t. }
@ 11, nColGet GET cAdd2 ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 4 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,255 ) ), ;
Wvg_SetGObjState( hBoxR, 1 ), .t. }
@ 13, nColGet GET cAdd3 ;
WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 198,21,140 ) ), .t. }
@ 16, nColGet GET nSlry PICTURE "@Z 9999999.99" ;
WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 0,0,0 ) ), .t. }

// The only additional calls to render your console GUI
//
// The GETLIST ; This can be embedded via @ GET preprocessor command
aEval( GetList, {|oGet| Wvg_BoxGet( oGet;Row, oGet;Col, Len( Transform( oGet;VarGet(), oGet;Picture ) ) ) } )
//
hBoxR ;= Wvg_BoxRaised( 1,2,18,49, {-5,-5,5,5} )
//
Wvg_BoxRecessed( 1,2,18,49 )
//
// Wvg_BoxGroup( 2,4,17,47 )
//
Wvg_BoxGroupRaised( 2,4,17,47, {-7,-7,7,7} )
//
hTxt ;= Wvg_TextBox( 3,57,16,75, {10,10,-10,-10}, ’This is first TextBox Line!’, 2, 2 )
//
Wvg_Image( 15,36,16,42, {-3,-3,3,3}, GOBJ_IMAGESOURCE_FILE, ’Vouch1.bmp’ )
//
Wvg_BoxRaised( 15,36,16,42,{-2,-2,2,2} )
//
Wvg_ShadedRect( 1,54,18,79, { -5,-5,5,5 }, 0, {65000,21000,7000,56000}, {255,32255,16000,32500} )
//
Wvg_BoxRaised( 1,54,18,79, {-5,-5,5,5} )

// Instruct GT to Repaint the Screen with GUI elements.
oCrt;refresh()

// Issue the read
READ

Alert( ’How did you like the "Alert" replacement?’, { ’WOW’,’OK’,’OOps’} )

RETURN
/*----------------------------------------------------------------------*/
#xUntranslate alert( =>

FUNCTION MyAlert( cMsg, aOpt )
LOCAL nSel, oCrt

oCrt ;= WvgCrt();New( , , { -1,-1 }, { 9, MaxCol()-6 }, , .t. )
oCrt;lModal ;= .t.
oCrt;icon ;= "dia_excl.ico"
oCrt;create()
oCrt;resizable ;= .t.

SetColor( ’N/W’ )
CLS
hb_gtInfo( HB_GTI_WINTITLE, cMsg )

nSel ;= Alert( cMsg, aOpt )

oCrt;destroy()

RETURN nSel

#xTranslate Alert( => MyAlert(
/*----------------------------------------------------------------------*/
STATIC FUNCTION FetchText( nMode )
LOCAL cText

DO CASE
CASE nMode == 1
cText ;= ’Do you know Harbour is gaining a popularity what Clipper enjoyed at one time! ’
cText += ’Enjoy it.’
CASE nMode == 2
cText ;= ’Do you know Harbour can host pure console, cui+gui console, pure gui consoles applications? ’
cText += ’This demonstration is a proof of that.’
CASE nMode == 3
cText ;= ’Do you know Harbour is a multi-gt, multi-window, multi-thread compiler far superior than others in the market! ’
cText += ’And is FREE.’
CASE nMode == 4
cText ;= ’Enjoy and contribute to the project any way you can. Develop, Debug, Support, and spread a word of mouth!’
ENDCASE

RETURN cText
/*----------------------------------------------------------------------*/
*/

;TODO - Write a comprehensive help to exploit CUI-GUI functionality.
Will do in a few days.


Here is the output;

Friday, March 13, 2009

More on Extended Edit...

Do you recall my earlier article on How to create a Comprehensive Editable Data Window in one Line ?

Well, there is much more to tell :-)


1. Double Click on any row or Click Modify Button



2. Click New Button


3. Click Find Button


4. Click Delete Button

Nb. You can also RESTORE deleted records by clicking the RESTORE button

5. Click Filter Button


6. Click Print Button



Do you know that you can add your own options ? Check it out yourselves..
No bad for one line of code, eh ?

FYI, the full command is :-

EDIT EXTENDED
[ WORKAREA ]
[ TITLE ]
[ FIELDNAMES ]
[ FIELDMESSAGES ]
[ FIELDENABLED ]
[ TABLEVIEW ]
[ OPTIONS ]
[ ON SAVE ]
[ ON FIND ]
[ ON PRINT ]

Update on 15th March 2009

BTW, you should note that FIELDNAMES/FIELDENABLED/TABLEVIEW will only work if an array of ALL fields are specified. Also, I could not get FIELDMESSAGES to work.

Mapping Clipper Command to HMG Commands

To assist CA-Clipper users to understand the Harbour MiniGUI (HMG) equivalent, I have listed the following examples :-

1. @... SAY

Clipper :

@row, col SAY [PICTURE ] [COLOR ]

Example :
@ 15, 20 SAY "Phone" PICTURE "@R (999)999-9999" COLOR "BG+/B+, BG+/N"

HMG :
@ , LABEL
[ ID ]
[ OF | PARENT | DIALOG ]
VALUE
[ ACTION | ONCLICK | ON CLICK | ]
[ WIDTH ]
[ HEIGHT ]
[ AUTOSIZE ]
[ FONT SIZE ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP ]
[ BACKCOLOR ]
[ FONTCOLOR ]
[ BORDER ]
[ CLIENTEDGE ]
[ HSCROLL ]
[ VSCROLL ]
[ TRANSPARENT ]
[ RIGHTALIGN | CENTERALIGN ]
[ HELPID ]
[ INVISIBLE ]

Example
@ 15 ,20 LABEL Lbl_1;
VALUE "Phone" ;
WIDTH 350 HEIGHT 35 ;
FONT "Arial" SIZE 18 BOLD ;
FONTCOLOR BLUE ;
CENTERALIGN

CCH: Basically, SAY in Clipper becomes LABEL control. While COLOR string becomes BACKCOLOR & FONTCOLOR

2. @... GET
Clipper :

    @ , 
[SAY 
[PICTURE ]
[COLOR ]]
GET 
[PICTURE ]
[COLOR ]
[CAPTION]
[MESSAGE ]
[WHEN ]
[RANGE* , ] |
[VALID ]

HMG :
@ , GETBOX
[ ID ]
[ OF | PARENT | DIALOG ]
[ HEIGHT ]
[ WIDTH ]
[ FIELD ]
[ VALUE ]
[ PICTURE ] //** format function and template string
[ VALID | RANGE ,] // VALID - postvalidation function or codeblock which must return logical value
// RANGE - allowed range of values
[ VALIDMESSAGE ]
[ MESSAGE ] // text to display on STATUSBAR Item(1) when getbox have focus
[ WHEN ] // prevalidation function or codeblock (if return .f. GetBox is readonly
[ READONLY ]
[ FONT SIZE ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ PASSWORD ]
[ TOOLTIP ]
[ BACKCOLOR ] // * or
[ FONTCOLOR ] // * or
[ ON CHANGE ] ;
[ ON GOTFOCUS | ]
[ ON LOSTFOCUS | ]
[ RIGHTALIGN ]
[ INVISIBLE ]
[ NOTABSTOP ]
[ HELPID ]

Example :
@ 160,460 GETBOX GBox_1 ;
HEIGHT 24 WIDTH 120;
VALUE " " ;
FONT "Arial" SIZE 9 ;
ON CHANGE FindChg();
PICTURE '@XXXXXXXXXXXXXXXXXXXXXXX'

CCH: Basically, GET in Clipper becomes GETBOX control.

More GETBOX Examples

. @ 40,10 GETBOX Text_2 ;
HEIGHT 20;
VALUE 57639 ;
ACTION MsgInfo( "Button Action");
TOOLTIP "Numeric input. RANGE -100,200000 PICTURE @Z 99,999.99";
PICTURE '@Z 99,999.99';
RANGE -100,200000;
BOLD;
MESSAGE "Numeric input";
VALIDMESSAGE "Value between -100 and 200000 " ;
BACKCOLOR {{255,255,255},{255,255,200},{200,255,255}} ;
FONTCOLOR {{0,0,0},{255,255,200},{0,0,255}}

@ 78,10 GETBOX Text_3 ;
VALUE "Jacek";
ACTION MsgInfo( "Button Action");
ACTION2 MsgInfo( "Button2 Action");
IMAGE {"folder.bmp","info.bmp"};
BUTTONWIDTH 20 ;
PICTURE "@K !xxxxxxxxxxxxxx";
TOOLTIP "Character Input. VALID {|| ( len(alltrim(This.Value)) >= 2)} PICTURE @K !xxxxxxxxxxxxxx " ;
VALID {|| ( len(alltrim(This.Value)) >= 2)};
VALIDMESSAGE "Minimum 2 characters" ;
MESSAGE "Character Input";
BACKCOLOR {{255,255,255},{255,255,200},{200,255,255}} ;
FONTCOLOR {{0,0,0},{255,255,200},{0,0,255}}

@ 120,10 GETBOX Text_4 WIDTH 30 HEIGHT 20;
VALUE .t.;
TOOLTIP "Logical Input VALID {|| (This.Value == .t.)}";
PICTURE "Y";
VALID {|| (This.Value == .t.)};
VALIDMESSAGE "Only True is allowed here !!!";
MESSAGE "Logical Input";
BACKCOLOR {{255,255,255},{255,255,200},{200,255,255}} ;
FONTCOLOR {{0,0,0},{255,255,200},{0,0,255}}

@ 160,10 GETBOX Text_2a HEIGHT 20;
VALUE 234123.10 ;
TOOLTIP "Numeric input PICTURE @ECX) $**,***.**" ;
PICTURE '@ECX) $**,***.**' ;
BACKCOLOR {{255,255,255},{255,255,200},{200,255,255}} ;
FONTCOLOR {{0,0,0},{255,255,200},{0,0,255}}

@ 200,10 GETBOX Text_2b HEIGHT 20;
VALUE "Kowalski";
PICTURE "@K !!!!!!!!!!";
ON CHANGE {|| TONE(300)};
BACKCOLOR {{255,255,255},{255,255,200},{200,255,255}} ;
FONTCOLOR {{0,0,0},{255,255,200},{0,0,255}}

DEFINE GETBOX Text_2c // Alternate Syntax
ROW 240
COL 10
HEIGHT 20
VALUE "MyPass"
PICTURE "@K !!!!!!!!!"
BACKCOLOR {{255,255,255},{255,255,200},{200,255,255}}
FONTCOLOR {{0,0,0},{255,255,200},{0,0,255}}
VALID {|| ( len(alltrim(This.Value)) >= 4)}
TOOLTIP "Character input PASSWORD clause is set"
VALIDMESSAGE "Password must contains minimum 4 characters"
MESSAGE "Enter password (min 4 char.) "
PASSWORD .T.

Comments by Mel Smith from comp.lang.clipper/comp.lang.xharbour

David:

Here is a snippet of HMG Code that shows a prompt (P.O. Number:), then a
'GET' that inputs a P.O. number from the user, then verifies it and does a few more things.

These next two statements are 'inside' a Window Definition structure:

DEFINE WINDOW MNTPCH;
etc,
etc,

// This next is a 'SAY' emulation showing how wide/high the prompt
box should be,
// and where the label should be positioned (in 'pixels'), and that
// it should be right-aligned in its 'box'. Note that the 'LABEL'
has a name itself.
// Here, it is named LABPONUM, so that I can reference and change
the characteristics
// of the label itself at a later stsge -- if I wish to.

@ 010,010 LABEL LABPONUM OF MNTPCH WIDTH 090 HEIGHT 20 ;
VALUE "P.O. Number :" RIGHT

// This next is the 'GET' emulation showing the 'picture' clause,
the initial value to be displayed,
// the colors for foreground and background, and what to do when
gaining focus, and
// what to do when focus is lost, and then a Validation function to
perform on losing focus.

@ 010,120 GETBOX oPONUM OF MNTPCH WIDTH 060 HEIGHT 20 ;
PICTURE "@K! #####" ;
VALUE cPONUM ;
FONTCOLOR GFCOLORS ;
BACKCOLOR GBCOLORS ;
ON GOTFOCUS {|| IF(lGOTNEWPO,SETFOCUSTO("MNTPCH","oVENDCODE"), ;
SETPROPERTY("MNTPCH","LABF6SELPO","VISIBLE",.T.))}
;
ON LOSTFOCUS {||SETPROPERTY("MNTPCH","LABF6SELPO","VISIBLE",.F.)} ;
VALID {||GABORT := .NOT. CHKPONUM("MNTPCH","oPONUM",ALIAS(), ;
THIS.VALUE,@cPONUM),.T.} ;
TOOLTIP "Enter a different P.O. No., or use Movement Keys"

etc,
etc
// and many other fields, browses, etc, in here too
// It gets easier after you bang your head against the wall for five
months :))

END WINDOW

-Mel Smith, 14th March 2009

Tuesday, March 10, 2009

MDI Programming with MiniGui [Updated 12th March 2009]

Having pushed the very stable HMG to it's limits and as documented in my previous articles, I was encouraged by Sudip and decided to take a serious look at HMG Extended ie MiniGui as most of the apps that I have in mind must be MDI in nature..

This is what I started With


What did I do Next ?

I took the codes from FAS4HMG and copied the Project folder under the MiniGui folder. I was then able to recompile it as a MIDI apps with some minor adjustments.

Code Snippet
DEFINE WINDOW MainForm ;
AT 0,0 ;
WIDTH 600 ;
HEIGHT 480 ;
TITLE 'FAS4MiniGUI' ;
MAIN ;
MDI
DEFINE MAIN MENUEX

Opening First Child Window, containing a BROWSE


Opening two Child Windows & CASCADE


Tiling Vertically

Code Snippet
TILE MDICHILDS VERTICAL

Tiling Horizontally

Code Snippet
TILE MDICHILDS HORIZONTAL

More to come ...

Sunday, March 8, 2009

Adding GUI to xHarbour/Harbour via HMG [Part II]

In my previous article on Adding GUI to xHarbour/Harbour via HMG [Part I], I have shown you that you can easily hand code, Windows Menu, ToolBar and StatusBar and the result is as below :-


Code Snippet
ToolBar
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 25,25 FLAT BORDER
BUTTON Button_Exit ;
PICTURE 'exit.bmp' ;
TOOLTIP 'Exit this Application' ;
AUTOSIZE;
ACTION MsgInfo('Exit !');
SEPARATOR

BUTTON Button_ReindexAll ;
PICTURE 'task.bmp' ;
TOOLTIP 'Reindex All Files' ;
AUTOSIZE;
ACTION Reindex_All()

BUTTON Button_Calculator ;
PICTURE 'calculator.bmp' ;
TOOLTIP 'Windows Calculator' ;
AUTOSIZE;
ACTION ExecFile("C:\Windows\System32\calc.exe") ;
SEPARATOR
END TOOLBAR

Status Bar
DEFINE STATUSBAR
STATUSITEM "FAS4HMG" WIDTH 100
KEYBOARD
DATE
CLOCK
END STATUSBAR



Code Snippet
Menus
POPUP '&File'
POPUP '&Define Help Windows' name FileDefine
ITEM 'Define Fiscal Periods' ACTION EditExt('HLPFP')
ITEM 'Define Forex Table' ACTION EditHlpForex()
END POPUP
ITEM 'Exit' ACTION FileExit() IMAGE 'Exit.Bmp'

END POPUP

POPUP 'General Ledger'
ITEM '&Chart of Accounts' ACTION (BrowseGlac())
ITEM 'Report Writer' ACTION EditExt('REPTGL')
POPUP 'Standard Reports' name GLRept
ITEM 'Chart of Accounts' ACTION PrintViewChartofAccounts()
END POPUP
SEPARATOR

ITEM 'Reindex' ACTION Reind_GL()
ITEM 'Edit Fields Description' ACTION EditExt('GLDICT')
SEPARATOR
ITEM 'Rebuild GL' ACTION RebuildGL()
END POPUP


How about calling an external EXE ?

Code Snippet

EXECUTE FILE "C:\Windows\System32\calc.exe"

Using HMG's MsgYesNo() to replace Clipper Alert()

Code Snippet
if MsgYesNo('Reindex All Files ?','Confirm',{'Yes','No'})
ReindexAll()
endif

What about Reindexing with Progress Bar ?


What have I done to 'GUIFY ' FAS4XHB to FAS4HMG thus far ?

a) Completed Main Form Interface via MENU, TOOLBAR & STATUSBAR
Nb. With this, I got rid of the Clipper Menu Interface

b) Use EDIT/EDIT EXTENDED to replace my DBEDIT()-based data screens
Nb. With this, I got rid of the DBEDIT() Interface

c) Use PROGRESSBAR to allow reindexing with Progress Bar
Nb. Replaced my text-based Progress Bar

d) Use EXECUTE FILE 'KE.EXE' PARAMETERS
Nb. This means that I do not need to recode all my reports !

What resources have I used thus far ?

a) xHarbour compatible codes, see Migrating from 5.2e to xHarbour Part III

b) HMG distribution comprising Harbour+HMG, see What is HMG ?

d) HMGIDE, a 2-way IDE (only if you created forms from the IDE)

e) Speedy response by HMG Forum particularly Escigi, Rathinagiri, Grigory Filatov and not forgetting my newly-found friend Sudip
Bhattacharyya from Calcutta, West bengal , India :-)

Where do I go from Here ?

a) Master-Details Forms

b) Prettying up the Interface

Saturday, March 7, 2009

HMG: How to implement a comprehensive Editable Data Window with 1 line of code...

As most of us now, to maintain a Table of data, we probably must have a Data Window where one can :-

a) Browse data
b) Filter Data
c) Add a new record
d) Modify an existing record
e) Delete an unwanted record
f) Find records
g) Print a report based on the table

Obviously, it will take a lot of coding to achieve all of the above.

Take a look at the following screen. Pretty comprehensive looking and must have involved a lot of coding, right ? Would you believe that it can be done with 1 line of code ?



Would it shock you to know that the above was done with 1 line of code namely

EDIT EXTENDED ARDATA
where ARDATA = workarea

How about this ?



EDIT HLPFOREX
where HLPFOREX = workarea

Hmm... I don't think it can get easier :-)

See More on Extended Edit...

Friday, March 6, 2009

HMG : How to Create Browses, the easy way ? (Updated 9th March 2009)

In FAS4DOS/FAS4XHB and FAS4HMG, I was using DBEDIT() as the primary data entry mechanism for user input.


On studying the numerous samples in HMG, I decided to replace all the text DBEDIT() with HMG's BROWSE. The following was achieved by using BROWSE functionality in place of DBEDIT() within FAS4HMG



How did I achieve this ?

Code Snippet

DEFINE WINDOW BrowseGLACForm ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'Browse Chart of Accounts' ;
CHILD ;
NOMAXIMIZE;
ON INIT OpenTables() ;
ON RELEASE CloseTables()


DEFINE STATUSBAR
DATE
STATUSITEM ' / Double Click To Edit' WIDTH 190
STATUSITEM 'Alt+A: Append Record' WIDTH 140
STATUSITEM ': Delete Record' WIDTH 140
CLOCK
END STATUSBAR

@ 10,10 BROWSE Browse_1 ;
WIDTH 580 ;
HEIGHT 400 ;
HEADERS { 'GL Code' , 'GL Name' , 'GL Type', 'GL Group'} ;
WIDTHS { 80 , 320 , 80 , 80 , 120 } ;
WORKAREA GLAC ;
FIELDS { 'GLAC->GLCODE' , 'GLAC->GLNAME' , 'GLAC->GLTYPE' , 'GLAC->GLGROUP'} ;
VALUE 1 ;
EDIT ;
APPEND;
DELETE;
LOCK

END WINDOW

CENTER WINDOW BrowseGLACForm

BrowseGLACForm.Browse_1.SetFocus

ACTIVATE WINDOW BrowseGLACForm

Return Nil

Thursday, March 5, 2009

HMG : How to compile Several PRGs at the same Time ?

CCH: After going through the numerous samples, I noticed that the default compile.bat only compiles a single PRG but my typical applications consists of more than a hundred PRGs. So what to do ?

Response by Rathinagiri of HMG Forum

It is easy to compile several prgs.

Write down all the prg filenames each in a separate line, keeping the prg file having main() function as the first line.

Save the file giving an extension of .hpj and open the same using HMG-IDE. You need not worry about any designing of forms there. Just press ctrl+F5 (Project->Build) or F5 (Project -> Run) or click the play button there to build and run.

So, HMG-IDE is a two way utility to build a HMG project and as well as an IDE.

Comments by escigi of HMG Forum

Hi CCH

As Rathinagiri said, it is easy to compile several prgs with HMG-IDE.

As cited in HMG-IDE page of Viva Clipper], HMG-IDE is both a Project Manager and a Form Designer.

The project management tools allow you all project based works with interactive manner. This includes building and running projects without complex batch processing and environment configuration tasks.

Build or open a project and add or exclude project elements ( forms (.fmg), modules (.prg ) whatever you want. This way have a big advantage: since HMG-IDE is at the same time a highly sophisticated "make" utility, only changed files will be compiled.

Alternatively you can use SET PROCEDURE TO command and also #include statement of Clipper. But, notice that in this case "make" concept will be broken.

In other hand, "The samples compile.bat deals with only a single prg" isn't correct. If you read it you will be seen "%1 %2" expressions. They are command parameters and each for a separate file.

BTW, in only one night you solved almost all about HMG, congratulations! :D

Regards

esgici

Wednesday, March 4, 2009

Harbour Ready-to-use : Pritpal Bedi

WELCOME

http://www.vouch.info/downloads/HarbourDev_10523_2009-03-04.exe

This is Harbour's ready-to-use distibution planned to be released once in a month including the changes committed to SVN till the date of release. This is not the rule. I may post more than once in a month if there are major commits and/or some important feature is added/modified.

This distro is aimed at newbies who find it difficult to start with Harbour though everybody can take advantage to the maximum.

Please note that this is not an official release. So you may expect bumps here-and-there. My efforts will focus on the facts that release maintain a standard to let the applns compile properly.

Every release will bear the "Revision No" and "Date" in its setup name as -
HarbourDev_10523_2009-03-04.exe which will facilitate to identify upto which commit this release contain.

The tree structure ( outlined below ) can be used for production level development scenario. It contains batch files to get Harbour binaries
from SVN tree for four compilers. As you can now compile your applns with different compilers, this enhances your productivity level to judge which compiler is giving you the fastest and optimum appln.

To keep the tasks simple, I am assuming drive "C" the development drive where Harbour SVN tree and "harbour_dev" tree is hosted. All paths in the
batch files and xMate project files points to c:\harbour and C:\harbour_dev.

This distribution includes only binaries. Please download SVN tree if you need sources or want to play with the latest commits. It is not necessary
for your applications.

In case you decide to have latest SVN binaries then host it on drive C as module name "harbour". Then invoke one of the makegnu_*.bat, depending
on the compiler of your choice. It will place harbour binaries in respective subfolder of "c:\harbour_dev".

This distribution includes MINGW compiler under c:\harbour_dev\mingw folder as its root. So one is able to build appln for this compiler without any extra effort. You can download other compilers and place them in respective folders in c:\harbour_dev, i.e., Borland's BCC under c:\harbour_dev\bcc ( no suffix after bcc ), Sybase's Open Watcom under c:\harbour_dev\watcom, Microsoft's Visual C++ under c:\harbour_dev\msvc. Once installed, just invole respective makegnu_*.bat. Harbour binaries will be in place.

As I has been working with xMate since its birth way back in 2004, I have choosen it to be Project Builder for this distribution. You are free to deploy whatever you are accustomed to.

As a demo appln I have selected harbour/contrib/gtwvg/tests/demowvg.prg. This demo unfolds Harbour power in depth plus different ways one can employ to migrate his/her Clipper applications to GUI world strating with
intermediatery semi GUI proto and culminating to pure GUI proto. This demo also deploys the in-development Xbase++ Parts clone whaich may attract your attention. Moreoever, this demo demonstrates MT ( multi-threading ) and multi-window GT which can be a big productivity boost right from the begining.

Following is the tree structure this disto contains.

c:\harbour_dev\

harbour\
bcc\
bin
include
lib
msvc\
bin
include
lib
mingw\
bin
include
lib
watcom\
bin
include
lib

bcc\
* distro tree
msvc\
* tree
mingw\
* tree
watcom\
* tree

xmate\
*.files | folders
/
wvgBCC.env ( tied with demowvgBCC.xhp )
wvgMSVC.env ( tied with demowvgMSVC.xhp )
wvgMINGW.env ( tied with demowvgMINGW.xhp )
wvgWATCOM.env ( tied with demowvgWATCOM.xhp )

dev_projects\
demowvg\
demowvgBCC.xhp
demowvgMSVC.xhp
demowvgMINGW.xhp
demowvgWATCOM.xhp

demoxbp\
demoxbp.xhp
* folders
developers_own_folders\
developer_project.xhp

dev_sources\
demowvg\
*.files
tests\
*.files

dev_libs\
# All together - it is a better design

dev_exes\
# All together of by project
May be it is dependant on other resource files

ChangeLog ( Harbour SVN ChangeLog : Binaries Upto : Top Few Lines )

make.exe ( mingw32-make.exe )

bcc32.cfg ( Bcc Compiler Confuration : bcc\bin )
tlink32.cfg ( BCC Linker Configuration : bcc\bin )
wlink.lnk ( Watcom Linker Configuration : watcom\binnt )

[ invoke it to get latest Harbour SVN binaries ]
/
makegnu_BCC.bat
makegnu_MSVC.bat
makegnu_MINGW.bat
makegnu_WATCOM.bat

Enjoy

Pritpal Bedi, a student of software analysis and design

http://www.vouch.in | Vouch, the software that GROWS with you
http://www.vouch32.com | Home of Vouch32 ActiveX Server
http://www.vouchcac.com/vouch32/vouch32.htm | A Free Windows Extended
Utilities Library for Clipper, Xbase++ and (x)Harbour
http://www.help.vouch.info | Online Vouch Help
http://www.harbour.vouch.info | Online Harbour Help

Adding GUI to xHarbour/Harbour via HMG [Part I]

I started with FAS4XHB, the migrated FAS4DOS mentioned in my earlier articles as follows :


After Adding MENU structure using HMG

Having downloaded the Harbour MiniGui Harbour Distribution and joining the HMG Forum, I played with the IDE. Nice.. but on the advice of Esgici, I started to code by hand this morning and this is the result of my handiwork :-



After adding a Status Bar showing Date & Time..

DEFINE STATUSBAR
CLOCK
DATE
END STATUSBAR



After adding a Tool Bar with some high quality bitmaps :-

DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 32,24 BORDER

BUTTON Button_Exit ;
CAPTION 'E&xit' ;
PICTURE 'exit.bmp' ;
ACTION Exit()
SEPARATOR

BUTTON Button_GL ;
CAPTION '&General Ledger' ;
PICTURE 'accounts.bmp' ;
ACTION ViewGL()

BUTTON Button_AR ;
CAPTION 'Accounts &Receivable' ;
PICTURE 'table.bmp' ;
ACTION ViewAR()

BUTTON Button_AP ;
CAPTION 'Accounts &Payable' ;
PICTURE 'view.bmp' ;
ACTION ViewAP()
SEPARATOR

BUTTON Button_Reindex ;
CAPTION '&Reindex All' ;
PICTURE 'task-2.bmp' ;
ACTION ReindexAll()
END TOOLBAR


Now, it looks pretty good for a Clipper for Windows (Harbour+HMG) executable !


Is Visual Objects a 32/64 bits Compiler ? [Updated 10th March 2009]

I started this thread at comp.lang.clipper.visual-objects

Response by Brian Feldman, Product Owner, Visual Objects & Vulcan.net

CCH,

>>Have Grafx announced any plan for a 64-bits version ?

None. No 64 bit version of VO will be forth coming.

Most of our development efforts are focused on Vulcan.Net, and VO
maintenance.

Vulcan.NET, which is an xBase compiler for .NET based on the "Visual Objects language".

Vulcan.NET produces a .NET exe or .dll. Supports all MS Frameworks. It uses Microsoft Visual Studio 2005 or 2008 as an IDE. An alternative IDE has also been written in Vulcan.NET called VIDE and a trial version is also available for download at the website.

Simply put Vulcan.NET _IS_ xBase for the future.

More info at and free Trial Version at http://www.GoVulcan.NET

A good place to start is to download our 150 page getting started guide:
http://www.govulcan.net/portal/GettingStarted/tabid/59/Default.aspx

Brian Feldman
GrafX Software http://www.Grafxsoft.com

Product Owner Visual Objects
Product Owner Vulcan.NET

Comments by Erik & Geof Schaller on same thread as follows :-

1. Vulcan.NET produces a .NET exe or .dll. Supports all MS Frameworks.

The support of the CF is very limited.
With some fiddling you will be able to compile and run an app for the CF,
but you won't have DBF support, no Macrocompiler and also the VO compatible
classlibs will not work on the CF. Also the Vulcan-VS support for CF lacks
interesting features for the CF.

If you consider developing for the CF, you better use one of the MS
languages.

Same suggestion for any new development. C# is not that hard at all!

Erik

2. Geoff Schaller
Chee,

As Brian has indicated, there will never be a 64 bit version of VO.
However, any VO or Vulcan app will run perfectly in a 32 or 64 bit
environment so why should it matter? There is very little you would
"need" a 64 bit application for, other than to squeeze a few
milliseconds of performance out, but unless your application needs to
deal routinely with numbers > 4GB I would suggest that 64 bit is largely
irrelevant.

And if you need to work with huge numbers routinely, why not go to C# or
VB.net?

Geoff


Welcome to Clipper... Clipper... Clipper


In 1997, then using Delphi 3, I had already created 32-bits Windows applications for HRIS, ERP and CRM. In 2007, using Ruby on Rails, an AJAX powered CRM site running on Apache & MySQL was created and I am now using Visual Studio .Net 2008 to create web-based projects and Delphi 7 for Win32 applications using SQL2005 & DBFCDX.

So, why then am I reviving the Original Clipper... Clipper... Clipper via a Blog as CA-Clipper is a programming language for the DOS world ? Believe it or not, there are still some clients using my mission-critical CA-Clipper applications for DOS installed in the late 80's and up to the mid 90's. This is testimony to CA-Clipper's robustness as a language :-)

With the widespread introduction of Windows 7 64-bits as the standard O/S for new Windows based PCs & Notebooks, CA-Clipper EXE simply will not work and it has become imperative for Clipper programmers to migrate immediately to Harbour to build 32/64 bits EXEs

Since 28th January 2009, this blog has been read by 134,389 (10/3/11 - 39,277) unique visitors (of which 45,151 (10/3/11 - 13,929) are returning visitors) from 103 countries and 1,574 cities & towns in Europe (37; 764 cities), North America (3; 373 cities) , Central America & Caribeans (6; 13 cities), South America(10; 226 cities), Africa & Middle-East (12; 44 cities) , Asia-Pacific (21; 175 cities). So, obviously Clipper is Alive & Well : -)


TIA & Enjoy ! (10th October 2012, 11:05; 13th November 2015)


Original Welcome Page for Clipper... Clipper... Clipper

This is the original Welcome Page for Clipper... Clipper... Clipper, which I am republishing for historical and sentimental reasons. The only changes that I have made was to fix all the broken links. BTW, the counter from counter.digits.com is still working :-)

Welcome to Chee Chong Hwa's Malaysian WWW web site which is dedicated to Clipperheads throughout the world.

This site started out as a teeny-weeny section of Who the heck is Chee Chong Hwa ? and has graduated into a full blown web site of more than 140 pages (actually hundreds of A4 size pages) ! This is due to its growing popularity and tremendous encouragements from visiting Clipperheads from 100 countries worldwide, from North America, Central America, Caribbean, South America, Europe, Middle-East, Africa and Asia-Pacific. Thanx Clipperheads, you all made this happen !


What is Clipper ?

You may ask, what is this Clipper stuff ? Could Clipper be something to do with sailing as it is the name of a very fast sailing American ship in the 19th century ?

Well, Clipper or to be precise, CA-Clipper is the premier PC-Software development tool for DOS. It was first developed by Nantucket Corporation initially as a compiler for dBase3+ programs. Since then, CA-Clipper has evolved away from its x-base roots with the introduction of lexical scoping & pre-defined objects like TBrowse. As at today, the most stable version ofClipper is 5.2e while the latest version, 5.3a was introduced on 21 May 1996.

As at 11th November, 1996, an unofficial 5.3a fixes file was made available by Jo French. See the About CA-Clipper 5.3a section for more details. BTW, Jo French uploaded the revised 5.3a fixes file on 20th November, 1996.

Latest News

The latest news is that CA has finally released the long-awaited 5.3b patch on 21 May, 1997.

For 5.3b users, you must a take a look at Jo French's comments on unfixed bugs in 5.3b.

BTW, have you used Click ? If you're a serious Clipperprogrammer and need an excellent code formatter, Click is a natural choice. How to get it ? Simple, access Phil Barnett's site via my Cool Clipper Sites.

32-bits Clipper for Windows ?

Have you tried Xbase ++ ? Well, I have and compared to Delphi (my current Windows programming tool of choice), I'm still sticking to Delphi.

Anyway, you should visit the Alaska Home Page. Give it a chance and then draw your own conclusions !.

The Harbour Project

Is this the future of Xbase ? Take a look at at the Harbour Project

You are Visitor # ...

According to counter.digits.com, you are visitor since 3 June 1996.

If you like or dislike what you see on this website, please drop me a line by clicking the email button at the bottom of this page or better still, by filling out the form in my guest book. If you are not sure what to write,click here to take a look at what other Clipperheads have to say.