Browse Scroll

Moderator: Rathinagiri

Post Reply
Mario Mansilla
Posts: 269
Joined: Wed Aug 13, 2008 2:35 pm
Location: Córdoba - Argentina

Browse Scroll

Post 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
Attachments
Browse.rar
(664.44 KiB) Downloaded 342 times
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Browse Scroll

Post 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:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Mario Mansilla
Posts: 269
Joined: Wed Aug 13, 2008 2:35 pm
Location: Córdoba - Argentina

Re: Browse Scroll

Post by Mario Mansilla »

Hi Grigory :
funciona perfecto , muchas gracias :D
works perfect, thank you very much
Saludos.
Mario Mansilla
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Browse Scroll

Post by mol »

working fine!
Thanks for this lesson, Grigori :P
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Browse Scroll

Post 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:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Post Reply