Clipper On Line • Ver Tópico - Alterar dado do Browse
Página 1 de 1

Alterar dado do Browse

MensagemEnviado: 13 Mai 2022 10:03
por gilbertosilverio
Ola Amigos,

O que estou fazendo de errado?

Em uma matriz composta, o browse e alterado

#include "hwgui.ch"
Function Test()
Local oDlg, oBrw
Local aSample := { {"Alex",12} , {"Victor",13},{ "John",14} }

   INIT DIALOG oDlg TITLE "Browse array";
         AT 0, 0 SIZE 300, 230 ;
         FONT HFont():Add( "MS Sans Serif",0,-13 )

   @ 10,20 BROWSE oBrw ARRAY AUTOEDIT  SIZE 280,140 STYLE WS_BORDER + WS_VSCROLL ;
         ON SIZE ANCHOR_TOPABS + ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS

   // hwg_CreateArList() sets the array to browse and creates columns
   // You may use oBrw:AddColumn( HColumn():New(...) ) instead to set
   // columns with necessary options.
   hwg_CreateArList( oBrw, aSample )

   // In case of using hwg_CreateArList() you may set some columns options later,
   // for example:
   oBrw:aColumns[1]:heading := "Name"
   oBrw:aColumns[2]:heading := "ANO"
   oBrw:aColumns[1]:leditable := .t.

   @ 100,180 BUTTON 'Close' SIZE 100,28 ON CLICK {|| oDlg:Close() } ;
         ON SIZE ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS

   ACTIVATE DIALOG oDlg
Return Nil



Mais em uma matriz simples nao, Por que?

#include "hwgui.ch"
Function Test()
Local oDlg, oBrw
Local aSample := { "Alex" , "Victor",  "John" }

   INIT DIALOG oDlg TITLE "Browse array";
         AT 0, 0 SIZE 300, 230 ;
         FONT HFont():Add( "MS Sans Serif",0,-13 )

   @ 10,20 BROWSE oBrw ARRAY AUTOEDIT  SIZE 280,140 STYLE WS_BORDER + WS_VSCROLL ;
         ON SIZE ANCHOR_TOPABS + ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS

   // hwg_CreateArList() sets the array to browse and creates columns
   // You may use oBrw:AddColumn( HColumn():New(...) ) instead to set
   // columns with necessary options.
   hwg_CreateArList( oBrw, aSample )

   // In case of using hwg_CreateArList() you may set some columns options later,
   // for example:
   oBrw:aColumns[1]:heading := "Name"
   oBrw:aColumns[1]:leditable := .t.

   @ 100,180 BUTTON 'Close' SIZE 100,28 ON CLICK {|| oDlg:Close() } ;
         ON SIZE ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS

   ACTIVATE DIALOG oDlg
Return Nil