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.
WACT.INDEXPROG.SHOW,RBLDIDX(
WACT.LABNDX.HIDE,WACT.NDXFIL.
(GABORT := .NOT. SETUPDATES(GDATE), ;
IIF(GABORT,DOMETHOD("WACT","
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(), ;
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-(
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.
END WINDOW
Mel Smith
No comments:
Post a Comment