About GUI Wrapper, look at mymake and see if he can inspire you or
even help in some part on screenshots, options, etc.

This tool was developed in Delphi and supports Harbor & xHarbour with
BCC. Has translated into Portuguese, English, Spanish and Italian...
The download link is http://sqllib.com.br/v4/index.php?artigo=MyMake

2009/2/22 Massimo Belgrano <mbelgr...@deltain.it>:
> Here is my first template for a UI version console
> Select one on more prg with enter and compile and run with f5
> Particular useful running in harbour\test
> It Generate also project file for xmate
> now i want :
> -support also hrb
> -Manage also  -GUI,-MT
> -Give Capability to edit source selected with parametrised editor
> -support more than 15 character in file name
> - try linux
> -Not exit but remain in memory after running the sample
> - Give capability compile a source from clibpoard useful for compile
> sample found in web
>
>
>
> Can my little work be part of harbour (example)?
> This use on old path based on achoice emulating norton commanter look and feel
> Have any other multiplatform suggestion for make a Multiple FIle
> Select on a file system?
>
>
>
> /*
>  * $Id: hbm.prg
>  */
>
> /*
>  * xHarbour Project source code:
>  * xHarbour Template for hbmk 2
>  *
>  * Copyright 2000 Massimo Belgrano
>  * www - http://www.xharbour.org
> */
> #include 'DIRECTRY.CH'
> #include "INKEY.CH"
>
> function main
>   LOCAL qualedir ,QUALEPROG:=1
>  LOCAL FILECHOICE:={}
>  set func 2 to CHR(K_CTRL_W)
>  SET func 5 TO CHR(K_LEFT)
>  CLS
>  QUALEDIR="\"+CURDIR()
>  DO WHILE .T.
>      @ 0,54 CLEAR TO 23,79
>      @ 0,54  TO 23,79
>      FOR A=1 TO LEN(FILECHOICE)
>        @ 0+A,55 SAY RIGHT(FILECHOICE[A],20)
>      NEXT A
>      QUALEPROG=SELECT_FILE(filechoice,@QUALEDIR,"*.PRG",1,1,22,50)
>      @ 4,5 say qualedir
>      IF EMPTY(QUALEPROG)
>         IF LASTKEY()=K_RIGHT
>            SELECT_ELEMENT(FILECHOICE,1,55,22,78)
>         ELSE
>            EXIT
>         ENDIF
>       ENDIF
>      AADD(FILECHOICE,CURDRIVE()+":"+QUALEDIR+"\"+QUALEPROG)
>   ENDDO
>   if lastkey()<>27
>     IF LEN(FILECHOICE)>0
>         cls
>        CREA_XMATE(filechoice)
>         X_SHELL="HBMK2 "
>         FOR A=1 TO LEN(FILECHOICE)
>             X_SHELL=X_SHELL+FILECHOICE[A]   +" "
>        NEXT A
>        X_SHELL=X_SHELL+"-RUN"
>        RUN(X_SHELL)
>     ENDIF
>    ENDIF
> return
>
> FUNCTION SELECT_ELEMENT(FILECHOICE,X_ALTO,X_SINISTRA,X_BASSO,X_DESTRA)
>   LOCAL X_POS
>   if len(filechoice)=0
>      return
>   endif
>   do while .t.
>      @ x_BASSO+2,1 SAY "Press enter to remove element to list"
>      @ X_ALTO-1, X_SINISTRA -1  CLEAR to  X_BASSO +1, X_DESTRA +1
>      @ X_ALTO-1, X_SINISTRA -1  to  X_BASSO +1, X_DESTRA +1
>      X_POS=ACHOICE(X_ALTO,X_SINISTRA,X_BASSO,X_DESTRA,FILECHOICE,.T.)
>      IF X_POS>1
>         ADEL(FILECHOICE,X_POS)
>      else
>         exit
>      ENDIF
>    enddo
>   RETURN
>
> FUNCTION 
> SELECT_FILE(filechoice,X_DIRSPEC,X_WILCARD,X_ALTO,X_SINISTRA,X_BASSO,X_DESTRA)
>   LOCAL ADIRECTORY := {}, NITEM := 0, X_RET_VAL := .T.
>   LOCAL NUM_ARGOMENTI := 0, CFILESTRING := ""
>   LOCAL WIN_SELEZ
>   LOCAL X_ELEM_SEL:=0
>   SAVE SCREEN TO WIN_SELEZ
>   X_DIRSPEC=IIF(VALTYPE(X_DIRSPEC)="C",X_DIRSPEC,"\"+CURDIR())
>   X_ALTO=IIF(VALTYPE(X_ALTO)="N",X_ALTO,5)
>   X_SINISTRA=IIF(VALTYPE(X_SINISTRA)="N",X_SINISTRA,5)
>   X_BASSO=IIF(VALTYPE(X_BASSO)="N",X_BASSO,22)
>   X_DESTRA=IIF(VALTYPE(X_DESTRA)="N",X_DESTRA,40)
>   DO WHILE .T.
>       @ X_BASSO+2,1 say "Press Enter add program to compile
> "+iif(len(filechoice)>0,"F5 compile and run  Left Modify  ","") +"Esc
> to Exit"
>      @ X_ALTO-1, X_SINISTRA -1  CLEAR to  X_BASSO +1, X_DESTRA +1
>       @ X_ALTO-1, X_SINISTRA -1  to  X_BASSO +1, X_DESTRA +1
>      X_DIRECTORY=X_DIRSPEC+"\*.*"
>      // carica una file list con le informazioni della directory
>      ADIRECTORY := DIRECTORY( x_directory, "D" )
>      NUM_ARGOMENTI := IF( VALTYPE( aDirectory ) != "A", 0, LEN( aDirectory ) )
>      aFileList := {}                  // Cancella la vecchia lista
>      ASORT( aDirectory,,, { | x, y | X[F_NAME] < Y[F_NAME] } )
> // ORDINO LA DIRECTORY
>      // X[F_NAME],"B"+X[F_NAME]) <
> IIF(Y[F_ATTR]="D","A"+Y[F_NAME],"B"+Y[F_NAME]) } )
>      // COMPONGO LA STRINGA CHE VERRA VISUALIZZATA NELLA ACHOICE
>      FOR NITEM := 1 TO NUM_ARGOMENTI
>         IF ADIRECTORY[NITEM,F_ATTR ]=="D"
>            AADD( AFILELIST, PADR( ADIRECTORY[ NITEM, F_NAME ], 15 ) + ;
>                   "   <dir>"+ "  " + ;
>                   DTOC( aDirectory[ nItem, F_DATE ] ) + "  " + ;
>                   SUBSTR( aDirectory[ nItem, F_TIME ], 1, 5) + "  " + ;
>                   SUBSTR( aDirectory[ nItem, F_ATTR ], 1, 4 ) + "  " )
>            ENDIF
>      NEXT
>      X_DIRECTORY=X_DIRSPEC+"\"+X_WILCARD
>     ADIRECTORY := DIRECTORY( x_directory, "D" )
>     NUM_ARGOMENTI := IF( VALTYPE( aDirectory ) != "A", 0, LEN( aDirectory ) )
>      ASORT( aDirectory,,, { | x, y | X[F_NAME] < Y[F_NAME] } )
>      // COMPONGO LA STRINGA CHE VERRA VISUALIZZATA NELLA ACHOICE
>      FOR NITEM := 1 TO NUM_ARGOMENTI
>         IF ADIRECTORY[NITEM,F_ATTR ]<>"D"
>            AADD( AFILELIST, PADR( ADIRECTORY[ NITEM, F_NAME ], 15 ) + ;
>                   STR( aDirectory[ nItem, F_SIZE ], 8 )+ "  " + ;
>                   DTOC( aDirectory[ nItem, F_DATE ] ) + "  " + ;
>                   SUBSTR( aDirectory[ nItem, F_TIME ], 1, 5) + "  " + ;
>                   SUBSTR( aDirectory[ nItem, F_ATTR ], 1, 4 ) + "  " )
>         ENDIF
>      NEXT
>        
> X_ELEM_SEL=ACHOICE(X_ALTO,X_SINISTRA,X_BASSO,X_DESTRA,AFILELIST,.T.,,X_ELEM_SEL)
>      IF X_ELEM_SEL=0
>         X_RET_VAL=""
>         EXIT
>      ENDIF
>      X_FILE_SEL=AFILELIST[X_ELEM_SEL]
>      IF SUBSTR(X_FILE_SEL,16,8)<>"   <dir>"
>         X_RET_VAL=SUBSTR(X_FILE_SEL,1,15)
>         EXIT
>         ELSE
>         IF SUBSTR(X_FILE_SEL,1,1)="."   && SALGO DI UNA DIRECTORY
>            X_DIRSPEC=SUBSTR(X_DIRSPEC,1,RAT("\",X_DIRSPEC)-1)
>            ELSE
>            X_DIRSPEC=X_DIRSPEC+"\"+ALLTRIM(SUBSTR(X_FILE_SEL,1,15))
>         ENDIF
>      ENDIF
>   ENDDO
>   RESTORE SCREEN FROM WIN_SELEZ
>   RETURN(X_RET_VAL)
>
> FUNCTION CREA_XMATE(filechoice)
>   local a_xmate:={},A
>   LOCAL X_LOG,X_MATE
>   AADD(A_XMATE,"[Version]")
>   AADD(A_XMATE,"Type=xMate")
>   AADD(A_XMATE,"Number=1.15")
>   AADD(A_XMATE,"")
>   AADD(A_XMATE,"[Info]")
>   AADD(A_XMATE,"Type=Executable")
>   AADD(A_XMATE,"Architecture=harbour")
>   AADD(A_XMATE,"Include=")
>   AADD(A_XMATE,"Define=")
>   AADD(A_XMATE,"")
>   AADD(A_XMATE,"[xMate]")
>   AADD(A_XMATE,"Create Map/List File=No")
>   AADD(A_XMATE,"")
>   AADD(A_XMATE,"[Project]")
>   AADD(A_XMATE,"Run=")
>   AADD(A_XMATE,"Params=")
>   AADD(A_XMATE,"Final Path=%HOME%")
>   AADD(A_XMATE,"Maintain LNK=Yes")
>   AADD(A_XMATE,"Default Type=1")
>   AADD(A_XMATE,"Error log=")
>   AADD(A_XMATE,"")
>   AADD(A_XMATE,"[Data Path]")
>   AADD(A_XMATE,"Dbf=")
>   AADD(A_XMATE,"")
>   AADD(A_XMATE,"[Editor]")
>   FOR A=1 TO LEN(FILECHOICE)
>      AADD(A_XMATE,ALLTRIM(FILECHOICE[A])+"="+STR(A)+",N,N")
>   NEXT
>   AADD(A_XMATE,"")
>   AADD(A_XMATE,"")
>   AADD(A_XMATE,"[Files]")
>   FOR A=1 TO LEN(FILECHOICE)
>      AADD(A_XMATE,ALLTRIM(FILECHOICE[A])+"="+STR(A)+",.F.,0,0,")
>   NEXT
>   xprjmate=aLltrim(filechoice[1])
>   xprjmate=substr(XPRJMATE,1,len(xPRJmate)-4) +".xhp"
>   if .not. file(XPRJMATE)
>      X_LOG=FCREATE(XPRJMATE)
>      FOR a=1 to len(A_XMATE)
>         FWRITE(X_LOG,A_XMATE[a]+CHR(13)+CHR(10))
>      NEXT
>
>      FCLOSE(X_LOG)
>   ENDIF
> *  returm
>
>  */
>
>
>
> 2009/2/16 Viktor Szakáts <harbour...@syenar.hu>:
>>> I have still one suggestion
>>> Having a simple interactive mode
>>> launching hbmk without parameter see a list of prg,hbp,c,rc
>>> select with space one or more and press button compile
>>> Simple and easy but will be a bridge between people command line
>>> driven and gui driven
>>
>> Nope sorry, I've meant this is a pure command line tool.
>> In fact all our supplied tools are command line only, and
>> this shouldn't be an exception.
>> If you want CUI/GUI, a wrapper program is the best solution. This
>> could simply create a hbmk command line after presenting
>> all the options on the screen for the user and either launch it
>> or save it as .hbm (similar to hbmake). Can be independently
>> developed from hbmk, and if it's good and portable (which now
>> means CUI), we can also include it as part of the Harbour package.
>>
> _______________________________________________
> Harbour mailing list
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
>



-- 
Vailton Renato
SQL LIB, MyMake & xDev Developer
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to