Dec
06
2011
-

MigSoft Project Manager v.11.1205

Creamos el primer proyecto, buscamos el ejemplo contactos de HMG.

2011-12-05_235701

F3 Open, y seleccionamos PRG Source Files

2011-12-06_000944

Seleccionamos “Contactos.prg”

2011-12-06_001059

Debemos guardar el proyecto para el caso “demo” asume la extensión “.mpm”

2011-12-06_001025

Guardamos, ahora tenemos la ruta del proyecto

2011-12-06_001038

Agregamos los archivos “.PRG” faltantes

2011-12-06_001059

Seleccionamos la carpeta

2011-12-06_001110

Presionamos el botón All

2011-12-06_001119

Todos los “.PRG” incluidos

2011-12-06_001136

Configuramos la ruta de (x)Harbour dependiendo del compilador C seleccionado o si es Harbour o xHarbour.

2011-12-06_001218

MPM busca en forma automática la carpeta de las librerías dependiendo del compilador seleccionado.

2011-12-06_010257

Configuramos la ruta del compilador C.

2011-12-06_001230

Configuramos la ruta de la librería GUI ( ooHG, HMG, MiniGUI, FWH )

2011-12-06_001250

Se propone utilizar el mismo criterio de Harbour para guardar las librerías ooHG compiladas con distintos compiladores.

2011-12-06_005924

En este lugar se incluyen otras librerías.

2011-12-06_001334

Aquí aparecen todos los mensajes generados por el compilador.

2011-12-06_001342

Podemos seleccionar la opción de comprimir el archivo “.exe” generado

2011-12-06_001415

Presionamos F4 Build

2011-12-06_001644

Ejecutamos el programa.

2011-12-06_001734

Previamente se comprime el “.exe”

2011-12-06_001756

 

2011-12-06_001814

Programa en ejecución y mensajes del compilador

2011-12-06_001937

En la carpeta del proyecto se crea una carpeta donde se guardan los archivos “.obj” y “.c”

2011-12-06_002115

Contenido de la carpeta autogenerada por MPM

2011-12-06_002129

Descarga MPM Click Aquí

Written by MigSoft in: GUI,Windows |
Dec
02
2011
-

Quiero Harbour Ahora !!!

Ok, Ok … Última compilación directamente desde SourceForge

Written by MigSoft in: Harbour,Windows |
Jul
22
2011
-

Nombre de librerías de Harbour

 

22-07-2011 21-58-22

Written by MigSoft in: Harbour |
Jul
22
2011
-

Nombre de librerías de Harbour

 

22-07-2011 21-56-45

Written by MigSoft in: Harbour |
Aug
30
2010
-

Ejemplo TestOle (testole.prg)

/*
 * $Id: testole.prg 15174 2010-07-25 08:45:50Z vszakats $
 */

/*
 
* Harbour Project source code
 *
 * hbole library demo/test code
 *
 * Copyright 2007 Enrico Maria Giordano e.m.giordano at emagsoftware.it
 * Copyright 2009 Mindaugas Kavaliauskas <dbtopas at dbtopas.lt>
 * Copyright 2008 Viktor Szakats (harbour.01 syenar.hu)
 *
 * www – http://harbour-project.org
 *
 */

PROCEDURE Main()
  
LOCAL nOption

   DO WHILE .T.
     
? ""
     
? "Select OLE test:"
     
? "1) MS Excel"
     
? "2) MS Word"
     
? "3) MS Outlook (1)"
     
? "4) MS Outlook (2)"
     
? "5) Internet Explorer"
     
? "0) Quit"
     
? "> "

      nOption := Inkey( 0 )
     
?? Chr( nOption )

      IF     nOption == Asc( "1" )
        
Exm_MSExcel()
     
ELSEIF nOption == Asc( "2" )
        
Exm_MSWord()
     
ELSEIF nOption == Asc( "3" )
        
Exm_MSOutlook()
     
ELSEIF nOption == Asc( "4" )
        
Exm_MSOutlook2()
     
ELSEIF nOption == Asc( "5" )
        
Exm_IExplorer()
     
ELSEIF nOption == Asc( "0" )
        
EXIT
     
ENDIF
  
ENDDO

   RETURN

STATIC PROCEDURE Exm_MSExcel()
  
LOCAL oExcel, oWorkBook, oWorkSheet, oAS
  
LOCAL nI, nCount

   IF ( oExcel := win_oleCreateObject( "Excel.Application" ) ) != NIL

      oWorkBook := oExcel:WorkBooks:Add()

      // Enumerator test
     
FOR EACH oWorkSheet IN oWorkBook:WorkSheets
        
? oWorkSheet:Name
     
NEXT

      // oWorkBook:WorkSheets is a collection
     
nCount := oWorkBook:WorkSheets:Count()

      // Elements of collection can be accessed using :Item() method
     
FOR nI := 1 TO nCount
        
? oWorkBook:WorkSheets:Item( nI ):Name
     
NEXT

      // OLE also allows to access collection elements by passing
     
// indices to :Worksheets property
     
FOR nI := 1 TO nCount
        
? oWorkBook:WorkSheets(nI):Name
     
NEXT

      oAS := oExcel:ActiveSheet()

      // Set font for all cells
     
oAS:Cells:Font:Name := "Arial"
     
oAS:Cells:Font:Size := 12

      oAS:Cells( 1, 1 ):Value := "OLE from Harbour"
     
oAS:Cells( 1, 1 ):Font:Size := 16

      // oAS:Cells( 1, 1 ) is object,
     
// but oAS:Cells( 1, 1 ):Value has value of the cell
     
? "Object valtype:", ValType( oAS:Cells( 1, 1 ) ), ;
        "Value:"
, oAS:Cells( 1, 1 ):Value

      oAS:Cells( 3, 1 ):Value := "String:"
     
oAS:Cells( 3, 2 ):Value := "Hello, World!"

      oAS:Cells( 4, 1 ):Value := "Numeric:"
     
oAS:Cells( 4, 2 ):Value := 1234.56
     
oAS:Cells( 4, 3 ):Value := oAS:Cells( 4, 2 ):Value
     
oAS:Cells( 4, 4 ):Value := oAS:Cells( 4, 2 ):Value
     
oAS:Cells( 4, 3 ):Value *= 2
     
oAS:Cells( 4, 2 ):Value++

      oAS:Cells( 5, 1 ):Value := "Logical:"
     
oAS:Cells( 5, 2 ):Value := .T.

      oAS:Cells( 6, 1 ):Value := "Date:"
     
oAS:Cells( 6, 2 ):Value := DATE()

      oAS:Cells( 7, 1 ):Value := "Timestamp:"
     
oAS:Cells( 7, 2 ):Value := HB_DATETIME()

      // Some formatting
     
oAS:Columns( 1 ):Font:Bold := .T.
     
oAS:Columns( 2 ):HorizontalAlignment := -4152  // xlRight

      oAS:Columns( 1 ):AutoFit()
     
oAS:Columns( 2 ):AutoFit()
     
oAS:Columns( 3 ):AutoFit()
     
oAS:Columns( 4 ):AutoFit()

      oAS:Cells( 3, 2 ):Font:ColorIndex := 3  // red

      oAS:Range( "A1:B1" ):HorizontalAlignment := 7
     
oAS:Range( "A3:A7" ):Select()

      oExcel:Visible := .T.

      oExcel:Quit()
  
ELSE
     
? "Error: MS Excel not available. [" + win_oleErrorText()+ "]"
  
ENDIF

   RETURN

STATIC PROCEDURE Exm_MSWord()
  
LOCAL oWord, oText

   IF ( oWord := win_oleCreateObject( "Word.Application" ) ) != NIL

      oWord:Documents:Add()

      oText := oWord:Selection()

      oText:Text := "OLE from Harbour" + hb_eol()
     
oText:Font:Name := "Arial"
     
oText:Font:Size := 48
     
oText:Font:Bold := .T.

      oWord:Visible := .T.
     
oWord:WindowState := 1 /* Maximize */
  
ELSE
     
? "Error. MS Word not available.", win_oleErrorText()
  
ENDIF

   RETURN

STATIC PROCEDURE Exm_MSOutlook()
  
LOCAL oOL, oList

   IF ( oOL := win_oleCreateObject( "Outlook.Application" ) ) != NIL
     
oList := oOL:CreateItem( 7 /* olDistributionListItem */ )
     
oList:DLName := "Distribution List"
     
oList:Display( .F. )
  
ELSE
     
? "Error. MS Outlook not available.", win_oleErrorText()
  
ENDIF

   RETURN

STATIC PROCEDURE Exm_MSOutlook2()
  
LOCAL oOL, oLista, oMail
  
LOCAL i

   IF ( oOL := win_oleCreateObject( "Outlook.Application" ) ) != NIL

      oMail := oOL:CreateItem( 0 /* olMailItem */ )

      FOR i := 1 TO 10
        
oMail:Recipients:Add( "Contact" + LTRIM( STR( i, 2 ) ) + ;
               "<contact"
+ LTRIM( STR( i, 2 ) ) + "@server.com>" )
     
NEXT

      oLista := oOL:CreateItem( 7 /* olDistributionListItem */ )
     
oLista:DLName := "Test with distribution list"
     
oLista:Display( .F. )
     
oLista:AddMembers( oMail:Recipients )
     
oLista:Save()
     
oLista:Close( 0 )
  
ELSE
     
? "Error. MS Outlook not available.", win_oleErrorText()
  
ENDIF

   RETURN

STATIC PROCEDURE Exm_IExplorer()
  
LOCAL oIE

   IF ( oIE := win_oleCreateObject( "InternetExplorer.Application" ) ) != NIL
     
oIE:Visible := .T.
     
oIE:Navigate( "http://harbour-project.org" )
  
ELSE
     
? "Error. IExplorer not available.", win_oleErrorText()
  
ENDIF

   RETURN

30-08-2010 22-18-40

30-08-2010 22-19-50

30-08-2010 22-20-36

30-08-2010 22-21-24

30-08-2010 22-22-05

Written by MigSoft in: Ejemplos,Harbour |
Jul
26
2010
-

Ejemplo ADOxls (adoxls.prg)

/*
 *
 * http://support.microsoft.com/kb/257819
 *
 * 2010 Adapted by MigSoft <mig2soft / at / yahoo.com>
 * www – http://mig2soft.com
 *
 */

#include "ado.ch"

Function Main()
   
Local cn,rsT,strTbl,rsC

    With Object cn := CreateObject( "ADODB.Connection" )
   
:P rovider="Microsoft.Jet.OLEDB.4.0"
   
:ConnectionString="Data Source=ExcelSrc.xls;Extended Properties=Excel 8.0;"
   
:P rovider="MSDASQL"
   
:ConnectionString="Driver={Microsoft Excel Driver (*.xls)};DBQ=ExcelSrc.xls;"
   
:CursorLocation=adUseClient
   
:Open()
   
End

    rsT := cn:OpenSchema(adSchemaTables)
   
intTblCnt := rsT:RecordCount
   
intTblFlds := rsT:Fields:Count
   
? "Tables: " , str( intTblCnt)
   
? "——————–"
   
For t := 1 To intTblCnt
   
strTbl := rsT:Fields("TABLE_NAME"):Value
   
? "Table # " +ltrim(str( t ))+ ‘ ‘ + strTbl
   
? "——————–"
   
For f := 0 To intTblFlds - 1
           
? rsT:Fields(f):Name
           
? rsT:Fields(f):Value
   
Next
   
?  "——————–"
   
rsC := cn:OpenSchema(adSchemaColumns, {,,strTbl,} )
   
intColCnt := rsC:RecordCount
   
intColFlds := rsC:Fields:Count
   
For c := 1 To intColCnt
       
strCol := hb_ansitooem(rsC:Fields("COLUMN_NAME"):Value)
       
? "Column #: " + ltrim(str(c)) + ‘ ‘ + strCol
       
? "——————–"
           
For f := 0 To intColFlds - 1
               
? rsC:Fields(f):Name
                   
? rsC:Fields(f):Value
       
Next
       
? "——————–"
       
rsC:MoveNext()
       
wait
   
Next
   
rsC:Close()
   
? "——————–"
   
rsT:MoveNext()
   
Next
   
rsT:Close()
   
cn:Close()

Return( Nil )

Written by MigSoft in: Ejemplos,Harbour |
Jun
26
2010
-

Ejemplo wvtext (wvtext.prg)

/*
 * $Id: wvtext.prg 14797 2010-06-17 13:37:58Z vszakats $
 */

//———————————————————————-//
//———————————————————————-//
//———————————————————————-//
//
//                   Harbour Extended Features Demo
//                                    .
//                 Pritpal Bedi <pritpal@vouchcac.com>
//
//———————————————————————-//
//———————————————————————-//
//———————————————————————-//

#include "hbgtinfo.ch"
#include "inkey.ch"
#include "setcurs.ch"

#define RGB(r,g,b) ( r + ( g * 256 ) + ( b * 256 * 256 ) )

//———————————————————————-//

STATIC s_nRows := 20
STATIC s_nCols := 60
STATIC s_nColorIndex := 1

//———————————————————————-//

PROCEDURE Main()
  
LOCAL nKey, lMark, lResize, lClose
  
LOCAL nHeight := 20
  
LOCAL nWidth  := Int( nHeight / 2 )
  
LOCAL cFont

   LOCAL nMSec

   Hb_GtInfo( HB_GTI_FONTNAME , cFont   )
  
Hb_GtInfo( HB_GTI_FONTWIDTH, nWidth  )
  
Hb_GtInfo( HB_GTI_FONTSIZE , nHeight )
  
SetCursor( SC_NONE )

   HB_GtInfo( HB_GTI_CLOSABLE, .F. )

   DispScreen()

   DO WHILE .T.

      nKey := Inkey( , INKEY_ALL + HB_INKEY_GTEVENT )

      if nKey == K_ESC
        
exit
     
endif

      IF nMSec != NIL .AND. hb_milliSeconds() > nMSec + 1500
        
DispOutAt( maxrow(), 0, Space( maxcol()+1 ), "N/G*" )
        
nMSec := NIL
     
ENDIF

      DO CASE
     
CASE nKey == K_ENTER
        
Alert( "<Enter> Pressed" )

      CASE nKey == K_F2
        
lMark := Hb_GtInfo( HB_GTI_SELECTCOPY )
        
Hb_GtInfo( HB_GTI_SELECTCOPY, !lMark )

      CASE nKey == K_F3
        
lResize := Hb_GtInfo( HB_GTI_RESIZABLE )
        
Hb_GtInfo( HB_GTI_RESIZABLE, !lResize )

      CASE nKey == K_F4
        
lClose := Hb_GtInfo( HB_GTI_CLOSABLE )
        
hb_GtInfo( HB_GTI_CLOSABLE, !lClose )

      CASE nKey == K_F5
        
SetPalette( 1 )

      CASE nKey == K_F6
        
SetPalette( 0 )

      CASE nKey == K_F7
        
SetPaletteIndex()

      CASE nKey == K_F8
        
Alert( "Menu text changed. Was: " + hb_GtInfo( HB_GTI_SELECTCOPY, ;
                                           
DToS(Date()) + " " + Time() ) )

      CASE nKey == K_F9
        
hb_GTInfo( HB_GTI_RESIZEMODE, iif( hb_GTInfo( HB_GTI_RESIZEMODE ) == ;
                   
HB_GTI_RESIZEMODE_ROWS, HB_GTI_RESIZEMODE_FONT, ;
                   
HB_GTI_RESIZEMODE_ROWS ) )

      CASE nKey == K_F10
        
IF hb_MTVM()
           
hb_threadStart( @thFunc() )
        
ELSE
           
Alert( "MT mode not available. "+;
                    "Rebuild this program with -mt switch and try again."
)
        
ENDIF

      CASE nKey == HB_K_RESIZE
        
DispScreen()
        
DispOutAt( maxrow(), 33, "Resized      ", "B/G*" )
        
nMSec := hb_milliSeconds()

      CASE nKey == HB_K_GOTFOCUS
        
DispOutAt( maxrow(), 33, "We got focus ", "B/G*" )
        
nMSec := hb_milliSeconds()

      CASE nKey == HB_K_LOSTFOCUS
        
DispOutAt( maxrow(), 33, "We lost focus", "B/G*" )
        
nMSec := hb_milliSeconds()

      CASE nKey == HB_K_CLOSE
        
IF Alert( "Close Application", {"Yes","No" } ) == 1
           
QUIT
        
ENDIF

      ENDCASE
  
ENDDO

   RETURN

//———————————————————————-//

STATIC PROCEDURE DispScreen()
  
LOCAL nRow := 11, nCol := 28
  
LOCAL cColor := "N/W"
  
LOCAL nMaxCol := MaxCol() + 1
  
LOCAL l1,l2,l3,l4,l5

   DispBegin()

   SetColor( "N/W" )
  
CLS
  
DispOutAt( 0, 0, PadC( "Harbour GT – New Features", nMaxCol ), "N/GR*" )

   l1 := "______  __             ______________________                        "
  
l2 := "___  / / /_____ ___________ /___________  _________    __  ____/____/"
  
l3 := "__  /_/ /_  __ `/_  ___/_  __ \  __ \  / / /_  ___/    _  / __ __/   "
  
l4 := "_  __  / / /_/ /_  /   _  /_/ / /_/ / /_/ /_  /        / /_/ / _  /  "
  
l5 := "/_/ /_/  \__,_/ /_/    /_.___/\____/\__,_/ /_/         \____/  /_/   "

   // Contributed by Massimo Belgrano
  
DispOutAt( 2, 0, PadC( l1 ,nMaxCol ), "W+/W" )
  
DispOutAt( 3, 0, PadC( l2 ,nMaxCol ), "W+/W" )
  
DispOutAt( 4, 0, PadC( l3 ,nMaxCol ), "W+/W" )
  
DispOutAt( 5, 0, PadC( l4 ,nMaxCol ), "W+/W" )
  
DispOutAt( 6, 0, PadC( l5 ,nMaxCol ), "W+/W" )

   DispOutAt( ++nRow, 0, PadC( "< F2 MarkCopy    Toggle >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "< F3 Resize      Toggle >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "< F4 Closable    Toggle >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "< F5 Palette L   Repeat >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "< F6 Palette D   Repeat >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "< F7 Palette By Index R >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "< F8 MarkCopy menu text >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "<    Click Other Window >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "<    Click X Button     >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "< F9 Resize Mode Toggle >", nMaxCol ), cColor )
  
DispOutAt( ++nRow, 0, PadC( "< F10 Open New Window   >", nMaxCol ), cColor )

   DispOutAt( maxrow(), 0, Space( MaxCol() + 1 ), "N/G*" )

   DispOutAt( 0, 0                  , "TL", "N/GR*" )
  
DispOutAt( 0, MaxCol() - 1       , "TR", "N/GR*" )
  
DispOutAt( MaxRow(), 0           , "BL", "N/G*"  )
  
DispOutAt( MaxRow(), MaxCol() - 1, "BR", "N/G*"  )

   DispEnd()
  
RETURN

//———————————————————————-//

PROCEDURE HB_GTSYS()
  
REQUEST HB_GT_WVT_DEFAULT
  
REQUEST HB_GT_WIN
  
RETURN

//———————————————————————-//

FUNCTION SetPalette( nMode )
  
LOCAL aPalette := Hb_GtInfo( HB_GTI_PALETTE )

   STATIC s_nR := 198
  
STATIC s_nG := 198
  
STATIC s_nB := 198

   s_nR += iif( nMode == 0, -5, 5 )
  
s_nG += iif( nMode == 0, -5, 5 )
  
s_nB += iif( nMode == 0, -5, 5 )

   // Change "W" to slightly gray everytime you press F5
  
//
  
aPalette[ 8 ] := RGB( s_nR, s_nG, s_nB )

   Hb_GtInfo( HB_GTI_PALETTE, aPalette )
  
DispScreen()

   RETURN NIL
//———————————————————————-//

FUNCTION SetPaletteIndex()

   Hb_GtInfo( HB_GTI_PALETTE, 8, RGB( 120, 200, 240 ) )
  
DispScreen()

   RETURN NIL

//———————————————————————-//

PROCEDURE thFunc()
  
LOCAL cTitle, oBrowse, lEnd, nKey, i, aStruct
  
LOCAL aColor := { ‘W+/N’, ‘W+/B’, ‘W+/G’, ‘W+/BG’, ;
                     ‘W+/N*’
, ‘W+/RB’, ‘N/W*’, ‘N/GR*’ }

   STATIC nBrowser := 0
  
STATIC nZx := 0
  
STATIC nZy := 0

   nBrowser++
  
nZx += 20
  
nZy += 20

   /* allocate own GT driver */
  
hb_gtReload( ‘WVT’ )
  
Hb_GtInfo( HB_GTI_PALETTE, 8, RGB( 120, 200, 240 ) )

   IF ( nBrowser % 2 ) != 0
     
Hb_GtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS )
  
ENDIF
  
Hb_GtInfo( HB_GTI_WINTITLE, ‘test.dbf    [' + iif( ( nBrowser % 2 ) != 0,;
                          'RESIZABLE_BY_ROWS'
, 'RESIZABLE_BY_FONT' ) + ']‘ )

   SetCursor( SC_NONE )

   s_nColorIndex++
  
IF s_nColorIndex > len( aColor )
     
s_nColorIndex := 1
  
ENDIF

   s_nRows++
  
s_nCols += 2

   SetMode( s_nRows, s_nCols )
  
SetColor( aColor[ s_nColorIndex ] )
  
Hb_GtInfo( HB_GTI_WINTITLE, cTitle )
  
Hb_GtInfo( HB_GTI_SETPOS_XY, nZx, nZy )

   cTitle := ‘New Window with ‘+ hb_ntos( MaxRow() ) +;
                          ‘ Rows and ‘
+ hb_ntos( MaxCol() ) + ‘ Columns’
  
DispOutAt( 0, 0, padc( cTitle, maxcol() + 1 ), ‘N/GR*’ )

   USE test SHARED
  
aStruct := DbStruct()

   oBrowse := TBrowse():New( 1, 0, maxrow(), maxcol() )

   oBrowse:ColSep        := " ³ "
  
oBrowse:HeadSep       := "ÄÂÄ"
  
oBrowse:GoTopBlock    := { || dbGoTop() }
  
oBrowse:GoBottomBlock := { || dbGoBottom() }
  
oBrowse:SkipBlock     := { | nSkip | dbSkipBlock( nSkip, oBrowse ) }

   for i := 1 to len( aStruct )
     
oBrowse:AddColumn( TBColumnNew( aStruct[ i,1 ], BlockField( i ) ) )
  
next

   oBrowse:configure()

   lEnd := .F.
  
DO WHILE ! lEnd
     
oBrowse:ForceStable()

      nKey := InKey( 0, INKEY_ALL + HB_INKEY_GTEVENT )

      IF BrwHandleKey( oBrowse, nKey, @lEnd )
        
//
     
ELSE
        
IF nKey == HB_K_RESIZE
           
cTitle := ‘New Window with ‘+ltrim( str( MaxRow() ) )+;
                          ‘ Rows and ‘
+ltrim( str( MaxCol() ) )+‘ Columns’
           
DispOutAt( 0, 0, padc( cTitle, maxcol()+1 ), ‘N/GR*’ )

            oBrowse:nBottom := MaxRow()
           
oBrowse:nRight := MaxCol()
           
oBrowse:Configure()
           
oBrowse:RefreshAll()
        
ENDIF
     
ENDIF
  
ENDDO

   DbCloseArea()

   RETURN
//———————————————————————-//
STATIC FUNCTION DbSkipBlock( n, oTbr )

   LOCAL nSkipped := 0

   if n == 0
     
DBSkip( 0 )

   elseif n > 0
     
do while nSkipped != n .and. TBNext( oTbr )
        
nSkipped++
     
enddo
  
else
     
do while nSkipped != n .and. TBPrev( oTbr )
        
nSkipped–
     
enddo
  
endif

   RETURN nSkipped
//——————————————————————-//
STATIC FUNCTION TBNext( oTbr )

   LOCAL nSaveRecNum := recno()
  
LOCAL lMoved := .T.

   if Eof()
     
lMoved := .F.
  
else
     
DBSkip( 1 )
     
if Eof()
        
lMoved := .F.
        
DBGoTo( nSaveRecNum )
     
endif
  
endif

   RETURN lMoved
//——————————————————————-//
STATIC FUNCTION TBPrev( oTbr )
  
LOCAL nSaveRecNum := Recno()
  
LOCAL lMoved := .T.

   DBSkip( -1 )

   if Bof()
     
DBGoTo( nSaveRecNum )
     
lMoved := .F.
  
endif

   RETURN lMoved
//——————————————————————-//
STATIC FUNCTION BlockField( i )
  
RETURN {|| fieldget( i ) }
//——————————————————————-//
STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd )
  
LOCAL lRet := .T.

   DO CASE
  
CASE nKey == K_ESC        ; lEnd := .T.
  
CASE nKey == K_ENTER      ; lEnd := .T.
  
CASE nKey == K_DOWN       ; oBrowse:Down()
  
CASE nKey == K_UP         ; oBrowse:Up()
  
CASE nKey == K_LEFT       ; oBrowse:Left()
  
CASE nKey == K_RIGHT      ; oBrowse:Right()
  
CASE nKey == K_PGDN       ; oBrowse:pageDown()
  
CASE nKey == K_PGUP       ; oBrowse:pageUp()
  
CASE nKey == K_CTRL_PGUP  ; oBrowse:goTop()
  
CASE nKey == K_CTRL_PGDN  ; oBrowse:goBottom()
  
CASE nKey == K_HOME       ; oBrowse:home()
  
CASE nKey == K_END        ; oBrowse:end()
  
CASE nKey == K_CTRL_LEFT  ; oBrowse:panLeft()
  
CASE nKey == K_CTRL_RIGHT ; oBrowse:panRight()
  
CASE nKey == K_CTRL_HOME  ; oBrowse:panHome()
  
CASE nKey == K_CTRL_END   ; oBrowse:panEnd()
  
CASE nKey == K_MWBACKWARD ; oBrowse:down()
  
CASE nKey == K_MWFORWARD  ; oBrowse:up()
  
OTHERWISE                 ; lRet := .F.
  
ENDCASE

   RETURN lRet

26-06-2010 12-33-01

26-06-2010 12-33-21

26-06-2010 12-35-26

Written by MigSoft in: Ejemplos,Harbour |
Jun
06
2010
-

Ejemplo Tbrowse (tb1.prg)

/*
 * $Id: tb1.prg 14676 2010-06-03 16:23:36Z vszakats $
 */

/*
 
* Harbour Project source code:
 *    Demonstration/test code for TBrowse class
 *
 * Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
 * www – http://harbour-project.org
 *
 */

#include "inkey.ch"
#include "button.ch"
#include "setcurs.ch"
#include "box.ch"

proc main()

   static s_nCount := 0
  
static s_nPos   := 1
  
static s_nSize  := 100

   local nTop, nLeft, nBottom, nRight
  
local cColor
  
local oBrw, oCol1, oCol2, oCol3, oCol4
  
local nKey, nCol

   nTop    := 2
  
nLeft   := 10
  
nBottom := 20
  
nRight  := 70
  
cColor  := "W+/R,G+/BR,RG+/B,BG+/G,N/GR,GR+/BG,B/GR*"

   set date format to "yyyy/mm/dd"

   // enable mouse events in CL53/Harbour
  
#ifdef _SET_EVENTMASK
     
set( _SET_EVENTMASK, INKEY_ALL )
     
mSetCursor( .t. )
  
#endif

   cls
  
dispBox( nTop, nLeft, nBottom, nRight, B_DOUBLE_SINGLE, cColor )
  
oBrw := tbrowseNew( nTop + 1, nLeft + 1, nBottom - 1, nRight - 1 )
  
dispOutAt( nTop + 3,    nLeft,  "Ã", cColor )
  
dispOutAt( nTop + 3,    nRight, "´", cColor )
  
dispOutAt( nBottom - 2, nLeft,  "Ã", cColor )
  
dispOutAt( nBottom - 2, nRight, "´", cColor )

   oBrw:colorSpec( cColor )
  
oBrw:headSep := "¿ ÚÄ"
  
oBrw:footSep := "Ù ÀÄ"
  
oBrw:colSep  := "³ ³"

   oBrw:SkipBlock     := { | n | hb_idleSleep( 0.2 ), ;
                          
n := iif( n < 0, max( n, 1 - s_nPos ), ;
                                           
min( s_nSize - s_nPos, n ) ), ;
                          
s_nPos += n, n }
  
oBrw:GoTopBlock    := { || s_nPos := 1 }
  
oBrw:GoBottomBlock := { || s_nPos := s_nSize }

   oCol1 := tbColumnNew( "COL;1;", {|| s_nPos } )
  
oCol1:defColor := { 2, 1, 3, 4 }
  
oCol1:footing := "position"
  
oCol1:colorBlock := {|val| { val % 5 + 1, val % 3 + 2 } }

   oCol2 := tbColumnNew( "COL;2",  {|| s_nCount++ } )
  
oCol2:defColor := { 3, 4, 5, 6 }
  
oCol2:footing := "counter"
  
oCol2:headSep := "¿ ÚÄ´HIDEÃÄ"

   oCol3 := tbColumnNew( "COL 3",  {|| s_nPos % 3 == 0 } )
  
oCol3:defColor := { 5, 6, 2, 3 }
  
oCol3:footing := "logical"
  
oCol3:picture := "@YR [Y]"  // Clipper wrongly calculate the size here
  
oCol3:headSep := "· ÖÄ´HIDEÃÄ"
  
oCol3:footSep := "½ ÓÄ"
  
oCol3:colSep  := "º º"

   oCol4 := tbColumnNew( "   SHOW;   ALL",  {|| date() - s_nPos} )
  
oCol4:defColor := { 6, 3, 4, 2 }
  
oCol4:footing := "date"

   oBrw:addColumn( oCol1 )
  
oBrw:addColumn( oCol2 )
  
oBrw:addColumn( oCol3 )
  
oBrw:addColumn( oCol4 )

   // start at bottom
  
oBrw:goBottom()

   while .T.
     
while !oBrw:stabilize() .and. nextkey()==0
     
enddo
     
nKey := inkey( 0 )
     
if nKey == K_ESC
        
exit
     
elseif nKey == K_INS
        
oBrw:colorRect( { oBrw:rowPos, 1, oBrw:rowPos, 4 }, { 7, 6 } )
     
elseif nKey == K_DEL
        
oBrw:refreshCurrent()
     
elseif nKey >= ASC( "0" ) .AND. nKey <= ASC( "3" )
        
oBrw:freeze := nKey - ASC( "0" )
     
elseif nKey == K_LBUTTONDOWN .and. ;
            
oBrw:hitTest(mRow(),mCol()) == HTHEADSEP .and. ;
            
( ( nCol := oBrw:mColPos ) == 2 .or. nCol == 3 )
        
if nCol == 2
           
oCol2:width := 0
        
else
           
oCol3:width := 0
        
endif
        
oBrw:configure()
     
elseif nKey == K_LBUTTONDOWN .and. ;
            
oBrw:hitTest(mRow(),mCol()) == HTHEADING .and. ;
            
oBrw:mColPos == 4
        
oCol2:width := 10
        
oCol3:width := 7
        
oBrw:configure()
     
else
        
oBrw:applyKey( nKey )
     
endif
  
enddo

return

#ifndef __HARBOUR__
proc hb_idleSleep( n )
  
n += seconds()
  
while seconds() < n
  
enddo
return
#endif

06-06-2010 12-33-36

Written by MigSoft in: Uncategorized |
Jun
06
2010
-

Ejemplo Versión (version.prg)

/*
   $Id: version.prg 14676 2010-06-03 16:23:36Z vszakats $

   Testing the VERSION function

   Harbour Project source code http://harbour-project.org/
   Donated to the public domain by David G. Holm <dholm@jsd-llc.com>.
*/

Function Main()

   outstd( chr( 34 ) + version() + chr( 34 ) + hb_osnewline() )
  
outstd( chr( 34 ) + hb_compiler() + chr( 34 ) + hb_osnewline() )
  
outstd( chr( 34 ) + os() + chr( 34 ) + hb_osnewline() )

   Return nil

06-06-2010 12-18-44

Written by MigSoft in: Ejemplos,Harbour |
May
30
2010
-

Harbour directory structure

30-05-2010 11-14-40
/*
* $Id: dirstruc.txt 12843 2009-11-09 22:38:57Z vszakats $
*/

Harbour directory structure
===========================

Follow are the various directories that exist under the Harbour tree.
Under each directory exist in this list there is also a special directory
named .svn, which should normally ignored since it is used by the SVN to keep
track of all files (read the FAQ if you don
‘t know what SVN is).

<harbour>               – Main Harbour directory. Contain all the various
|                                  make file and Changelog (=changes history) files.
|
+—bin                 – Executable and build scripts.
|                             Should contain harbour.exe and other executable. (*)
|
+—config              – Configuration Files (.mk) for the GNU Make system.
|   |
|   +—bsd             – Configuration files specific to FreeBSD.
|   |
|   +—darwin          – Configuration files specific to BSD/Darwin.
|   |
|   +—dos             – Configuration files specific to DOS.
|   |
|   +—hpux            – Configuration files specific to HP-UX.
|   |
|   +—linux           – Configutation files specific to GNU/Linux.
|   |
|   +—os2             – Configutation files specific to OS/2.
|   |
|   +—sunos           – Configutation files specific to SunOS.
|   |
|   +—win             – Configutation files specific to MS Windows.
|
+—contrib             – Miscellaneous contribution files. Those are not
|   |                            part of the official Harbour project.
|   |
|   |—gtalleg         – GT subsystem based on Allegro with graphic
|   |                           extensions.
|   |
|   +—gtwvg           – GT subsystem for Windows GUI using GDI functions.
|   |   |
|   |   +—tests       – Demo program and sample images.
|   |
|   +—hbapollo    – Wrapper functions for VistaSoftware’s Apollo

|   |   |                      database driver.
|   |   |
|   |   +
—tests       – Test programs.
|   |

|   +
—hbbmcdx         – DBFCDX RDD with bitmap filters compatible with
|   |                               CA-Cl*pper 5.3

|   |
|   +
—hbbtree         – BTree library.
|   |   |

|   |   +
—doc         – HB_BTree C and Harbour API documentation.
|   |   |

|   |   +
—tests       – HB_BTree api test programs.
|   |

|   +
—hbclipsm        – Miscellaneous contribution files.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbct            – CA-T**ls Compatible Library for Harbour.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbcurl          – libcurl ‘easy’ API – Harbour interface.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbfbird         – Harbour Low Level api for Firebird and Interbase
|   |   |                         RDBMS.

|   |   |
|   |   +
—tests       – Test programs.
|   |

|   +
—hbfimage        – Wrapper for FreeImage.
|   |   |

|   |   +
—tests       – Test program and sample images.
|   |       |

|   |       +-imgs_out  – Output directory used by the test program.
|   |
|   +
—hbgd            – HBGD wrapper for gdLibrary.
|   |   |

|   |   +
—doc         – Help and license files.
|   |   |

|   |   +
—tests       – Test programs and samples.
|   |       |

|   |       +-digits    – Digits images for counter test program.
|   |       |
|   |       +-imgs_in   – Sample images.
|   |       |
|   |       +-imgs_out  – Output directory.
|   |
|   +
—hbgf            – Harbour GUI framework.
|   |   |

|   |   +
—hbgfgtk     – Implementation for GTK+ environment.
|   |   |

|   |   +
—hbgfos2     – Implementation for OS/2 Presentation Manager
|   |   |                          environment.

|   |   |
|   |   +
—hbgfwin     – Implementation for Windowns environment.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbgt            – GT library port to Harbour.
|   |   |

|   |   +
—doc         – Documents for the GT library.
|   |       |

|   |       +
—en      – English documentation.
|   |

|   +
—hbhpdf          – libHaru PDF library wrappers.
|   |   |

|   |   +
—tests       – Test programs.
|   |       |

|   |       +
—files   – Sample files for testing.
|   |

|   +
—hbmisc          – Miscellaneous contribution.
|   |   |

|   |   +
—doc         – Documents for above contribution.
|   |   |   |

|   |   |   +
—en      – English documentation.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbmsql          – Harbour mSQL access classes.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbmysql         – Harbour MySQL access classes.
|   |   |

|   |   +
—tests       – Test program.
|   |   |

|   |   +
—utils       – Converts a .dbf file into a MySQL table.
|   |

|   +
—hbmzip          – Wrapper functions for minizip library.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbnf            – Nanforum library port for Harbour.
|   |   |

|   |   +
—tests       – Test program.
|   |

|   +
—hbodbc          – ODBS Access Class Demonstration.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbpgsql         – Harbour Low Level API for Postgres RDBMS.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbsqlit3        – Interface for SQLite 3.x library.
|   |   |

|   |   +
—sqlite3     – An amalgamation of SQLite core library.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbssl           – Harbour inteface for OpenSSL API.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbtip           – TIP Class oriented Internet Protocol library.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbtpathy        – Telepathy serial communication port for Harbour.
|   |   |

|   |   +
—tests       – Test program.
|   |

|   +
—hbvpdf          – PDF library written in PRG.
|   |   |

|   |   +
—tests       – Test programs.
|   |       |

|   |       +
—files   – Sample files for testing.
|   |

|   +
—hbwhat          – What is a library for ccessing all of Windows API
|   |   |                         from PRG level.

|   |   |
|   |   +
—tests       – Test program.
|   |

|   +
—hbwin           – Collection of Windows specific utility functions.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—hbziparc        – Compatibility interface with ZipArchive general
|   |   |                         purpose compression library to work with ZIP files.

|   |   |
|   |   +
—tests       – Test programs.
|   |

|   +
—rddads          – RDD for Advantage Database Server.
|   |   |

|   |   +
—doc         – Documents for Advantage Database Server RDD.
|   |   |   |

|   |   |   +
—en      – English documentation.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—rddsql          – RDD for general SQL database with plugins.
|   |   |

|   |   +
—sddfb       – Firebird SQL database driver.
|   |   |

|   |   +
—sddmy       – MySQL database driver.
|   |   |

|   |   +
—sddpg       – Postgre SQL database driver.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—xhb          – xHarbour compatibility libarary. To allow programs
|       |                   which where written using some xHarcour extensions,

|       |                   to be complied by Harbour.
|       |
|       +
—tests       – Test programs.
|

+
—examples        – Sample files and small applications.
|   |

|   +
—dbu         – Make files (without source) for CA-Cl*pper DBU.
|   |

|   +
—guestbk     – Harbour Guests Book.
|   |

|   +
—hbdoc           – Documentation generation tool.
|   |

|   +
—hbdoc2          – Documentation generation tool.
|   |

|   +
—hbextern        – hbextern.ch generator.
|   |

|   +
—hbsqlit2    – Interface for SQLite 2.x library.
|   |   |

|   |   +
—tests   – Test programs.
|   |

|   +
—hscript     – Harbour Script.
|   |

|   +
—misc        – A few humble demonstration.
|   |

|   +
—pe          – Editor.
|   |

|   +
—pp          – Harbour Preprocessor as a standalone module.
|   |

|   +
—rddado          – ADORDD – RDD to automatically manage Microsoft ADO.
|   |   |

|   |   +
—tests       – Test programs.
|   |

|   +
—rl          – Make files (without source) for CA-Cl*pper RL.
|   |

|   +
—terminal    – Harbour terminal server/client.
|   |

|   +
—uhttpd      – uHTTPD micro web server.
|       |

|       +-home      – Root directory for the web server.
|       | |
|       | +-cgi-bin – (*)
|       | |
|       | +-css     -
|       | |
|       | +-images  -
|       | |
|       | +-js      -
|       | |
|       | +-xsl     -
|       |
|       +-logs      – Log files. (*)
|       |
|       +-modules   -
|       |
|       +-sessions  – (*)
|
+
—debian              – Packaging information for Debian GNU/Linux.
|

+
—doc                 – Documentation and white-paper.
|   |

|   +
—en              – English documentation.
|   |

|   +
—es              – Spanish documentation.
|   |

|   +
—man             – Man pages.
|

+
—include             – Include files for both Harbour and C.
|

+
—lib                 – Run-Time libraries binaries for each platform. (*)
|

+
—source              – All source files reside underneath.
|   |

|   +
—codepage        – National codepage collection.
|   |

|   +
—common          – Common function and Expression Optimizer.
|   |

|   +
—compiler        – Harbour compiler module.
|   |

|   +
—debug           – Debugger.
|   |

|   +
—hbextern        – Library with all function binding available for
|   |                              .prg code

|   |
|   +
—hbpcre          – Harbour implementation of the Perl Compatible
|   |                             Regular Expressions (PCRE) library.

|   |
|   +
—hbzlib          – Harbour implementation of the ZLIB data
|   |                           compression library.

|   |
|   +
—lang            – National language message support files.
|   |

|   +
—macro           – Macro compiler.
|   |

|   +
—main            – Harbour compiler main source.
|   |

|   +
—pp              – Harbour Preprocessor.
|   |

|   +
—rdd             – Replaceable Database Driver (RDD).
|   |   |

|   |   +
—dbfcdx      – DBFCDX RDD.
|   |   |

|   |   +
—dbffpt      – DBFFPT RDD.
|   |   |

|   |   +
—dbfnsx      – DBFNSX RDD.
|   |   |

|   |   +
—dbfntx      – DBFNTX RDD.
|   |   |

|   |   +
—hbsix       – SIX compatible functions.
|   |   |

|   |   +
—hsx         – HiPer-SEEK / CFTS compatible library.
|   |   |

|   |   +
—nulsys      – NULL RDD.
|   |   |

|   |   +
—usrrdd      – USRRDD which allows to create a new RDD at PRG level.
|   |       |

|   |       +
—example – Usage examples.
|   |       |

|   |       +
—rdds    – A set of simple RDD’s all written in PRG.
|   |

|   +
—rtl             – Run-Time libraries functions and various General
|   |   |                   Terminal (GT) implementation

|   |   |
|   |   +
—gtcgi       – GT subsystem aimed at cgi-bin applications.
|   |   |

|   |   +
—gtcrs       – GT subsystem based on ncurses.
|   |   |

|   |   +
—gtdos       – GT subsystem for DOS compilers.
|   |   |

|   |   +
—gtgui       – Minimal GT for Windows GUI programs.
|   |   |

|   |   +
—gtos2       – GT subsystem for OS/2 compilers.
|   |   |

|   |   +
—gtpca       – GT subsystem for ANSI terminals.
|   |   |

|   |   +
—gtsln       – GT subsystem based on slang.
|   |   |

|   |   +
—gtstd       – GT subsystem for plain ANSI C stream IO.
|   |   |

|   |   +
—gttrm       – GT subsystem for terminal. It does not use
|   |   |                        termcap/terminfo for terminal escape sequences,

|   |   |                       but rather hard coded ones for basic capabilities.
|   |   |
|   |   +
—gtwin       – GT subsystem for Windows compilers (Console).
|   |   |

|   |   +
—gtwvt       – GT subsystem for Windows using GUI windows instead of
|   |   |                       Console.

|   |   |
|   |   +
—gtxwc       – GT subsystem for XWindow Console.
|   |   |

|   |   +
—gt_tpl      – GT subsystem template.
|   |

|   +
—vm              – Harbour Virtual Machine and internal Run-Time
|       |                     library functions.

|       |
|       +
—mainstd     – mainstd library for MinGW build.
|       |

|       +
—mainwin     – mainwin library for MinGW build.
|       |

|       +
—vmmt        – GNU Makefile for creating the multithreaded version
|                                 of the VM library.

|
+
—tests               – Test programs.
|   |

|   +
—bldtest         – Simple C program to check if Harbour can be compiled
|   |                           on the current machine, system and C compiler.

|   |
|   +
—hbpptest        – Regression tests for the preprocessor.
|   |

|   +
—mt              – Various multithreading tests.
|   |

|   +
—multifnc        – Overloading C functions test.
|   |

|   +
—rddtest         – RDD tests.
|

+
—utils               – Utilities and tools that are part of Harbour.
    |

    +
—hbformat        – Harbour Source Formatter utility.
    |

    +
—hbi18n          – Harbour i18n .pot/.hbl file manager.
    |

    +
—hbmk2           – Harbour Make utility.
    |   |

    |   +
—examples    – Usage examples.
    |

    +
—hbrun           – Standalone Harbour Portable Object file runner,
    |                            and a "dot prompt" console for the Harbour language.

    |
    +
—hbtest          – Regression tests for the Run-Time library.

Legend:
=======
(*)      Should exist in a final build or if you build them yourself, in
          normal SVN distribution this directory is empty or does not contain
          all files.

Chen Kedem <niki@synel.co.il>

Written by MigSoft in: Harbour |

Template: mig2soft.com Harbour Code | Harbour GUI, HMG Forum