Visual Clipper - Again

1,401 views
Skip to first unread message

Ash

unread,
Jan 7, 2019, 7:21:02 PM1/7/19
to Harbour Users
Hello Everyone,

xBase language has allowed me to build powerful business applications without having to learn the object oriented aspects of programming. Let me give you an example of pure Clipper code.

#include "inkey.ch"

FUNCTION main()

   LOCAL GetList := {}
   LOCAL cName  := 'Fred Bloggs Jr.'
   LOCAL dDOB  := Date() -20000
   LOCAL cStatus := 'Single'
   LOCAL nSalary := 95000
   LOCAL lEmployed := .T.
   LOCAL lSave  := .F.
   LOCAL nBtn  := 0

   CLS

   @ 00, 01 SAY 'Employee Details'
   @ 02, 12 GET cName CAPTION 'Name:' PICTURE '@K'
   @ 03, 12 GET dDOB CAPTION 'Birth Date:' PICTURE '@D'
   @ 04, 12, 08, 19 GET cStatus LISTBOX { 'Unknown', 'Married', 'Single' } DROPDOWN CAPTION 'Status:'
   @ 05, 12 GET nSalary CAPTION 'Salary:' PICTURE '999,999'
   @ 06, 12 GET lEmployed CHECKBOX CAPTION 'Employed?'
   @ 08, 02 GET lSave PUSHBUTTON CAPTION 'OK' STATE {|| nBtn := 1, hb_keyPut( K_CTRL_W ) }
   @ 08, 12 GET lSave PUSHBUTTON CAPTION 'Cancel' STATE {|| ReadKill( .T. ) }

   READ

   DO CASE
   CASE nBtn == 1

      Alert( cName + ';' + ;
         DToC( dDOB ) + ';' + ;
 cStatus + ';' + ;
 Str( nSalary ) + ';' + ;
 iif( lEmployed, 'Y', 'N' ), )

   ENDCASE

   RETURN nil

Output.


p1.png

The above program works well but it is character based. For this program to have a GUI interface, one has to resort to complicated additional libraries like qt, hwgui, hmg and others. The resulting program will no longer look like a Clipper program any more. 

I have been experimenting with GTWVW as shown below.  I am not suggesting that we should use GTWVW. Use QT instead for example if the code above remains the same. 

p2.png


















My new year's wish.

Regards.
Ash

P.S. I can share my work so far.

Mario H. Sabado

unread,
Jan 7, 2019, 7:49:32 PM1/7/19
to harbou...@googlegroups.com, Ash
Hi Ash,

I'm interested in your work.  Would greatly appreciate if you could share.

Best regards,
Mario
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Paola Bruccoleri

unread,
Jan 7, 2019, 8:42:22 PM1/7/19
to harbou...@googlegroups.com
Hello Ash
very interesting what you have done.
Could you share how you have achieved it?

My harbor programs are console and it would be great to be able to convert them with a little effort to an interface of that type,
thank you very much


De: "Ash" <jun...@gmail.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Lunes, 7 de Enero 2019 16:21:02
Asunto: [harbour-users] Visual Clipper - Again
p1.png
p2.png
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Ash

unread,
Jan 8, 2019, 12:54:59 AM1/8/19
to Harbour Users
Hello Everyone,

Trying to attach a file (27K) but failing.

Regards.
Ash

Bruno Luciani

unread,
Jan 8, 2019, 1:04:54 AM1/8/19
to harbour-users
put in drive and share it

Bruno
--
Bruno Luciani
Area Ingenieria
Brawnius Tecnologia y Servicios 
BWS Central de Monitoreo
San Francisco Javier 1066
Ramallo - 03407-422178/422185
www.brawnius.com.ar
www.bwsalarmas.com.ar

Ash

unread,
Jan 8, 2019, 12:51:26 PM1/8/19
to Harbour Users

Diego Fazio

unread,
Jan 8, 2019, 5:10:37 PM1/8/19
to Harbour Users
I compiled ok after making some modifications...and I tested it. 
Very nice example.

Thanks.
Diego.

Mel Smith

unread,
Jan 8, 2019, 5:53:50 PM1/8/19
to Harbour Users
Hi Ash:

   I also was able (with some mods) to compile all your prgs under BCC73. However, I couldn't link because I'm UNABLE TO BUILD GTWVW.LIB ????

   Is there an hbmk2 setting to ensure that harbour\contrib\getwvw\ packge gets built ??  (I also added a new line in harbour\contrib\hbplist.txt for  gtwvw).

   But, still, GTWVW was not built ? Hmmmmm   ??

-Mel

Ash

unread,
Jan 8, 2019, 6:19:32 PM1/8/19
to Harbour Users
Hello Mel,

I normally build libgtwvw.a from sources using gtwvw.hbp. I use mingw, however.

Regards.
Ash

Mel Smith

unread,
Jan 8, 2019, 7:31:39 PM1/8/19
to Harbour Users
Hi Ash:

   What are your build steps to create GTWVW.LIBfrom source. please ?

    Some old guildance (in readme.md)  states
      
   cd \ harbour\contrib

   C:\>\contrib\hbmk2 make.hb <name>      

   (I tried this, but what replaces <name>   ???     (i.e., GTWVW or GTWVW.LIB or what ??)

Thanks for some further info.
-Mel

Ash

unread,
Jan 8, 2019, 7:47:07 PM1/8/19
to Harbour Users
Hello Mel,

Assuming gtwvw sources are in c:\hb32\contrib\gtwvw folder, I issue the following commands to build the library.

cd \hb32\contrib\gtwvw
hbmk2 gtwvw.hbp -rebuild

libgtwvw.a is created in C:\hb32\contrib\gtwvw\lib\win\mingw folder. 

Then I build wvwclip.exe using wvwclip.hbp which contains:

-inc
-es2 -w3 -gc0 -m -a -mt -n -ql
       
gtwvw.hbc
xhb.hbc

-owvwclip

wvwclip.prg
wvwprocs.prg
wvwclasses.prg
wvwmenu.prg
errorsys.prg
login.prg
empdet.prg

wvwclip.rc

I hope this is helpful.

Regards.
Ash

Diego

unread,
Jan 8, 2019, 8:15:52 PM1/8/19
to harbou...@googlegroups.com
There is some code to be added in gtwvw before create the lib. I do not remenber the func which said is missing while compiling gtwvw.hbc. Doing that works fine.

Diego
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/xpHeXoSt4nk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.

Ash

unread,
Jan 8, 2019, 8:30:56 PM1/8/19
to Harbour Users
Hello Diego,

Oops!

I had added this needed function to the end of gtwvwd.c.

 HB_FUNC( WVW_GETCTRLHANDLE )
   {
      UINT usWinNum = WVW_WHICH_WINDOW;
      BYTE   bStyle = 0;
      hb_retnl( (LONG) FindControlHandle(usWinNum,
                                         (BYTE) hb_parni(2),
                                         (UINT) hb_parni(3),
                                         &bStyle) );

      hb_storni( bStyle, 4 );

   }

Regards.
Ash

Mel Smith

unread,
Jan 8, 2019, 10:32:54 PM1/8/19
to Harbour Users
Hi Ash:
   Yes, I finally tracked down the missing function, and followed the instructions, and THEN I noticed your post here  :))

   Also had to build XHB.LIB (in the same way as GTWVW.LIB.)

   The only missing piece is that I had to remark out the wvwclip.rc  in wvwclip.hbp because of the failure at line 917 of the prtsht.h include file (which was called from some unknown place ??)
   (The error message was:  "#endif" before "#if"  at line 917.)

   In any case it compiled and 'ran' without failure but the buttons were not coloured.

   So, I'll puzzle on that for awhile, and also why is GTWVW not produced automatically as it is in xHarbour. ???


Thanks for your work !

-Mel

Ash

unread,
Jan 9, 2019, 3:02:27 AM1/9/19
to Harbour Users
Hello Mel,

Thank you.

My code is work in progress and as such it might not be up to Harbour's coding standards. It'll serve as an example as to what can be done with our very capable Harbour to simplify the GUI. However, it might be a good idea to start afresh.

Check out the documentation as well.

Regards.
Ash  


On Tuesday, January 8, 2019 at 5:32:54 PM UTC-5, Mel Smith wrote:
Hi Ash:

Ash

unread,
Jan 9, 2019, 8:00:50 PM1/9/19
to Harbour Users

Mel Smith

unread,
Jan 10, 2019, 12:10:21 AM1/10/19
to Harbour Users
Hi Ash:
   Thanks for the pdf documentation.. It helps with my understanding of your work.

-Mel

Koshal Agarwal

unread,
Jan 19, 2019, 7:13:11 AM1/19/19
to Harbour Users
pls share gtwvw.lib file if u have

Ash

unread,
Jan 19, 2019, 2:02:44 PM1/19/19
to Harbour Users
Hello Koshal,

I only have libgtwvw.a lib. It was built using MingW. It is best to build it for yourself.


Regards.
Ash  

Koshal Agarwal

unread,
Jan 21, 2019, 6:39:34 AM1/21/19
to Harbour Users
thanks a lot icould successfully executed ur example is there any complete function list in this library with syntex as you have given in ur PDF document

Ash

unread,
Jan 21, 2019, 11:19:07 AM1/21/19
to Harbour Users

Ash

unread,
Apr 2, 2019, 9:00:29 PM4/2/19
to Harbour Users
Hello Everyone,

The Radio Buttons part of WVWClip didn't work due to some bugs in GTWVW. That led me to porting of GTWVW and HBWIN from Harbour 3.4 to 3.2. Viktor not only fixed those bugs, he also enhanced the inner workings of GTWVW. Thank you, Viktor.

This is how I ported GTWVW and HBWIN from 3.4 to 3.2.

Download and install the latest version of Harbour 3.2. The one that I use is dated 2018-12-31.
Move over to contrib folder.
Rename gtwvw folder to gtwvw-32
Rename hbwin folder to hbwin-32
copy gtwvw and hbwin folders from Harbour 3.4 into the current folder
Comment out win_CreateFont() function in wvwharb.prg. It is a duplicate one 
Replace -hbx=${hb_name}.hbx with ${hb_name}.hbx in both gtwvw.hbp and hbwin.hbp files
Comment out the following lines in hbwin.hbp

-deppkgname=png:mingw-w64-i686-libpng{msys2&x86}
-deppkgname=png:mingw-w64-x86_64-libpng{msys2&x86_64}
-depkeyhead=png:png.h
-depcontrol=png:local{HB_BUILD_3RDEXT='no'}
-depcontrol=png:${HB_WITH_PNG}
-depincpath=png:/usr/include
-depincpath=png:/usr/local/include
-depincpathlocal=png:../../src/3rd/png
 
Add the following two functions at the end of win_misc_1.c file

HB_FUNC( WIN_N2P )  
/* NOTE: Unsafe: allows to pass arbitary pointers to functions, potentially causing a crash or worse. */
{
   hb_retptr( HB_ISPOINTER( 1 ) ? hb_parptr( 1 ) : ( void * ) ( HB_PTRDIFF ) hb_parnint( 1 ) );
}

HB_FUNC( WIN_P2N )  
/* NOTE: Unsafe: will reveal the numeric value of a pointer */
{
   hb_retnint( HB_ISNUM( 1 ) ? hb_parnint( 1 ) : ( HB_PTRDIFF ) hb_parptr( 1 ) );
}

Rebuild both libraries.and copy them to harbour lib\win\mingw folder

Download wvwclip.zip from here

hbmk2 wvwclip.hbp

Regards.
Ash

Maurizio la Cecilia

unread,
Apr 3, 2019, 4:25:37 PM4/3/19
to harbou...@googlegroups.com
Hi Ash,
I did a try to follow your path but I found some issue:

In wvwclip.rc at line:
103                BITMAP         "15.bmp"
the bitmap 15.bmp is referenced but missing from your distro

Trying to build wvwclip I receive:
Compiling 'wvwclip.prg'...
wvwstd.ch(4) Error F0029  Can't open #include file 'wingdi.ch'
This header file seems to be relied to hbwhat, an old code no more present in both 3.2 and 3.4 Harbour trees after this commit:
2009-07-11 09:41 UTC+0200 Viktor Szakats (vszakats.net/harbour)
  * examples/hbwhat
    - hbwhat deleted as planned. It no longer builds without
      investing more work into it (besides its other known problems).

Can you take a look to this issues?
TIA.
Best regards.
--
Maurizio
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

Ash

unread,
Apr 3, 2019, 5:07:52 PM4/3/19
to Harbour Users
Hello Maurizio,

My mistake! Please download and try this version.


Regards.
Ash

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Attila Szabó

unread,
Apr 4, 2019, 10:20:31 AM4/4/19
to Harbour Users
Hello Ash,

It works properly, but there is a little bug...
When I click on the input field after the result is printed.

visual clipper error 1.png

visual clipper error 2.png

Regards.
Attila

Ash

unread,
Apr 4, 2019, 1:46:15 PM4/4/19
to Harbour Users
Hello Attila,

This version of WVWClip only works with the ported versions of GTWVW and HBWIN from Harbour 3.4. Can you confirm that you rebuilt these libraries and copied them to harbour's lib\win\mingw folder ?

Regards.
Ash
 

On Thursday, April 4, 2019 at 6:20:31 AM UTC-4, Attila Szabó wrote:
Hello Ash,

It works properly, but there is a little bug...
When I click on the input field after the result is printed.


Regards.
Attila

Attila Szabó

unread,
Apr 4, 2019, 4:10:19 PM4/4/19
to Harbour Users
Hello Ash,

I also tried it. The result is similar.
The result is similar when running wvwclip.exe in the published wvwclip2.zip package.

vc_error.png

Regards.
Attila

Ash

unread,
Apr 4, 2019, 8:13:31 PM4/4/19
to Harbour Users
Hello Attila,

Please replace line 195 in wvwstd.ch with the following and recompile.

       win_MessageBox( NIL, StrTran(<cMsg>, ";", chr(13) ), <cHead>, 0x00002000)

Regards.
Ash

Attila Szabó

unread,
Apr 5, 2019, 6:06:01 AM4/5/19
to Harbour Users
Hello Ash,

Thank you so much!

I noticed that if I click on one of the "notes" radio buttons, the selection will disappear from the "colour" group.

Regards.
Attila

Ash

unread,
Apr 5, 2019, 9:06:06 AM4/5/19
to Harbour Users
Hello Attila,

I noticed that if I click on one of the "notes" radio buttons, the selection will disappear from the "colour" group.
Can you confirm you are using libraries built from Harbour 3.4's GTWVW and HBWIN sources?

Regards.
Ash

Attila Szabó

unread,
Apr 6, 2019, 2:08:54 PM4/6/19
to Harbour Users
Hello Ash,

Thank you so much!

I installed the latest mingw and the latest hb34 and wvwclip works fine.

Regards.
Attila

Srdjan

unread,
Apr 7, 2019, 9:34:22 AM4/7/19
to Harbour Users
Hello Ash,

Where I can get Harbour 3.4?

Srdjan 

Ash

unread,
Apr 7, 2019, 12:12:50 PM4/7/19
to Harbour Users
Hello Srdjan,

Here we go.


Regards.
Ash

Diego Fazio

unread,
Apr 15, 2019, 5:52:15 PM4/15/19
to Harbour Users
Hi, Ash. Do you use TBrowseDB for working with tables or other? Some example?

Thanks
Diego.


El lunes, 7 de enero de 2019, 16:21:02 (UTC-3), Ash escribió:
Hello Everyone,

xBase language has allowed me to build powerful business applications without having to learn the object oriented aspects of programming. Let me give you an example of pure Clipper code.

#include "inkey.ch"

FUNCTION main()

   LOCAL GetList := {}
   LOCAL cName  := 'Fred Bloggs Jr.'
   LOCAL dDOB  := Date() -20000
   LOCAL cStatus := 'Single'
   LOCAL nSalary := 95000
   LOCAL lEmployed := .T.
   LOCAL lSave  := .F.
   LOCAL nBtn  := 0

   CLS

   @ 00, 01 SAY 'Employee Details'
   @ 02, 12 GET cName CAPTION 'Name:' PICTURE '@K'
   @ 03, 12 GET dDOB CAPTION 'Birth Date:' PICTURE '@D'
   @ 04, 12, 08, 19 GET cStatus LISTBOX { 'Unknown', 'Married', 'Single' } DROPDOWN CAPTION 'Status:'
   @ 05, 12 GET nSalary CAPTION 'Salary:' PICTURE '999,999'
   @ 06, 12 GET lEmployed CHECKBOX CAPTION 'Employed?'
   @ 08, 02 GET lSave PUSHBUTTON CAPTION 'OK' STATE {|| nBtn := 1, hb_keyPut( K_CTRL_W ) }
   @ 08, 12 GET lSave PUSHBUTTON CAPTION 'Cancel' STATE {|| ReadKill( .T. ) }

   READ

   DO CASE
   CASE nBtn == 1

      Alert( cName + ';' + ;
         DToC( dDOB ) + ';' + ;
 cStatus + ';' + ;
 Str( nSalary ) + ';' + ;
 iif( lEmployed, 'Y', 'N' ), )

   ENDCASE

   RETURN nil

Output.


p1.png

The above program works well but it is character based. For this program to have a GUI interface, one has to resort to complicated additional libraries like qt, hwgui, hmg and others. The resulting program will no longer look like a Clipper program any more. 

I have been experimenting with GTWVW as shown below.  I am not suggesting that we should use GTWVW. Use QT instead for example if the code above remains the same. 

p2.png


















My new year's wish.

Regards.
Ash

P.S. I can share my work so far.

Reply all
Reply to author
Forward
0 new messages