Problem with Enable/Disable BUTTONBMP

Problem with Enable/Disable BUTTONBMP

Postby shark » Thu Jun 28, 2018 4:58 am

I have problems with BUTTONBMP and method´s Enable Disable.

The buttons to be visualy disable, but, the button continue enable.

This image down display the problem (border button it´s wrong color (dark gray):

Image

This image down display disable button correctly (border button it´s correct color (high gray)::

Image

WHTAS THIS SOLUTION??

who can help me??
shark
 
Posts: 55
Joined: Thu Mar 13, 2008 2:35 am

Re: Problem with Enable/Disable BUTTONBMP

Postby cnavarro » Thu Jun 28, 2018 12:31 pm

Without example of code, version of Fw, version (x) Harbor, it is difficult to offer help
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with Enable/Disable BUTTONBMP

Postby shark » Sun Aug 05, 2018 1:00 am

cnavarro wrote:Without example of code, version of Fw, version (x) Harbor, it is difficult to offer help


My versions its Fwh 18.01 / xHarbour / Bcc7

My code:
Code: Select all  Expand view

REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNNOVO ] BITMAP "BMP_BTN_NOVO"  ID 101 OF aAlunCtrl[ ALUN_DIALOG ] ACTION ( NovoAluno(), Pc_SetFocus( aAlunCtrl[ ALUN_GETS, ALUN_INI, 1 ] ) )
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNPESQ ] BITMAP "BMP_BTN_BUSCA" ID 102 OF aAlunCtrl[ ALUN_DIALOG ] ACTION IF( AlunCheckChange(), IF( !EMPTY( cCod := AlunoProcura( .T., lArquivoMorto ) ), EVAL( {|| aAlunCtrl[ ALUN_GETS, ALUN_COD, 2 ] := cCod, FindAlun() } ) , NIL ), NIL )

aAlunCtrl[ ALUN_BTNNOVO ]:cToolTip := "Novo"
aAlunCtrl[ ALUN_BTNPESQ ]:cToolTip := "Pesquisar"

REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNGRAV ] BITMAP "BMP_BTN_GRAVAR"   ID 103 OF aAlunCtrl[ ALUN_DIALOG ] ACTION GravAlun()
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNDELE ] BITMAP "BMP_BTN_EXCLUI"   ID 104 OF aAlunCtrl[ ALUN_DIALOG ] ACTION ExclAlun()
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNMORT ] BITMAP "BMP_BTN_ARQUIVO"  ID 105 OF aAlunCtrl[ ALUN_DIALOG ] ACTION IF( lArquivoMorto, RestAlun(), MortAlun() )
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNBLOQ ] BITMAP "Bmp_BTN_BLOQUEIO" ID 106 OF aAlunCtrl[ ALUN_DIALOG ] ACTION AlunBloqueio()
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNIMPR ] BITMAP "BMP_BTN_IMPRIME"  ID 107 OF aAlunCtrl[ ALUN_DIALOG ] ACTION ImprAlun( .T. )
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNFASE ] BITMAP "BMP_BTN_FASE"     ID 108 OF aAlunCtrl[ ALUN_DIALOG ] ACTION AlunoFaseProcesso( aAlunCtrl[ ALUN_GETS, ALUN_COD, 2 ], .T. )

aAlunCtrl[ ALUN_BTNGRAV ]:cToolTip := "Gravar Alterações"
aAlunCtrl[ ALUN_BTNDELE ]:cToolTip := "Excluir Aluno"
aAlunCtrl[ ALUN_BTNMORT ]:cToolTip := cMortToolTip
aAlunCtrl[ ALUN_BTNBLOQ ]:cToolTip := "Bloquear Aluno"
aAlunCtrl[ ALUN_BTNIMPR ]:cToolTip := "Imprimir Documentos"
aAlunCtrl[ ALUN_BTNFASE ]:cToolTip := "Visulizar Fase do Processo"

REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNGAT  ] BITMAP "BMP_BTN_LIGA"          ID 109 OF aAlunCtrl[ ALUN_DIALOG ] ACTION AlunEnviaGat()
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNWHAT ] BITMAP "BMP_BTN_WHATSAPP"      ID 110 OF aAlunCtrl[ ALUN_DIALOG ] ACTION AlunEnviaWhats()
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNSMS  ] BITMAP "BMP_BTN_SMS"           ID 111 OF aAlunCtrl[ ALUN_DIALOG ] ACTION AlunEnviaSMS()
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNMAIL ] BITMAP "BMP_BTN_EMAIL"         ID 112 OF aAlunCtrl[ ALUN_DIALOG ] ACTION AlunEnviaEmail()
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNATEN ] BITMAP "BMP_BTN_DIRECT"        ID 113 OF aAlunCtrl[ ALUN_DIALOG ] ACTION NIL
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNEXPO ] BITMAP "BMP_BTN_DOC_TRANSMITE" ID 114 OF aAlunCtrl[ ALUN_DIALOG ] ACTION NIL
REDEFINE BUTTONBMP aAlunCtrl[ ALUN_BTNIMPO ] BITMAP "BMP_BTN_DOC_RECEBE"    ID 115 OF aAlunCtrl[ ALUN_DIALOG ] ACTION NIL

aAlunCtrl[ ALUN_BTNGAT  ]:cToolTip := "Realizar ou Agendar ligação"
aAlunCtrl[ ALUN_BTNWHAT ]:cToolTip := "Realizar ou Agendar Whatsapp"
aAlunCtrl[ ALUN_BTNSMS  ]:cToolTip := "Enviar SMS"
aAlunCtrl[ ALUN_BTNMAIL ]:cToolTip := "Enviar EMAIL"
aAlunCtrl[ ALUN_BTNATEN ]:cToolTip := "Mensagem em atendimento"
aAlunCtrl[ ALUN_BTNEXPO ]:cToolTip := "Exportar Aluno"
aAlunCtrl[ ALUN_BTNIMPO ]:cToolTip := "Importar Aluno"
 


calling the enable and disable methods:

Code: Select all  Expand view


FUNCTION AlunChanged( lForce )

DEFAULT lForce := .F.

IF lForce

   lForceGrav := .T.

ENDIF

aAlunCtrl[ ALUN_CHANGE ] := .T.

aAlunCtrl[ ALUN_GETS, ALUN_COD, 1 ]:Disable()

aAlunCtrl[ ALUN_BTNGRAV ]:Enable(.T.)
aAlunCtrl[ ALUN_BTNDELE ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNMORT ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNBLOQ ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNIMPR ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNFASE ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNGAT  ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNWHAT ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNSMS  ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNMAIL ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNATEN ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNEXPO ]:Disable(.T.)
aAlunCtrl[ ALUN_BTNIMPO ]:Disable(.T.)

RETURN( .T. )

*------------------------------------------------------------------------------*

 
shark
 
Posts: 55
Joined: Thu Mar 13, 2008 2:35 am

Re: Problem with Enable/Disable BUTTONBMP

Postby cnavarro » Sun Aug 05, 2018 2:46 am

Ok, but why do not you try to use the WHEN clause
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with Enable/Disable BUTTONBMP

Postby nageswaragunupudi » Sun Aug 05, 2018 4:01 am

I am not sure if I understood correctly.
What I see is that the first button (ALUN_BTNGRAV) is Enabled. So it is painted with color. If it is disabled, then it would be painted gray.

When we again tested with buttonbmp with bitmaps available with us the bitmaps are painted correctly in full color when enabled and in gray when disabled.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with Enable/Disable BUTTONBMP

Postby shark » Mon Aug 06, 2018 1:15 am

nageswaragunupudi wrote:I am not sure if I understood correctly.
What I see is that the first button (ALUN_BTNGRAV) is Enabled. So it is painted with color. If it is disabled, then it would be painted gray.

When we again tested with buttonbmp with bitmaps available with us the bitmaps are painted correctly in full color when enabled and in gray when disabled.


should be like this, but the alun_btngrav button is enabled and did not paint the colors. This is the problem.
shark
 
Posts: 55
Joined: Thu Mar 13, 2008 2:35 am

Re: Problem with Enable/Disable BUTTONBMP

Postby shark » Mon Aug 06, 2018 1:17 am

cnavarro wrote:Ok, but why do not you try to use the WHEN clause


with WHEN clausule, the same problem.
shark
 
Posts: 55
Joined: Thu Mar 13, 2008 2:35 am

Re: Problem with Enable/Disable BUTTONBMP

Postby cnavarro » Mon Aug 06, 2018 2:54 am

Only occurs with this button?
If yes, please put your define constant ALUN_.....
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with Enable/Disable BUTTONBMP

Postby shark » Mon Aug 06, 2018 5:34 am

cnavarro wrote:Only occurs with this button?
If yes, please put your define constant ALUN_.....


Occurs in all buttons.

The define constante ALUN_BTNGRAV, is this simply: the position of array of object control button.
shark
 
Posts: 55
Joined: Thu Mar 13, 2008 2:35 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 48 guests