Page 1 of 1

Browse Scroll

Posted: Tue Oct 04, 2011 2:40 pm
by Mario Mansilla
Hola :
En el control browse muestro el estado de la base a medida que agrego items . Necesito aprovechar toda la ventana del browse ya que el scroll solo muestra la mitad de la pantalla del browse . Este efecto en el ejemplo comienza a partir del ingreso del 6 item .
Es posible realizar esto ?
Saludos .
Mario Mansilla

Hi
In the Browser displays the state control of the base as you add items. I need to take full advantage of the browser window as the scroll only shows half the screen browse. This effect in the example starts from receipt of item 6.
It is possible to do this?
Greetings.
Mario Mansilla

Re: Browse Scroll

Posted: Tue Oct 04, 2011 4:22 pm
by gfilatov
Mario Mansilla wrote: Hi
In the Browser displays the state control of the base as you add items. I need to take full advantage of the browser window as the scroll only shows half the screen browse. This effect in the example starts from receipt of item 6.
It is possible to do this?
Greetings.
Mario Mansilla
Hi Mario,

Please be so kind to try the updated sample below:

Code: Select all

#include <hmg.ch>

Function Main

   SET NAVIGATION EXTENDED
   SET CENTURY ON
   SET BROWSESYNC ON

   Load Window Main
   Main.Center
   Main.Activate

Return

*-----------------------
Static Procedure Abrir_Bases()
*-----------------------

*--
* Abro Bases
*--

Use Datos Exclusive New
Go Top
Zap

Main.Browse_1.Value := Datos->(Recno())

Return

*-----------------------
Static Procedure Cerrar_Bases()
*-----------------------

Close Datos

Return

*-----------------------
Static Procedure Agregar
*-----------------------

Local Contador := Datos->(Recc()) + 1
Static nCode := 1

Datos->(Dbappend())
Replace Cantidad With nCode++
Replace Nombre With "Articulo " + Strzero(Contador,4)
Replace Unitario With 1.00
Replace Importe With 1.00

INSERT_CTRL_END()

Main.Browse_1.Refresh
Main.Browse_1.Value := Recno()
Main.Browse_1.Setfocus

Return

#pragma BEGINDUMP

#include <windows.h>
#include "hbapi.h"

HB_FUNC( INSERT_CTRL_END )
{
   keybd_event
   (
      VK_CONTROL,         // virtual-key code
      0,                // hardware scan code
      0,                // flags specifying various function options
      0                 // additional data associated with keystroke
   );

   keybd_event
   (
      VK_END,           // virtual-key code
      0,                // hardware scan code
      0,                // flags specifying various function options
      0                 // additional data associated with keystroke
   );

   keybd_event
   (
      VK_CONTROL,         // virtual-key code
      0,                // hardware scan code
      KEYEVENTF_KEYUP,  // flags specifying various function options
      0                 // additional data associated with keystroke
   );
}

#pragma ENDDUMP
Hope that helps :idea:

Re: Browse Scroll

Posted: Tue Oct 04, 2011 4:55 pm
by Mario Mansilla
Hi Grigory :
funciona perfecto , muchas gracias :D
works perfect, thank you very much
Saludos.
Mario Mansilla

Re: Browse Scroll

Posted: Wed Oct 05, 2011 5:21 am
by mol
working fine!
Thanks for this lesson, Grigori :P

Re: Browse Scroll

Posted: Thu Oct 06, 2011 8:07 am
by gfilatov
mol wrote:working fine!
Thanks for this lesson, Grigori :P
Hi Marek,

There is also the reduced version of this sample without using a C-level function.

Code: Select all

#include <hmg.ch>

Function Main

   SET NAVIGATION EXTENDED
   SET CENTURY ON
   SET BROWSESYNC ON

   Load Window Main
   Main.Center
   Main.Activate

Return Nil

*-----------------------
Static Procedure Abrir_Bases()
*-----------------------

Use Datos Exclusive New
Zap

Return

*-----------------------
Static Procedure Cerrar_Bases()
*-----------------------

Close Datos

Return

*-----------------------
Static Procedure Agregar
*-----------------------

Local Contador := Datos->(Recc()) + 1

Datos->(Dbappend())
Replace Cantidad With Contador
Replace Nombre With "Articulo " + Strzero(Contador,4)
Replace Unitario With Contador
Replace Importe With Contador

_PushKey( VK_END )

Main.Browse_1.Value := Recno()
Main.Browse_1.Setfocus

Return
Hope that helps :idea:

Re: Browse Scroll

Posted: Thu Oct 06, 2011 8:12 am
by mol
Couldn't be shorter? :lol: :lol: :lol: