CAN FLASH A XBROWSE ?

CAN FLASH A XBROWSE ?

Postby Silvio » Sat Nov 13, 2010 10:18 am

Can I Flash a Row into a Xbrowse ?

I explain you

I insert a list of numbers

26
45
67
78

each number is a product

then the user inserted a message for a product and for each message the filed "messagges" add +1

when the field message is >1 the column or row must be flashed


this a s symply test


Code: Select all  Expand view


#include "fivewin.ch"
#include "xbrowse.ch"


function Main()

   local oWnd, oBrw, oDbf
   Local oFontGrid

    LOCAL n := RGB( 157, 248, 255 )

   XbrNumFormat( 'E', .t. )

   aRowGrad := { { .5, RGB(  0,251,220), RGB(221,255,251) }, ;
                 { .5, RGB(221,255,251), RGB(  0,251,220) } }

   aSelGrad := { { .5, RGB(255,224,126), RGB(255,255,193) }, ;
                 { .5, RGB(255,255,193), RGB(255,224,126) } }

   USE POSTINO
   database odbf

    DEFINE FONT oFontGrid NAME "MS Sans Serif" SIZE 0,-36 BOLD

    DEFINE window ownd  Title "General Table"

  * @ 0,0 xbrowse oBrw of oWnd ;
   *      object odbf

     oBrw:=  TXBrowse():New(oWnd)

    oCol:= oBrw:AddCol()
    oCol:bStrData := { ||  postino->numero}
    oCol:cHeader  := "Numero"
    oCol:nWidth   := 50
    oCol:oDataFont := oFontGrid

     oCol:= oBrw:AddCol()
    oCol:bStrData := { ||  postino->messaggi}
    oCol:cHeader  := "Mess"
    oCol:nWidth   := 80
    oCol:oDataFont := oFontGrid





   WITH OBJECT oBrw
      :nStretchCol   := 1
      :nMarqueeStyle := 4
      :bClrSelFocus  := { || { CLR_BLACK, aSelGrad } }
      :bClrRowFocus  := { || { CLR_BLACK, aRowGrad } }
      :nRowHeight  := 40
      :nHeaderHeight  := 36
     END

     WITH OBJECT oBrw:numero
      :AddBitmap( 'c:\work\fwh\bitmaps\open2.bmp' ) // non-alpha bitmap
      :bBmpData   := { || 1 }
   END

*   WITH OBJECT oBrw:messaggi
*      :AddBitmap( 'c:\work\fwh\bitmaps\Alphabmp\task.bmp' )  // alpha
*      :bBmpData   := { || 1 }
*   END

   oBrw:CreateFromCode()
   oWnd:oClient := oBrw


   activate window oWnd

return nil
 



On postino.dbf there are two filed

NUMERO Numeric 4
MESSAGGI Numeric 3
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: CAN FLASH A XBROWSE ?

Postby James Bott » Tue Nov 16, 2010 2:58 pm

Silvio,

I don't understand what you are trying to do.

>then the user inserted a message for a product and for each message the filed "messagges" add +1

Are you saying there can be more than one record for each product--one for each message.

6 First message for item 6
5 First message for item 6
6 Second message for item 6

>when the field message is >1 the column or row must be flashed

What do you mean by "field message is >1"? Do you mean when a new record is added when there is already a record for the same item?

What do you mean by flashed--shown blank then shown with text again? Or, deleted and redisplayed? Or? How many times, once or constantly.

What do you mean the column or row? How would this be determined? Why would you want to flash a column?

Maybe I should ask what you are trying to accomplish? Are you trying to get the user entering the information to see where it went, or are you trying to get other users in a multiuser system to see it? Something different?

Personally, I hate flashing displays and I bet most other users do also. Note also that for some people flashing light triggers migrane headaches. Maybe you should rethink this. If there is a problem with users not seeing something or remembering something, then I am sure there are better ways to do this.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: CAN FLASH A XBROWSE ?

Postby Silvio » Tue Nov 16, 2010 9:09 pm

here in Italy there is a game on coffe bars.
boy and girl have a number
a boy want Know a girl and write a message to number have the girl

...

I wish made a software to write messages

and on videowall I wish insert a xbrowse

with showing the message as " the number 45 sent a message to 25 "

this must flash on video to call the girl

the girl number 25 go to pc and digit her password and read the message


It' is possible '
??
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: CAN FLASH A XBROWSE ?

Postby James Bott » Tue Nov 16, 2010 9:53 pm

OK, if you just want to flash a row, you could do it by changing the background color then redrawing the row using oBrw:drawLine(), pause, then change the background color back and redraw the row again. Then repeat the sequence two or three times.

If you want multiple lines to flash until they recieve a response then this is more complex. You would have to keep a list of all messages that have not received a response, and use a codeblock to set the color of each row. Then the entire browse would have to be redrawn every second or two. Every other redraw all the records would be the same color. This will cause some records to flash and others not.

It would be a lot simpler to just use a different graphic in one column for messages depending on their status.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: CAN FLASH A XBROWSE ?

Postby StefanHaupt » Wed Nov 17, 2010 4:25 pm

Maybe you can use a timer inside the codeblock to change the color of the row until a response is coming in
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: CAN FLASH A XBROWSE ?

Postby jll-fwh » Wed Nov 17, 2010 7:23 pm

Hola Silvio:

Este es un ejemplo de como hacerlo pero para XBrowse, puedes adaptarlo sin problemas.

Code: Select all  Expand view

/***************************************************************************
* Sistema .....: BrwSample
* Programa ....:
* Autor .......: Anderson
* Data ........: 15/02/2008 às 13:35:56
* Revisado em .: 15/02/2008 às 13:35:56
***************************************************************************/


#include 'fivewin.ch'

****************************************************************************
function Main()
****************************************************************************

  local cWallPaper := '', oBgBmp := nil, nWidth := nHeight := 0,;
        cTitle := ""
  public oWnd

  set Bell        Off
  set Console     Off
  set Delimiters  Off
  set Century            On
  set Echo        Off
  set Exclusive   Off
  set Menu        Off
  set Intensity          On
  set Printer     Off
  set Scoreboard  Off
  set Delete             On
  set Wrap               On
  set Status      Off
  set 3dlook             On
  set Talk        Off
  set Date        Brit
  set Epoch       to 1920
  set Device      To Screen
  set Typeahead   To 2048
  set Decimal     To 2

  SetBalloon(.t.)

  //-- Icone (Deve ser o primeiro icone do .res) -------------------------//

  oIcon := TIcon():New(,,"RCA",,)

  //-- Window ------------------------------------------------------------//

  cTitle := "RCA Sistemas - WBrowse Sample"

  Define Window    oWnd                          ;
         Title     cTitle                        ;
         Menu      CreateMenu()                  ;
         Icon      oIcon                         ;
         FROM      0, 0 TO 600,800

  oWnd:nHeight := oWnd:nVertRes
  oWnd:nWidth  := oWnd:nHorzRes

  //-- KeyDown -----------------------------------------------------------//

  cWallPaper := "BG"
  nHeight    := 440
  nWidth     := 440

  nLeft := ( oWnd:nHorzRes() - nWidth ) / 2
  nTop  := ( oWnd:nVertRes() - nHeight) / 2

  @ nTop,nLeft Image      oImage                 ;
               resource   cWallPaper             ;
               Of         oWnd                   ;
               no border                         ;
               Pixel

  //-- Barra de ferramentas ----------------------------------------------//

  CreateToolBar()

  //-- Barra de status ---------------------------------------------------//

  Barra()

  //-- Ativa a janela ----------------------------------------------------//

  Activate Window    oWnd Maximized              ;
           valid     ValidClose()

  //-- Encerra a procedure principal -------------------------------------//

return( NIL )

/*------------------------------------------------------------------------*/

****************************************************************************
static procedure CreateToolBar()
****************************************************************************
*
* Criar a barra de ferramentas da janela principal
* Parametros: Nenhum
* Retorno: Nenhum
*
* Autor: anderson
* 18/7/2007 - 16:44:24
*
****************************************************************************

local oToolBar := Nil

  //-- Barra de ferramentas ----------------------------------------------//
 
  DEFINE ButtonBar oToolBar of oWnd Size 80, 70 2007

  Define Button                                  ;
         OF        oToolBar                      ;
         prompt    "Dialogo"                     ;
         Resource  "Dialog48"                    ;
         action   ShowDlg();
         Group

  Define BUTTON                                  ;
         OF        oToolBar                      ;
         prompt    "Sair"                        ;
         Resource  "Sair48"                      ;
         Action    (oWnd:End())                  ;
         Group
         
Return Nil

/*------------------------------------------------------------------------*/

****************************************************************************
static function CreateMenu()
****************************************************************************
*
* Criar um objeto menu
* Parametros: Nenhum
* Retorno: Objeto - Menu da janela principal
*
* Autor: Anderson
* 17/7/2007 - 12:24:35
*
****************************************************************************

local Result := Nil

   menu Result 2007

        menuitem "Menu"
        menu
            menuitem "Browse piscando"           ;
            message  "Exibir browse piscando"    ;
            action   ShowDlg()                   ;
            resource "Dialog16"                  ;
            helpid ""

            separator

            menuitem    "Sai&r"                  ;
            message     "Fechar sistema"         ;
            accelerator ACC_NORMAL, VK_ESCAPE    ;
            resource    "Sair16"                 ;
            action      oWnd:End()
       
        endmenu

   endmenu

Return Result

/*------------------------------------------------------------------------*/

****************************************************************************
static function ValidClose()
****************************************************************************
*
* Validar a saida do sistema
* Parametro: Nenhum
* Retorno: Lógico - se permite ou nao sair
*
* Autor: Anderson
* 17/7/2007 - 12:32:42
*
****************************************************************************

local Result := .f.

  Result := Sn('Deseja sair do sistema')

Return Result

/*------------------------------------------------------------------------*/

****************************************************************************
function Barra(cMensagem)
****************************************************************************

local oFntMess, cWndName := ""

   default cMensagem := "Copyright © 2008 - RCA Sistemas Ltda."

   SysRefresh()

   Define Font oFntMess Name "Tahoma"

   set message                          ;
       of         oWnd                  ;
       to         cMensagem             ;
       2007                             ;
       centered                         ;
       Font       oFntMess

   SysRefresh()

return NIL

/*------------------------------------------------------------------------*/

****************************************************************************
function SN(cQuestion,cDefault)
****************************************************************************

local cAlias

   cDefault := if(ValType(cDefault) != "C","S",cDefault)

   cAlias := Alias()

   cQuestion := StrTran(cQuestion,";",chr(13))

   if Upper(cDefault) == "N"  // Foco fica em Nao.
       Result := MsgNoYes(AllTrim(cQuestion) + " ?" ,"Confirmação")
   else
       Result := MsgYesNo(AllTrim(cQuestion) + " ?" ,"Confirmação")
   endif

   if .not. Empty(AllTrim(cAlias))
      Select (cAlias)
   end

return Result

/*------------------------------------------------------------------------*/

 


Espero te sirva:

un saludo
JLL
Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
User avatar
jll-fwh
 
Posts: 408
Joined: Fri Jan 29, 2010 8:14 pm
Location: Meliana - Valencia

Re: CAN FLASH A XBROWSE ?

Postby jll-fwh » Wed Nov 17, 2010 7:26 pm

Faltaba esto:

Code: Select all  Expand view

/***************************************************************************
* Sistema .....: WBrowseSample
* Programa ....: DlgWBrw.PRG
* Autor .......: Anderson
* Data ........: 15/02/2008 às 14:18:56
* Revisado em .: 15/02/2008 às 14:18:56
***************************************************************************/


#include 'FiveWin.ch'

****************************************************************************
FUNCTION ShowDlg()
****************************************************************************

Private oDlg := Nil, oBrw, oTmr

   select 0
   use customer


   Define Dialog     oDlg                                   ;
          of         oWnd                                   ;
          resource   "DLG"


   //-- Browse -----------------------------------------------------------//

   Redefine LISTBOX   oBrw                                  ;
            FIELDS    FIRST,                                ;
                      LAST,                                 ;
                      STREET,                               ;
                      if(MARRIED,'True','False'),           ;
                      Str(AGE),                             ;
                      Str(SALARY)                           ;
            HEADERS   "Nome","Sobrenome","Endereço",        ;
                      "Casado","Idade","Salario"            ;
            Sizes     090,090,090,060,100,100               ;
            ID        4001                                  ;
            OF        oDlg

   oBrw:nClrPane   := {|| ClrPaneBrw() }

   Activate Dialog   oDlg                                   ;
            Center                                          ;
            on init  OnInit()
           
   oTmr:Deactivate()
           
   close all

RETURN nil

/*------------------------------------------------------------------------*/

****************************************************************************
static procedure OnInit()
****************************************************************************
*
* Executar tarefa ao iniciar o dialog
* Parametros: nenhum
* Retorno: Nenhum
*
* Autor: Anderson
* 05/04/2008 - 09:38:53
*
****************************************************************************

   Define   Timer     oTmr    ;
            Interval  1000    ;
            Of        oDlg    ;
            Action    (oBrw:Paint(),oBrw:Refresh(),oBrw:UpStable())
           
   Activate Timer oTmr

Return Nil

/*------------------------------------------------------------------------*/

****************************************************************************
static function ClrPaneBrw()
****************************************************************************
*
* Trocar cor da linha do listbox
* Parametros:
* Retorno: Nenhum
*
* Autor: Anderson
* 05/04/2008 - 09:32:59
*
****************************************************************************

local Result := nRgb(255,255,255)

   if MARRIED
      Result := nRgb(200,200,223)
   elseif AGE > 80
     
      if Val(Right(Time(),2)) % 2 == 0
         Result := nRgb(255,0,255)
      else
         Result := nRgb(0,255,0)
      end
     
   end

Return Result

/*------------------------------------------------------------------------*/

 


un saludo
JLL
Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
User avatar
jll-fwh
 
Posts: 408
Joined: Fri Jan 29, 2010 8:14 pm
Location: Meliana - Valencia

Re: CAN FLASH A XBROWSE ?

Postby Silvio » Wed Nov 17, 2010 8:11 pm

this is a good idea
thanks
do you have an idea how converte it on xbrowse control ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: CAN FLASH A XBROWSE ?

Postby Silvio » Wed Nov 17, 2010 10:58 pm

why this not run ????

Code: Select all  Expand view
FUNCTION ShowDlg()
Private oDlg := Nil, oBrw, oTmr

   select 0
   USE CUSTOMER ALIAS CUST


   Define Dialog     oDlg                                   ;
          of         oWnd                                  ;
          SIZE 800,600


      @ 10, 10 XBROWSE oBrw OF oDlg ;
      SIZE 300, 200 PIXEL ;
      AUTOCOLS ALIAS 'CUST' BACKGROUND ""


   oBrw:nRowDividerStyle = LINESTYLE_NOLINES
   oBrw:nColDividerStyle = LINESTYLE_NOLINES
   oBrw:nMarqueeStyle    = MARQSTYLE_HIGHLROW


  // oBrw:nClrPane   := {|| ClrPaneBrw() }
    oBrw:bClrStd := { || Colores("CUST") }  // colori

        oBrw:CreateFromCode()

   Activate Dialog   oDlg                                   ;
            Center                                          ;
            on init  OnInit()

   oTmr:Deactivate()

   close all

RETURN nil


static procedure OnInit()

  Define   Timer     oTmr    ;
            Interval  1000    ;
            Of        oDlg    ;
            Action    (oBrw:Paint(),oBrw:Refresh(),oBrw:UpStable())
   Activate Timer oTmr

Return Nil



 FUNCTION Colores(cdbf)
   LOCAL aCol:={}

 IF (cdbf)->MARRIED

            aCol:={CLR_BLACK, RGB(193,221,255) }

         elseif (cdbf)->AGE > 80

              if Val(Right(Time(),2)) % 2 == 0
                  aCol:={CLR_BLACK, nRgb(255,0,255) }
             else
                 aCol:={CLR_BLACK,nRgb(0,255,0) }
              end


ENDIF



RETURN (aCol)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: CAN FLASH A XBROWSE ?

Postby jll-fwh » Wed Nov 17, 2010 11:26 pm

Hola Silvio:

En la clase xBrowse no existe el metodo ::UpStable(), simplemente refresca con ::Refresh() o para repintar todo ::Refresh( .T )

Un saludo
JLL
Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
User avatar
jll-fwh
 
Posts: 408
Joined: Fri Jan 29, 2010 8:14 pm
Location: Meliana - Valencia

Re: CAN FLASH A XBROWSE ?

Postby Silvio » Thu Nov 18, 2010 8:49 am

ok but it not run ok
loook please this
Code: Select all  Expand view

/***************************************************************************
* Sistema .....: BrwSample
* Programa ....:
* Autor .......: Anderson
* Data ........: 15/02/2008 às 13:35:56
* Revisado em .: 15/02/2008 às 13:35:56
***************************************************************************/


#include 'fivewin.ch'
 #include 'xbrowse.ch'
****************************************************************************
function Main()
****************************************************************************

  local cWallPaper := '', oBgBmp := nil, nWidth := nHeight := 0,;
        cTitle := ""
  public oWnd

  set Bell        Off
  set Console     Off
  set Delimiters  Off
  set Century            On
  set Echo        Off
  set Exclusive   Off
  set Menu        Off
  set Intensity          On
  set Printer     Off
  set Scoreboard  Off
  set Delete             On
  set Wrap               On
  set Status      Off
  set 3dlook             On
  set Talk        Off
  set Date        Brit
  set Epoch       to 1920
  set Device      To Screen
  set Typeahead   To 2048
  set Decimal     To 2

  SetBalloon(.t.)

  //-- Icone (Deve ser o primeiro icone do .res) -------------------------//

  oIcon := TIcon():New(,,"RCA",,)

  //-- Window ------------------------------------------------------------//

  cTitle := "RCA Sistemas - WBrowse Sample"

  Define Window    oWnd                          ;
         Title     cTitle                        ;
         Menu      CreateMenu()                  ;
         Icon      oIcon                         ;
         FROM      0, 0 TO 600,800

  oWnd:nHeight := oWnd:nVertRes
  oWnd:nWidth  := oWnd:nHorzRes

  //-- KeyDown -----------------------------------------------------------//

  cWallPaper := "BG"
  nHeight    := 440
  nWidth     := 440

  nLeft := ( oWnd:nHorzRes() - nWidth ) / 2
  nTop  := ( oWnd:nVertRes() - nHeight) / 2

  @ nTop,nLeft Image      oImage                 ;
               resource   cWallPaper             ;
               Of         oWnd                   ;
               no border                         ;
               Pixel

  //-- Barra de ferramentas ----------------------------------------------//

  CreateToolBar()

  //-- Barra de status ---------------------------------------------------//

  Barra()

  //-- Ativa a janela ----------------------------------------------------//

  Activate Window    oWnd Maximized              ;
           valid     ValidClose()

  //-- Encerra a procedure principal -------------------------------------//

return( NIL )

/*------------------------------------------------------------------------*/

****************************************************************************
static procedure CreateToolBar()
****************************************************************************
*
* Criar a barra de ferramentas da janela principal
* Parametros: Nenhum
* Retorno: Nenhum
*
* Autor: anderson
* 18/7/2007 - 16:44:24
*
****************************************************************************

local oToolBar := Nil

  //-- Barra de ferramentas ----------------------------------------------//
 
  DEFINE ButtonBar oToolBar of oWnd Size 80, 70 2007

  Define Button                                  ;
         OF        oToolBar                      ;
         prompt    "Dialogo"                     ;
         Resource  "Dialog48"                    ;
         action   ShowDlg();
         Group

  Define BUTTON                                  ;
         OF        oToolBar                      ;
         prompt    "Sair"                        ;
         Resource  "Sair48"                      ;
         Action    (oWnd:End())                  ;
         Group
         
Return Nil

/*------------------------------------------------------------------------*/

****************************************************************************
static function CreateMenu()
****************************************************************************
*
* Criar um objeto menu
* Parametros: Nenhum
* Retorno: Objeto - Menu da janela principal
*
* Autor: Anderson
* 17/7/2007 - 12:24:35
*
****************************************************************************

local Result := Nil

   menu Result 2007

        menuitem "Menu"
        menu
            menuitem "Browse piscando"           ;
            message  "Exibir browse piscando"    ;
            action   ShowDlg()                   ;
            resource "Dialog16"                  ;
            helpid ""

            separator

            menuitem    "Sai&r"                  ;
            message     "Fechar sistema"         ;
            accelerator ACC_NORMAL, VK_ESCAPE    ;
            resource    "Sair16"                 ;
            action      oWnd:End()

        endmenu

   endmenu

Return Result

/*------------------------------------------------------------------------*/

****************************************************************************
static function ValidClose()
****************************************************************************
*
* Validar a saida do sistema
* Parametro: Nenhum
* Retorno: Lógico - se permite ou nao sair
*
* Autor: Anderson
* 17/7/2007 - 12:32:42
*
****************************************************************************

local Result := .f.

  Result := Sn('Deseja sair do sistema')

Return Result

/*------------------------------------------------------------------------*/

****************************************************************************
function Barra(cMensagem)
****************************************************************************

local oFntMess, cWndName := ""

   default cMensagem := "Copyright © 2008 - RCA Sistemas Ltda."

   SysRefresh()

   Define Font oFntMess Name "Tahoma"

   set message                          ;
       of         oWnd                  ;
       to         cMensagem             ;
       2007                             ;
       centered                         ;
       Font       oFntMess

   SysRefresh()

return NIL

/*------------------------------------------------------------------------*/

****************************************************************************
function SN(cQuestion,cDefault)
****************************************************************************

local cAlias

   cDefault := if(ValType(cDefault) != "C","S",cDefault)

   cAlias := Alias()

   cQuestion := StrTran(cQuestion,";",chr(13))

   if Upper(cDefault) == "N"  // Foco fica em Nao.
       Result := MsgNoYes(AllTrim(cQuestion) + " ?" ,"Confirmação")
   else
       Result := MsgYesNo(AllTrim(cQuestion) + " ?" ,"Confirmação")
   endif

   if .not. Empty(AllTrim(cAlias))
      Select (cAlias)
   end

return Result

/*------------------------------------------------------------------------*/

 
/***************************************************************************
* Sistema .....: WBrowseSample
* Programa ....: DlgWBrw.PRG
* Autor .......: Anderson
* Data ........: 15/02/2008 às 14:18:56
* Revisado em .: 15/02/2008 às 14:18:56
***************************************************************************/



****************************************************************************
/*FUNCTION ShowDlg()
****************************************************************************

Private oDlg := Nil, oBrw, oTmr

   select 0
   use customer


   Define Dialog     oDlg                                   ;
          of         oWnd                                   ;
          resource   "DLG"


   //-- Browse -----------------------------------------------------------//

   Redefine LISTBOX   oBrw                                  ;
            FIELDS    FIRST,                                ;
                      LAST,                                 ;
                      STREET,                               ;
                      if(MARRIED,'True','False'),           ;
                      Str(AGE),                             ;
                      Str(SALARY)                           ;
            HEADERS   "Nome","Sobrenome","Endereço",        ;
                      "Casado","Idade","Salario"            ;
            Sizes     090,090,090,060,100,100               ;
            ID        4001                                  ;
            OF        oDlg

   oBrw:nClrPane   := {|| ClrPaneBrw() }

   Activate Dialog   oDlg                                   ;
            Center                                          ;
            on init  OnInit()

   oTmr:Deactivate()

   close all

RETURN nil
  */

/*------------------------------------------------------------------------*/


****************************************************************************


/*------------------------------------------------------------------------*/

 FUNCTION ShowDlg()
Private oDlg := Nil, oBrw, oTmr

   select 0
   USE CUSTOMER ALIAS CUST


   Define Dialog     oDlg                                   ;
          of         oWnd                                  ;
          SIZE 800,600


      @ 10, 10 XBROWSE oBrw OF oDlg ;
      SIZE 400, 400 PIXEL ;
      AUTOCOLS ALIAS 'CUST' BACKGROUND ""


   oBrw:nRowDividerStyle = LINESTYLE_NOLINES
   oBrw:nColDividerStyle = LINESTYLE_NOLINES
   oBrw:nMarqueeStyle    = MARQSTYLE_HIGHLROW



    oBrw:bClrStd := { || ClrPaneBrw() }  // colori

        oBrw:CreateFromCode()

   Activate Dialog   oDlg                                   ;
            Center                                          ;
            on init  OnInit()

   oTmr:Deactivate()

   close all

RETURN nil





static procedure OnInit()

  Define   Timer     oTmr    ;
            Interval  1000    ;
            Of        oDlg    ;
            action   oBrw:Refresh()

           // Action    (oBrw:Paint(),oBrw:Refresh(),oBrw:UpStable())
   Activate Timer oTmr

Return Nil




 static function ClrPaneBrw()

local Result := nRgb(255,255,255)
Local aCol:={ }
   if CUST->MARRIED
      Result := nRgb(200,200,223)
   elseif CUST->AGE > 80

      if Val(Right(Time(),2)) % 2 == 0
         Result := nRgb(255,0,255)
      else
         Result := nRgb(0,255,0)
      end

   end

Return   aCol:={CLR_BLACK,Result }





 
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi, RSalazarU and 76 guests