Sunday, April 12, 2009

How to create a new window with Harbour + WVG ?

Having gained the confidence of simple guifying of FAS4WVG without breaking codes and the sheer joy of not having to rewrite tonnes of codes due to the extensive use of ALERT(), I explored on how to create a new window from within the Main Console Window.

Based on my understanding, you can create and ultimately destroy a new Window by making a function call such as :-

MyNewWindow('Reindexing','MyIcon','N/W')

#include "hbgtinfo.ch"

FUNCTION MyNewWindow(cWindowCaption,cIconFile,cColor )
LOCAL oCrt
oCrt := WvgCrt():New( , , { -4,-4 }, { maxrow()-4,maxCol()-4}, , .t. )
oCrt:lModal := .T.
oCrt:icon := cIconFile
oCrt:create()
oCrt:resizable :=.T.
SETCOLOR(cColor)
CLS
// Needs #include "hbgtinfo.ch"
hb_gtinfo(HB_GTI_WINTITLE,cWindowCaption)

/* Your Clipper Codes goes here */

oCrt:destroy()

RETURN nil

No comments:

Post a Comment