Abrir Aplicaciones Externas

2015-04-04_182346

 

2015-04-04_182326

2015-04-04_183249

 

/*
 * (c)2015 MigSoft Test Execute Functions
 *
 */

#include 'oohg.ch'

FUNCTION Main()
   Public nHdl := 0

   DEFINE WINDOW Form_1 ;
      AT 0, 0 ;
      WIDTH 600 ;
      HEIGHT 500 ;
      TITLE 'Open Applications by MigSoft' ;
      MAIN

      DEFINE STATUSBAR
         STATUSITEM 'OOHG Power !!!'
      END STATUSBAR

      @ 70, 20 BUTTON Button_1 ;
         WIDTH 180 THEMED ;
         CAPTION 'Google Chrome' ;
         ACTION AbreChrome()

      @ 100, 20 BUTTON Button_2 ;
         WIDTH 180 THEMED ;
         CAPTION 'ShellExecute' ;
         ACTION AbreProg()

      @ 130, 20 BUTTON Button_3 ;
         WIDTH 180 THEMED ;
         CAPTION 'Teclado ON' ;
         ACTION Teclado1(1)

      @ 160, 20 BUTTON Button_4 ;
         WIDTH 180 THEMED ;
         CAPTION 'Teclado OFF' ;
         ACTION Teclado1(0)

      @ 190, 20 BUTTON Button_5 ;
         WIDTH 180 THEMED ;
         CAPTION 'Calculadora ON' ;
         ACTION Calculadora(1)

      @ 220, 20 BUTTON Button_6 ;
         WIDTH 180 THEMED ;
         CAPTION 'Calculadora OFF' ;
         ACTION Calculadora(0)

      @ 250, 20 BUTTON Button_7 ;
         WIDTH 180 THEMED ;
         CAPTION 'Word' ;
         ACTION EnviaFile()

      ON KEY ESCAPE ACTION Form_1.Release()

   END WINDOW

   CENTER WINDOW Form_1
   ACTIVATE WINDOW Form_1

RETURN NIL


Function AbreChrome()

   oShell1 := CreateObject('WScript.Shell')
   oShell1:Exec ('C:\Program Files (x86)\Google\Chrome\' + ;
      'Application\chrome.exe -url http:www.mig2soft.com')

Return Nil

Function AbreProg()

   cFileName := 'C:\Program Files (x86)\Google\' + ;
                'Chrome\Application\chrome.exe'
   cParams   := '-url http:www.mig2soft.com'
   cAction   := 'open'   // 'play' , 'properties', 'PrintTo'
   ShellExecute( 0, cAction, cFileName, cParams, '', 1 )

Return Nil

Function EnviaFile()     // Change path and file
    nRes := ShellExecute( 0, 'open', ;
            'c:\Users\Usuario1\Documents\Balance de situacion.rtf')
    If nRes < 33
       MsgInfo('Error en conexión')
    Endif
Return Nil


#define WM_CLOSE                        0x0010

Function Teclado1( nOp )
   LOCAL cKeyboard := GetEnv( 'windir' ) + '\system32\osk.exe'

   If nOp = 1
      ShellExecute( 0, 'open', cKeyboard, , , 1 )
   Endif

   If nOp = 0
      //SendMessage( GetForegroundWindow(), WM_CLOSE )
      SendMessage( FindWindowEx( Nil,Nil,Nil, ;
            'On-Screen Keyboard' ) , WM_CLOSE )
      SendMessage( FindWindowEx( Nil,Nil,Nil, ;
            'Teclado en Pantalla' ), WM_CLOSE )

   Endif

Return Nil

Function Calculadora( nOp )
   If nOp = 1
      ShellExecute( 0, 'open', 'calc' )
   Endif

   If nOp = 0
      SendMessage( FindWindowEx( Nil,Nil,Nil, ;
                  'Calculator' ), WM_CLOSE )
      SendMessage( FindWindowEx( Nil,Nil,Nil, ;
                 'Calculadora' ), WM_CLOSE )
   Endif

Return Nil

 

MyBrowse

Este código es el prototipo de DBVIEW.

Posteriormente gracias a Grigory Filatov, se le fueron incorporando nuevas características.

/*
 * MINIGUI - Harbour Win32 GUI library
 * Copyright 2002-2009 Roberto Lopez <[email protected]>
 * http://harbourminigui.googlepages.com/
 *
 * Example to view DBF files using standard Browse control
 * Copyright 2009 MigSoft <mig2soft/at/yahoo.com>
 *
 * Enhanced by Grigory Filatov <[email protected]>
 * Last Revised 18/09/2014
 */

#include "minigui.ch"

STATIC cExpress := ''

Function Main()

   Local cBaseFolder, aTypes, aNewFiles
   Local nCamp, aEst, aNomb, aJust, aLong, aFtype, i

   // Set default language to English
   HB_LANGSELECT( "EN" )

   // Set default language to Portuguese
   //SET LANGUAGE TO PORTUGUESE

   SET CENTURY ON
   SET EPOCH TO YEAR(DATE())-20
   SET DATE TO BRITISH

   cBaseFolder := GetStartupFolder()

   aTypes    := { {'Database files (*.dbf)', '*.dbf'} }
   aNewFiles := GetFile( aTypes, 'Select database files', cBaseFolder, TRUE )

   IF !Empty(aNewFiles)

      Use (aNewFiles[1]) Shared New

      nCamp := Fcount()
      aEst  := DBstruct()

      aNomb := {'iif(deleted(),0,1)'} ; aJust := {0} ; aLong := {0} ; aFtype := {}

      For i := 1 to nCamp
          aadd(aNomb,aEst[i,1])
          aadd(aFtype, aEst[i,2])
          aadd(aJust,LtoN(aEst[i,2]=='N'))
          aadd(aLong,Max(100,Min(160,aEst[i,3]*14)))
      Next

      CreaBrowse( Alias(), aNomb, aLong, aJust, aFtype )

   Endif

Return Nil

//----------------------------------------------------------------------------//

Function CreaBrowse( cBase, aNomb, aLong, aJust, aFtype )

    Local nAltoPantalla  := GetDesktopHeight() + GetTitleHeight() + GetBorderHeight()
    Local nAnchoPantalla := GetDesktopWidth()
    Local nRow           := nAltoPantalla  * 0.10
    Local nCol           := nAnchoPantalla * 0.10
    Local nWidth         := nAnchoPantalla * 0.95
    Local nHeight        := nAltoPantalla  * 0.85
    Local aHdr           := aClone(aNomb)
    Local aCabImg        := aClone(VerHeadIcon(aFtype))

    aHdr[1] := Nil

    SET DEFAULT ICON TO "MAIN"

    DEFINE WINDOW oWndBase AT nRow , nCol ;
      WIDTH nWidth HEIGHT nHeight ;
      TITLE "(c)2009 MigSoft - View DBF files" ;
      MAIN ;
      ON SIZE Adjust() ON MAXIMIZE Adjust()

      DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 90,32 FONT "Arial" SIZE 9 FLAT RIGHTTEXT
        BUTTON Cerrar    CAPTION _HMG_aABMLangButton[1]  PICTURE "MINIGUI_EDIT_CLOSE" ;
                         ACTION oWndBase.Release               AUTOSIZE
        BUTTON Nuevo     CAPTION _HMG_aABMLangButton[2]  PICTURE "MINIGUI_EDIT_NEW"   ;
                         ACTION Append()                       AUTOSIZE
        BUTTON Modificar CAPTION _HMG_aABMLangButton[3]  PICTURE "MINIGUI_EDIT_EDIT"  ;
                         ACTION Edit()                         AUTOSIZE
        BUTTON Eliminar  CAPTION _HMG_aABMLangButton[4]  PICTURE "MINIGUI_EDIT_DELETE";
                         ACTION DeleteOrRecall()               AUTOSIZE
        BUTTON Buscar    CAPTION _HMG_aABMLangButton[5]  PICTURE "MINIGUI_EDIT_FIND"  ;
                         ACTION MyFind()                       AUTOSIZE
        BUTTON Imprimir  CAPTION _HMG_aABMLangButton[16] PICTURE "MINIGUI_EDIT_PRINT" ;
                         ACTION printlist(cBase, aNomb, aLong) AUTOSIZE
      END TOOLBAR

      DEFINE BROWSE Browse_1
        ROW    45
        COL    20
        WIDTH  oWndBase.width  - 40
        HEIGHT oWndBase.height - 95
        VALUE 0
        WIDTHS aLong
        HEADERS aHdr
        HEADERIMAGE aCabImg
        WORKAREA &cBase
        FIELDS aNomb
        JUSTIFY aJust
        IMAGE { "br_no", "br_ok" }
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        LOCK .T.
        ALLOWEDIT .T.
        INPLACEEDIT .T.
        ALLOWDELETE .T.
        ALLOWAPPEND .T.
        ONHEADCLICK Nil
      END BROWSE

    END WINDOW

    Aeval( aHdr, {|x,i| oWndBase.Browse_1.HeaderImage(i) := {i,(aJust[i]==1)}} )

    oWndBase.Browse_1.ColumnWidth(1) := 21

    oWndBase.Center
    oWndBase.Activate

Return Nil

//----------------------------------------------------------------------------//

Function VerHeadIcon( aType )

   Local aFtype, cType, n
   Local aHeadIcon := {"hdel"}
   aFtype := aClone( aType )

   For n := 1 to FCount()
       cType := aFtype[n]
       Switch cType
          Case 'L'
               aadd(aHeadIcon,"hlogic")
               exit
          Case 'D'
               aadd(aHeadIcon,"hfech")
               exit
          Case 'N'
               aadd(aHeadIcon,"hnum")
               exit
          Case 'C'
               aadd(aHeadIcon,"hchar")
               exit
          Case 'M'
               aadd(aHeadIcon,"hmemo")
       End
   Next

Return(aHeadIcon)

//----------------------------------------------------------------------------//

Procedure Adjust()
   oWndBase.Browse_1.Width  := oWndBase.width  - 40
   oWndBase.Browse_1.Height := oWndBase.height - 95
Return

//----------------------------------------------------------------------------//

Procedure Append()
   Local i := GetControlIndex ( "Browse_1", "oWndBase" )

   ( Alias() )->( DbAppend() )

   if !NetErr()

      oWndBase.Browse_1.Value := ( Alias() )->( RecNo() )

      _BrowseEdit ( _HMG_acontrolhandles[i] , _HMG_acontrolmiscdata1 [i] [4] , ;
      _HMG_acontrolmiscdata1 [i] [5] , _HMG_acontrolmiscdata1 [i] [3] , ;
      _HMG_aControlInputMask [i] , .f. , .f. )

   EndIf

   oWndBase.Browse_1.SetFocus

Return

//----------------------------------------------------------------------------//

Procedure Edit()
   Local i := GetControlIndex ( "Browse_1", "oWndBase" )

   ( Alias() )->( DbGoto(oWndBase.Browse_1.Value) )

   _BrowseEdit ( _HMG_acontrolhandles[i] , _HMG_acontrolmiscdata1 [i] [4] , ;
   _HMG_acontrolmiscdata1 [i] [5] , _HMG_acontrolmiscdata1 [i] [3] , ;
   _HMG_aControlInputMask [i] , .f. , .f. )

   oWndBase.Browse_1.SetFocus

Return

//----------------------------------------------------------------------------//

Procedure DeleteOrRecall()

   ( Alias() )->( DbGoto(oWndBase.Browse_1.Value) )

   if ( Alias() )->( Rlock() )
      iif( ( Alias() )->( Deleted() ), ( Alias() )->( DbRecall() ), ( Alias() )->( DbDelete() ) )
   endif
   ( Alias() )->( dbUnlock() )

   oWndBase.Browse_1.Refresh
   oWndBase.Browse_1.SetFocus

Return

//----------------------------------------------------------------------------//

Procedure printlist(cBase, aNomb, aLong)
    Local aHdr := aClone(aNomb)
    Local aLen := aClone(aLong)
    Local aHdr1
    Local aTot
    Local aFmt

  aeval(aLen, {|e,i| aLen[i] := e/9})
  adel(aLen, 1)
  asize(aLen, len(aLen)-1)
  adel(aHdr, 1)
  asize(aHdr, len(aHdr)-1)
  adel(aHdr, len(aHdr))
  asize(aHdr, len(aHdr)-1)
  aHdr1 := array(len(aHdr))
  aTot := array(len(aHdr))
  aFmt := array(len(aHdr))
  afill(aHdr1, '')
  afill(aTot, .f.)
  afill(aFmt, '')
//	aFmt[9]  := '999'
//	aFmt[10] := '@E 999,999'

  set deleted on

  ( cBase )->( dbgotop() )

  DO REPORT ;
    TITLE  cBase + ' Database List'						;
    HEADERS  aHdr1, aHdr							;
    FIELDS   aHdr								;
    WIDTHS   aLen								;
    TOTALS   aTot								;
    NFORMATS aFmt				                     		;
    WORKAREA &cBase								;
    LMARGIN  3								;
    TMARGIN  3								;
    PAPERSIZE DMPAPER_A4 							;
    PREVIEW

  set deleted off

Return

//----------------------------------------------------------------------------//

Procedure MyFind()
   Local cExpErr, nCurRec

   cExpress := InputBox( "Enter a Search Expression :", "Find", cExpress )

   IF ! Empty( cExpress )

      cExpErr := Exp1Chek( cExpress )

      IF Empty( cExpErr ) .AND. .NOT. "U" $ TYPE( cExpress )

         ( Alias() )->( DbGoto( oWndBase.Browse_1.Value ) )
         nCurRec := ( Alias() )->( RecNo() )

         LOCATE FOR &cExpress REST

         IF ( Alias() )->( Eof() )
            ( Alias() )->( DbGoto( nCurRec ) )
         ENDIF

         oWndBase.Browse_1.Value := ( Alias() )->( RecNo() )
         oWndBase.Browse_1.Refresh

      ELSE

         MsgStop( "Invalid expression : " + cExpErr, "Warning" )

      ENDIF

   ENDIF

   oWndBase.Browse_1.SetFocus

Return

//----------------------------------------------------------------------------//

/*
   f.Exp1Chek( <cSingleExpression> ) => <cResult>

   Copyright 2008-2010 © Bicahi Esgici <[email protected]>
*/
FUNCTION Exp1Chek( ;                // Syntax Checking on a single expression
                 c1Exprsn )

   LOCAL cRVal   := '',;
         c1Char  := '',;
         c1Atom  := '',;
         cDelmt  := ',',;
         nPnter  := 0,;
         cBPrnts := "([{'" + '"',;  // Parenthesis Begin
         cEPrnts := ")]}'" + '"',;  // Parenthesis End
         cOprtrs := "+-/*,@$&!<>=#",;
         cVoidEs := '"(' + "'",;
         c1stChr := '',;
         aLogics := { "AND", "OR", "NOT"  },;
         aBrackts := { 0, 0, 0, 0, 0 },;
         nBracket := 0

   LOCAL cTermtors := cBPrnts + cEPrnts + cOprtrs + ". ",;
         nAInd := 0,;
         c1ExpSav := c1Exprsn

   c1Exprsn := STRTRAN( c1Exprsn,' ', '' )  // Is this NoP ?

   WHILE nPnter < LEN( c1Exprsn )

      c1Char := SUBS( c1Exprsn, ++nPnter, 1 )

      IF ISALPHA( c1Char ) .OR. ( !EMPTY( c1Atom ) .AND. c1Char == "_" )
         IF EMPTY( c1Atom ) .AND. nPnter > 1
            c1stChr := SUBS( c1Exprsn, nPnter -1, 1 )
         ENDIF
         c1Atom += c1Char
      ELSE
         IF ISDIGIT( c1Char )
            c1Atom += IF( EMPTY( c1Atom ), '', c1Char )
         ELSE
            IF c1Char $ cTermtors
               IF c1Char == "." .AND. c1stChr == "."
                  IF ( ASCAN( aLogics, UPPE( SubStrng2( c1Exprsn, nPnter-3, nPnter-1 ))) > 0 .OR. ;
                       ASCAN( aLogics, UPPE( SubStrng2( c1Exprsn, nPnter-2, nPnter-1 ))) > 0 )
                     c1Atom := ''
                     c1stChr := ''
                  ENDIF ASCAN( ...
               ENDIF c1Char == "."
               IF !EMPTY( c1Atom ) .AND. !c1Char $ cVoidEs
                  IF "U" $ TYPE( c1Atom  )
                     cRVal := c1Atom
                     EXIT
                  ENDIF
               ENDIF
               c1Atom  := ''
               c1stChr := ''
               IF c1Char $ cBPrnts .OR. c1Char $ cEPrnts
                  IF c1Char $ cBPrnts
                     nBracket := AT( c1Char, cBPrnts )
                     IF nBracket > 3
                        IF aBrackts[ nBracket ] > 0
                           --aBrackts[ nBracket ]
                        ELSE
                           ++aBrackts[ nBracket ]
                        ENDIF
                     ELSE
                        ++aBrackts[ nBracket ]
                     ENDIF nBracket > 3
                  ELSE // c1Char $ cEPrnts
                     nBracket := AT( c1Char, cEPrnts )
                     IF nBracket > 3
                        IF aBrackts[ nBracket ] > 0
                           --aBrackts[ nBracket ]
                        ELSE
                           ++aBrackts[ nBracket ]
                        ENDIF
                     ELSE
                        --aBrackts[ nBracket ]
                     ENDIF nBracket > 3
                  ENDIF c1Char $ cBPrnts
               ENDIF c1Char $ cBPrnts .OR. c1Char $ cEPrnts
            ENDIF c1Char $ cTermtors
         ENDIF ISDIGIT( c1Char )
      ENDIF ISALPHA( c1Char )
   ENDDO  nPnter < LEN( c1Exprsn )

   IF ASCAN( aBrackts, { | n1 | n1 # 0 } ) > 0
      cRVal := c1ExpSav
   ENDIF

   IF !EMPTY( c1Atom ) .AND. EMPTY( cRVal )
      IF "U" $ TYPE( c1Atom )
         cRVal := c1Atom
      ENDIF
   ENDIF

RETURN cRVal // Exp1Chek()

//----------------------------------------------------------------------------//

FUNCTION SubStrng2( ;             // Sub String defined two position
                cString,;
                nBegPos,;
                nEndPos )

   LOCAL cRVal

   cRVal := SUBSTR( cString,  nBegPos, nEndPos - nBegPos + 1 )

RETURN cRVal // SubStrng2()


2015-05-23_203009
2015-05-23_203028
2015-05-23_203047 2015-05-23_203135

FastFind

Ejemplo que realiza una búsqueda rápida en un Grid.

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2002-06 Roberto Lopez <[email protected]>
 * http://harbourminigui.googlepages.com/
 *
 * Based on sample provided by Honorio and modified by Jacek Kubica
 * Adapted by MigSoft for Harbour MiniGUI IDE
*/

#include <minigui.ch>

 Procedure Main()

   Set Multiple Off Warning

   Use Cuentas
   Index On field->nombre To cuentas

   Load window Win_1
   Center window Win_1
   Win_1.Text_1.Setfocus
   Activate window Win_1

Return
*--------------------------------------------------------------*
Function Captura()
*--------------------------------------------------------------*
   Local cCapt       := Upper(AllTrim(win_1.Text_1.value))
   Local nTaman      := Len(cCapt)
   Local nRegProc    := 0
   Local nMaxRegGrid := 70
   Memvar cCampo
   Private cCampo    := "NOMBRE"

   DBSELECTAREA("Cuentas")
   DBSeek(cCapt)

   win_1.Grid_1.DisableUpdate
   DELETE ITEM ALL FROM Grid_1 OF Win_1

   Do While !EOF()
      If Substr(FIELD->&cCampo,1,nTaman) == cCapt
         nRegProc += 1
         If nRegProc > nMaxRegGrid
            EXIT
         Endif
         ADD ITEM { TRANSF(Cuentas->Imputacion,"9999999") , ;
                           Cuentas->Nombre } TO Grid_1 of Win_1
      ElseIf Substr(FIELD->&cCampo,1,nTaman) > cCapt
         EXIT
      Endif
      DBSkip()
   Enddo
   win_1.Grid_1.EnableUpdate
Return NIL
*--------------------------------------------------------------*
Procedure VerItem()
*--------------------------------------------------------------*
   MsgInfo( 'Col 1: ' + GetColValue( "Grid_1", "Win_1", 1 )+'  ';
          + 'Col 2: ' + GetColValue( "Grid_1", "Win_1", 2 ) )
Return
*--------------------------------------------------------------*
Function GetColValue( xObj, xForm, nCol )
*--------------------------------------------------------------*
  Local nPos:= GetProperty(xForm, xObj, 'Value')
  Local aRet:= GetProperty(xForm, xObj, 'Item', nPos)
Return aRet[nCol]
*--------------------------------------------------------------*
Function SetColValue( xObj, xForm, nCol, xValue )
*--------------------------------------------------------------*
  Local nPos:= GetProperty(xForm, xObj, 'Value')
  Local aRet:= GetProperty(xForm, xObj, 'Item', nPos)
      aRet[nCol] := xValue
      SetProperty(xForm, xObj, 'Item', nPos, aRet)
Return NIL

2015-05-23_200632
2015-05-23_200649

BaseGraph

Ejemplo que permite trabajar con la información de una base de datos y la presenta en pantalla a través de gráficos.

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2002-05 Roberto Lopez <[email protected]>
 * http://harbourminigui.googlepages.com/
 *
 * Copyright 2007 MigSoft <[email protected]>
*/

#include "minigui.ch"

#define AZUL		{   0 , 128 , 192  }
#define CELESTE		{   0 , 128 , 255  }
#define VERDE		{   0 , 128 , 128  }
#define CAFE		{ 128 , 64  ,   0  }

Static aYvalAll   := { "Ene", "Feb", "Mar", "Abr", "May", "Jun", ;
                       "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"  }
Static aYval1er   := { "Ene", "Feb", "Mar", "Abr", "May", "Jun" }
Static aYval2do   := { "Jul", "Ago", "Sep", "Oct", "Nov", "Dic" }

Static aSerieNames

Procedure Main
local aClr := { RED,YELLOW,AZUL,ORANGE,VERDE,FUCHSIA,GREEN,CAFE, ;
                BLUE,BROWN,PINK,PURPLE, BLACK, WHITE, GRAY       }
local n := 1, cNombre, m
local nReg, aColor, aColor1, aSer, aSer1, aSer2

   USE SALDOMES

   nReg        := RecCount()
   aColor      := array(nReg)
   aColor1     := array(nReg)
   aSerieNames := array(nReg)
   aSer        := array(nReg,12)
   aSer1       := array(nReg,6)
   aSer2       := array(nReg,6)

   do while ! saldomes->(eof())
      cNombre        := lower(saldomes->Banco)
      aSerieNames[n] := cNombre
      aSer[n,1] := saldomes->enero      ; aSer[n,2] := saldomes->febrero
      aSer[n,3] := saldomes->marzo      ; aSer[n,4] := saldomes->abril
      aSer[n,5] := saldomes->mayo       ; aSer[n,6] := saldomes->junio
      aSer[n,7] := saldomes->julio      ; aSer[n,8] := saldomes->agosto
      aSer[n,9] := saldomes->septiembre ; aSer[n,10]:= saldomes->octubre
      aSer[n,11]:= saldomes->noviembre  ; aSer[n,12]:= saldomes->diciembre
      aColor[n] := aClr[n]
      skip
      n++
   enddo

   For n = 1 to nReg
       For m = 1 to 6
           aSer1[n,m] := aSer[n,m]
           aSer2[n,m] := aSer[n,m+6]
       Next
       aColor1[n]      := aClr[n]
   Next

   Define Window GraphTest ;
    At 0,0 ;
    Width 720 ;
    Height 480 ;
    Title "Graph Demo by MigSoft" ;
    Main ;
    Icon "Graph.ico" ;
    nomaximize nosize ;
    On Init DrawBarGraph(aSer,aYvalAll,aColor)

    Define Button Button_1
    Row	405
    Col	40
    Caption	'1er Semestre'
    Action DrawBarGraph(aSer1,aYval1er,aColor1)
    End Button

    Define Button Button_2
    Row	405
    Col	180
    Caption	'2do Semestre'
    Action DrawBarGraph(aSer2,aYval2do,aColor1)
    End Button

    Define Button Button_3
    Row	405
    Col	320
    Caption	'Lineas'
    Action DrawLinesGraph(aSer,aYvalAll,aColor)
    End Button

    Define Button Button_4
    Row	405
    Col	460
    Caption	'Puntos'
    Action DrawPointsGraph(aSer,aYvalAll,aColor)
    End Button

    On Key ESCAPE Action ThisWindow.Release

   End Window

   GraphTest.Center
   Activate Window GraphTest

Return

Procedure DrawBarGraph(paSer,paYval,paCol)

   ERASE WINDOW GraphTest

   DRAW GRAPH IN WINDOW GraphTest           ;
          AT 20,20                          ;
          TO 400,700                        ;
    TITLE "Saldo por Banco"           ;
    TYPE BARS                         ;
    SERIES paSer                      ;
    YVALUES paYval                    ;
    DEPTH 15                          ;
    BARWIDTH 15                       ;
    HVALUES 5                         ;
    SERIENAMES aSerieNames            ;
    COLORS paCol                      ;
    3DVIEW                            ;
    SHOWGRID                          ;
    SHOWXVALUES                       ;
    SHOWYVALUES                       ;
    SHOWLEGENDS                       ;
          DATAMASK "$99,999"

Return

Procedure DrawLinesGraph(paSer,paYval,paCol)

   ERASE WINDOW GraphTest

   DRAW GRAPH IN WINDOW GraphTest           ;
    AT 20,20                          ;
    TO 400,700                        ;
    TITLE "Saldo por Banco"           ;
    TYPE LINES                        ;
    SERIES paSer                      ;
    YVALUES paYval                    ;
    DEPTH 15                          ;
    BARWIDTH 15                       ;
    HVALUES 5                         ;
    SERIENAMES aSerieNames            ;
    COLORS paCol                      ;
    3DVIEW                            ;
    SHOWGRID                          ;
    SHOWXVALUES                       ;
    SHOWYVALUES                       ;
    SHOWLEGENDS                       ;
          DATAMASK "$99,999"

Return

Procedure DrawPointsGraph(paSer,paYval,paCol)

   ERASE WINDOW GraphTest

   DRAW GRAPH IN WINDOW GraphTest           ;
   	  AT 20,20                          ;
    TO 400,700                        ;
          TITLE "Saldo por Banco"           ;
    TYPE POINTS                       ;
    SERIES paSer                      ;
    YVALUES paYval                    ;
    DEPTH 15                          ;
    BARWIDTH 15                       ;
    HVALUES 5                         ;
    SERIENAMES aSerieNames            ;
    COLORS paCol                      ;
    3DVIEW                            ;
    SHOWGRID                          ;
    SHOWXVALUES                       ;
    SHOWYVALUES                       ;
    SHOWLEGENDS                       ;
          DATAMASK "$99,999"

Return

2015-05-23_195235
2015-05-23_195259
2015-05-23_195313

Histogram

Ejemplo que desarrollé en 2006 para trabajar con gráficos, gracias a los amigos de MiniGUI Extended por que lo incluyen en su distribución oficial desde entonces. MiniGUI Extended

 

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2002-05 Roberto Lopez <[email protected]>
 * http://harbourminigui.googlepages.com/
 *
 * Copyright 2006 MigSoft <[email protected]>
*/

#include <minigui.ch>

Static aSer, aClr, aSern, aYVal, cTit

Function Main
   Set Navigation extended
   Load Window Grafico
   Center Window Grafico
   Activate Window Grafico
Return Nil

*-----------------------------------------------------------------------------*
Procedure Presenta(nTipo)
*-----------------------------------------------------------------------------*
   Do Case
      Case nTipo = 0       //  Histogram

           aSer:= {{Grafico.Text_5.value,Grafico.Text_9.value,Grafico.Text_13.value}, ;
                   {Grafico.Text_6.value,Grafico.Text_10.value,Grafico.Text_14.value},;
                   {Grafico.Text_7.value,Grafico.Text_11.value,Grafico.Text_15.value},;
                   {Grafico.Text_8.value,Grafico.Text_12.value,Grafico.Text_16.value} }

           aClr:= {Grafico.Label_5.Fontcolor,Grafico.Label_6.Fontcolor, ;
                   Grafico.Label_7.Fontcolor,Grafico.Label_8.Fontcolor}

           aSern:={Grafico.Text_1.value,Grafico.Text_2.value, ;
                   Grafico.Text_3.value,Grafico.Text_4.value }

           aYVal:={Grafico.Text_17.value,Grafico.Text_18.value,Grafico.Text_19.value }

           cTit:= Grafico.Text_20.value

           Load Window Veamos
           Center Window Veamos
           Activate Window Veamos

      Case nTipo = 1       //  Pie 1

           cTit:= Grafico.Text_1.value
           aSer:= {Grafico.Text_5.value,Grafico.Text_9.value,Grafico.Text_13.value}

      Case nTipo = 2       //  Pie 2

           cTit:= Grafico.Text_2.value
           aSer:= {Grafico.Text_6.value,Grafico.Text_10.value,Grafico.Text_14.value}

      Case nTipo = 3       //  Pie 3

           cTit:= Grafico.Text_3.value
           aSer:= {Grafico.Text_7.value,Grafico.Text_11.value,Grafico.Text_15.value}

      Case nTipo = 4       //  Pie 4

           cTit:= Grafico.Text_4.value
           aSer:= {Grafico.Text_8.value,Grafico.Text_12.value,Grafico.Text_16.value}

      Case nTipo = 5       //  Pie 5

           cTit:= Grafico.Text_17.value
           aSer:= {Grafico.Text_5.value,Grafico.Text_6.value,;
                   Grafico.Text_7.value,Grafico.Text_8.value }

      Case nTipo = 6       //  Pie 6

           cTit:= Grafico.Text_18.value
           aSer:= {Grafico.Text_9.value ,Grafico.Text_10.value,;
                   Grafico.Text_11.value,Grafico.Text_12.value }

      Case nTipo = 7       //  Pie 7

           cTit:= Grafico.Text_19.value
           aSer:= {Grafico.Text_13.value,Grafico.Text_14.value,;
                   Grafico.Text_15.value,Grafico.Text_16.value }

   EndCase

   If nTipo > 0 .and. nTipo < 8
      IF nTipo < 5
         aYVal:={Grafico.Text_17.value,Grafico.Text_18.value,Grafico.Text_19.value}
         aClr:= {Grafico.Label_3.Fontcolor,Grafico.Label_4.Fontcolor, ;
                                           Grafico.Label_11.Fontcolor }
      Else
          aYVal:={Grafico.Text_1.value,Grafico.Text_2.value,;
                  Grafico.Text_3.value,Grafico.Text_4.value }
          aClr:= {Grafico.Label_5.Fontcolor,Grafico.Label_6.Fontcolor,;
                  Grafico.Label_7.Fontcolor,Grafico.Label_8.Fontcolor }
      Endif
      Load Window Veamos2
      Center Window Veamos2
      Activate Window Veamos2
   Endif

Return
*-----------------------------------------------------------------------------*
Procedure elGrafico()
*-----------------------------------------------------------------------------*

  ERASE WINDOW Veamos

  DRAW GRAPH							;
    IN WINDOW Veamos                                        ;
    AT 20,20						;
    TO 400,610						;
    TITLE cTit                                              ;
    TYPE BARS						;
    SERIES aSer                                             ;
  		YVALUES aYval                                           ;
    DEPTH 15						;
    BARWIDTH 15						;
    HVALUES 5						;
    SERIENAMES aSern                                        ;
    COLORS aClr                                             ;
    3DVIEW    						;
    SHOWGRID                        			;
    SHOWXVALUES                     			;
    SHOWYVALUES                     			;
    SHOWLEGENDS 						;
    NOBORDER

Return
*-----------------------------------------------------------------------------*
Procedure PieGraph()
*-----------------------------------------------------------------------------*

   ERASE Window Veamos2

   DRAW GRAPH IN WINDOW Veamos2 AT 20,20 TO 400,610	;
        TITLE cTit TYPE PIE				;
        SERIES aSer					;
        DEPTH 15					;
        SERIENAMES aYVal				;
        COLORS aClr					;
        3DVIEW						;
        SHOWXVALUES					;
        SHOWLEGENDS					;
  NOBORDER

Return

 

2015-05-23_191804
2015-05-23_192318
2015-05-23_192657
2015-05-23_192615

Herramienta MySQL Mejorada

Sigo mejorando la herramienta, ahora permite exportar tablas MySQL a los siguientes formatos: DBF, XLSX, DOCX, HTML, TXT y SQL, también es posible importar una base de datos DBF, si alguna tabla MySQL esta sobrando se puede eliminar directamente.

Si alguien esta interesado en hacer pruebas con “MySQL Info” solo tiene que enviarme un correo a [email protected] solicitando la herramienta, con mucho gusto le indicaré el enlace de descarga.

2015-05-17_180102

Herramienta para MySQL

Adapté una herramienta de Cristobal Molla, para observar bases de datos MySQL, ahora se puede editar tablas, imprimir algunos campos, y realizar consultas en tiempo real.

2015-05-10_183140

El primer paso es conectar con el servidor que puede ser local o remoto (IP del servidor, siempre y cuando esté habilitada esa función en cPanel o por el administrador de hosting)

2015-05-10_183222
Se encenderá la luz verde al lograr la conexión con éxito.

2015-05-10_183248
Ahora ya podemos dar una mirada general del contenido del servidor, cuantas bases de datos, que tablas tiene cada una de ellas, la estructura de cada tabla, el contenido, además de editar las tablas sobre las cuales tenemos privilegios para hacerlo,

2015-05-10_183324

2015-05-10_183419
2015-05-10_183454
Al seleccionar Editar, aparece la siguiente pantalla, donde se puede navegar en la tabla, modificar, dar de alta nuevos registros, eliminar, realizar búsquedas por uno o varios campos.
2015-05-10_183529

También se puede imprimir información de algunos campos.

2015-05-10_183652

Aquí se puede realizar consultas en tiempo real.

2015-05-10_183834

Se utilizan como recursos las librerías OOHG, TDolphin y Harbour como compilador principal.

2015-05-10_183859

2015-05-10_183928

 

Ver contenido de las variables (Display Memory)

2015-04-04_122820

 

#include "oohg.ch"

Function DispMem()

    Save to MigMem All
    ReadMem( "MigMem.mem" )
    cArquivo := "MigMemory.txt"
    Editor   := "Notepad"

    EXECUTE FILE Editor PARAMETERS cArquivo

Return Nil

Procedure READMEM( cFileName )
    local x
    local aMemVars  := {}
    local nLine     := 0

    SET PRINTER TO MigMemory.txt
    SET DEVICE TO PRINTER

    @  1, 1 say PADC( "Display Memory", 79 )

    Do while .T.
        aMemVars := GETVARFROM( cFileName )
        @  3,  5 say "Name"
        @  3, 18 say "Type"
        @  3, 23 say "Value"
        @  3, 60 say "File: MigMemory.txt"
        nLine := 4
        For x := 1 to len( aMemVars )
            ++ nLine
            @ nLine,  5 say aMemVars[ x, 1 ]
            @ nLine, 18 say aMemVars[ x, 2 ]
            @ nLine, 23 say aMemVars[ x, 3 ]
        Next
        Exit
    Enddo

    SET PRINTER TO
    SET DEVICE TO SCREEN

Return


Function GETVARFROM( cMemFile )

    local xVarValue    := NIL
    local nHandle
    local nFilePoint
    local cMemBuff
    local cVarName
    local cID
    local nSize
    local nLen
    local cBuffer
    local cData
    local nHi
    local nLo
    local lFlag
    local nB1
    local nB2
    local nB3
    local nB4
    local nTotal
    local nOutput
    local nValue
    local aMemVar
    local aMemVarArray := {}

    if valtype( cMemFile ) = "C" .and. file( cMemFile )
        nHandle    := fopen( cMemFile )
        nFilePoint := fseek( nHandle, 0, 2 )
        fseek( nHandle, 0 )
        if nFilePoint > 1
            xVarValue := ""
            do while fseek( nHandle, 0, 1 ) + 1 < nFilePoint .and. !FEOF( nHandle )
                cMemBuff := space( 18 )
                fread( nHandle, @cMemBuff, 18 )
                cVarName := left( cMemBuff, at( chr( 0 ), cMemBuff ) - 1 )
                cID      := substr( cMemBuff, 12, 1 )
                nSize    := bin2w( right( cMemBuff, 2 ) )
                nLen     := if( cID $ "ÃÌ", 14 + nSize, 22 )
                cBuffer  := space( nLen )
                fread( nHandle, @cBuffer, nLen )
                cData := substr( cBuffer, 15 )
                if cID == chr( 195 )                // character
                    aMemVar   := { cVarName, "C", cData }
                    xVarValue := cData
                elseif cID == chr( 204 )            // logic
                    aMemVar   := { cVarName, "L", asc( cData ) == 1 }
                    xVarValue := asc( cData ) == 1
                elseif cID == chr( 206 )            // Numeric
                    cBuffer   := substr( cBuffer, 15 )
                    nHi       := MODULUS( asc( substr( cBuffer, 8, 1 ) ), 128 ) * 16
                    nLo       := int( asc( substr( cBuffer, 7, 1 ) ) / 16 )
                    nValue    := nHi + nLo - 1023
                    lFlag     := int( asc( substr( cBuffer, 8, 1 ) ) / 16 ) >= 8
                    nB1       := MODULUS( asc( substr( cBuffer, 7, 1 ) ), 16 ) / 16
                    nB2       := bin2w( substr( cBuffer, 5, 2 ) ) / ( 65536 * 16 )
                    nB3       := bin2w( substr( cBuffer, 3, 2 ) ) / ( 65536 * 65536 * 16 )
                    nB4       := bin2w( substr( cBuffer, 1, 2 ) ) / ;
                                   ( 65536 * 65536 * 65536 * 16 )
                    nTotal    := nB1 + nB2 + nB3 + nB4
                    nOutput   := if( lFlag, - ( 1 + nTotal ) * 2 ^ nValue, ;
                                   ( 1 + nTotal ) * 2 ^ nValue )
                    xVarValue := val( transform( nOutput, "@B" ) )
                    aMemVar := { cVarName, "N", xVarValue }
                elseif cID == chr( 196 )            // Date
                    cBuffer   := substr( cBuffer, 15 )
                    nHi       := MODULUS( asc( substr( cBuffer, 8, 1 ) ), 128 ) * 16
                    nLo       := int( asc( substr( cBuffer, 7, 1 ) ) / 16 )
                    nValue    := nHi + nLo - 1023
                    lFlag     := int( asc( substr( cBuffer, 8, 1 ) ) / 16 ) >= 8
                    nB1       := MODULUS( asc( substr( cBuffer, 7, 1 ) ), 16 ) / 16
                    nB2       := bin2w( substr( cBuffer, 5, 2 ) ) / ( 65536 * 16 )
                    nB3       := bin2w( substr( cBuffer, 3, 2 ) ) / ( 65536 * 65536 * 16 )
                    nB4       := bin2w( substr( cBuffer, 1, 2 ) ) / ;
                                   ( 65536 * 65536 * 65536 * 16 )
                    nTotal    := nB1 + nB2 + nB3 + nB4
                    nOutput   := if( lFlag, - ( 1 + nTotal ) * 2 ^ nValue, ;
                                   ( 1 + nTotal ) * 2 ^ nValue )
                    xVarValue := dtoc( ctod( "01/01/0100" ) + nOutput - 1757585 )
                    aMemVar := { cVarName, "D", xVarValue }
                endif
                aadd( aMemVarArray, aMemVar )
            enddo
        endif
        fclose( nHandle )
    endif

Return aMemVarArray


Function FEOF( nHandle )

    local nCurrPos
    local nFileSize

    nCurrPos  := fseek( nHandle, 0, 1 )
    nFileSize := fseek( nHandle, 0, 2 )
    fseek( nHandle, nCurrPos, 0 )

Return nFileSize < nCurrPos


Function MODULUS( nParm1, nParm2 )

    local x
    local nRetVal := 0

    if valtype( nParm1 ) = "N" .and. valtype( nParm2 ) = "N"
        if nParm2 = 0
            nRetVal := nParm1
        else
            x       := nParm1 % nParm2
            nRetVal := if( x * nParm2 < 0, x + nParm2, x )
        endif
    endif

Return nRetVal