Debug facility
Previous topic  First topic  Next topic


Marinas-IDE has two ways to tell which of the sources of our system will use the DEBUG Harbour.
Marinas-IDE posee dos formas de indicarle cual de los sources de nuestro sistema van a utilizar el DEBUG de Harbour.

1.- With the option "Enable/Disable all Modules Debug" of Debug/Trace menu
1.- Mediante la opcion "Enable/Disable Debug all Modules" del menu Debug/Trace

2.- Using the DEBUG Sources tab button
2.- Mediante el boton DEBUG de la pestaña Sources

The difference is that the first option enables or disables the Debug for all modules of our program, while the second option works only on the source positioned, in this way, we can enable or disable the Debug for a particular module.
La diferencia radica en que la primera opcion activa o desactiva el Debug para todos los modulos de nuestro programa, en cambio la segunda opcion trabaja sobre el source posicionado unicamente, de este modo, podemos activar o desactivar el Debug para un modulo en particular.

When at least exist one module with debug enabled, right tab on IDE changes its color to alert that our program is being compiled with Debug.
Cuando hay por lo menos un modulo con Debug activado se cambia el color del tab de la derecha del IDE para que estemos alertas que nuestro programa esta siendo compilado con Debug.

To enable debug from our application we have the ALT+D, as long as we are out of focus in the controls that capture keys such as the TEXTBOX, for these cases, there is a button outside of our application (which is always visible) with which we can force a return to debug if we can not do with the ALT+D.
Para activar el debug desde nuestra aplicación disponemos de las teclas ALT+D, siempre y cuando estemos fuera de los controles que capturan teclas como por ejemplo el TEXTBOX, para estos casos, se dispone de un boton externo a nuestra aplicación (que esta siempre visible) con el cual podemos forzar el regreso al debug en caso que no lo podamos hacer con las teclas ALT+D.

In both cases, ALT+D as the button "Prepare for Debug", causes that on the next event, it automatically returns to the debug screen.
En ambos casos, tanto con ALT+D como con el boton "Prepare for Debug", lo que se provoca es que ante el proximo evento, se regrese automaticamente a la pantalla del debug.

It is also possible to invoke the debug from the code of our program. This is used when we know exactly at what point do. It is enough to encode altd() function.
Tambien es posible invocar al debug desde el código de nuestro programa. Esto se utiliza cuando sabemos exactamente en que punto hacerlo. Solo basta con codificar la funcion altd()

The last lines of the following example shows the use of this function.
En las ultimas lineas del siguiente ejemplo se vé la utilización de dicha funcion.





Source of the image above:

Source de la imagen anterior:

#include "marinas-gui.ch"

Function main()

   if !__mg_IsDebugActive()
      mg_MsgStop( "You need activate the debug facility from 'Debug/Trace' option at Marinas-IDE mainmenu or " + ;
                  "by pressing 'D' button from sources tabpage, and then, build the project and run this program again" )
      return .F.
   endif

   CREATE WINDOW Sample
     ROW 0
     COL 0
     WIDTH 600
     HEIGHT 300
     CAPTION "Marinas-GUI Sample"
     MAIN .T.

      CREATE LABEL Label1
        ROW 40
        COL 25
        WIDTH 550
        HEIGHT 90
        VALUE "Press ALT+D or press 'Prepare for Debug' button to prepare return" + hb_eol() + ;
              "to Debug screen, and then, when you press 'Open Modal' button," + hb_eol() + ;
              "program go back to Debug screen"
        FONTCOLOR {255,0,0}
        FONTBOLD .T.
        ALIGN Qt_AlignCenter
      END LABEL

      CREATE BUTTON Button1
        ROW 140
        COL 150
        WIDTH 300
        CAPTION "Open Modal"
        ONCLICK myModalWindow()
      END BUTTON

      CREATE BUTTON Button2
        ROW 190
        COL 150
        WIDTH 300
        CAPTION "Send ALTD() to force return to Debug screen"
        ONCLICK myFunctionAldD()
      END BUTTON

   END WINDOW

   mg_Do( "Sample" , "center" )
   mg_Do( "Sample" , "activate" )

Return .T.

Function myModalWindow()

   CREATE WINDOW ModalWin
     ROW 0
     COL 0
     WIDTH 400
     HEIGHT 200
     CAPTION "Marinas-GUI Sample"
     MODAL .T.

      CREATE LABEL Label1
        ROW 40
        COL 130
        WIDTH 200
        VALUE "Basic Marinas-GUI Sample"
      END LABEL

      CREATE BUTTON Button1
        ROW 100
        COL 100
        WIDTH 200
        CAPTION "Return to Main Window"
        ONCLICK mg_Do( "ModalWin" , "release" )
      END BUTTON

   END WINDOW

   mg_Do( "ModalWin" , "center" )
   mg_Do( "ModalWin" , "activate" )

Return .T.

Function myFunctionAldD()
   LOCAL nInx, cLine := ""
   altd()  //  <== This funcion force return to debug window (if DEBUG is active)
   For nInx := 1 to 3   // Simple Sample Loop,
                        // use F8 to go next line
                        // or F5 to return to program
      cLine += "Loop " + str( nInx )
   Next
Return cLine




Marinas-GUI Version 03.06 and
Marinas-IDE Version 05.06 and
LEX Files Version 02.06


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
last update: April 27
2017
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




A Harbour/QT framework to make multiplatform programs

(©) Copyright 2009-2017 by Fernando Santolin (aka CarozoDeQuilmes)
CarozoDeQuilmes@gmail.com

2009-2017 Beta tester and full English translator: Bruno Luciani
Bruno.Luciani@gmail.com

2014-2015 Final English corrector: David Worboys
DavidWorboys@hotmail.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic