leo@lhsistemas.com Posted May 13, 2015 Report Share Posted May 13, 2015 Prezados, boa tarde. Quando executo minha aplicação em plataforma 64bits, o botão selecionado muda a fonte(ficando em negrito), daí as dialogs, say, get da minha aplicação mudam e ficam também em negrito, o que pode ser isto. Segue código abaixo: MsgSelect({"@Impressora","@PDF","@HTML","Titulo","Mensagem ?",2) *************************************************************************Function MsgSelect( aItems, cValue, cTitle,nPosInicial)Local nOpcao:=1,cVar,nTam,cOpcao,oBmpPrivate cTitulo:="Selecione uma Opcao !",oDlgMsgS,oBut01,oBut02,oBut03,; oBut04,oBut05,oBut06,oBut07#ifdef __CLIPPER__#Else #include "TSButton.ch"#EndIf/* Standard icon resource IDs */#define IDI_APPLICATION 32512#define IDI_HAND 32513#define IDI_QUESTION 32514#define IDI_EXCLAMATION 32515#define IDI_ASTERISK 32516If cValue != Nil cTitulo:=cValueEndifcTitle := If(cTitle=Nil,"Selecione ?",cTitle)nPosInicial := If(nPosInicial=NIL,1,nPosInicial)nTam := Len(aItems)*13.33DEFINE DIALOG oDlgMsgS FROM 5,10 TO 12, 14+nTam TITLE cTitulo Font oFontLH@ 00.7,01 ICON oICon Of oDlgMsgSoIcon:hIcon := LoadIcon(0, IDI_QUESTION)@ 00.7,05 Say Alltrim(cTitle) Of oDlgMsgSnI:=1#ifdef __CLIPPER__ If Len(aITems) >= 1 @ 02, 4+((nI-1)*7.5) BUTTON OBUT01 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT01:Cargo:="2", oDlgMsgS:End() ) EndIf If Len(aITems) >= 2 nI:=2 @ 02, 4+((nI-1)*7.5) BUTTON OBUT02 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ACTION ( OBUT02:Cargo:="2", oDlgMsgS:End() ) EndIf If Len(aITems) >= 3 nI:=3 @ 02, 4+((nI-1)*7.5) BUTTON OBUT03 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT03:Cargo:="2", oDlgMsgS:End() ) EndIf If Len(aITems) >= 4 nI:=4 @ 02, 4+((nI-1)*7.5) BUTTON OBUT04 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT04:Cargo:="2", oDlgMsgS:End() ) EndIf If Len(aITems) >= 5 nI:=5 @ 02, 4+((nI-1)*7.5) BUTTON OBUT05 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT05:Cargo:="2", oDlgMsgS:End() ) EndIf If Len(aITems) >= 6 nI:=6 @ 02, 4+((nI-1)*7.5) BUTTON OBUT06 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT06:Cargo:="2", oDlgMsgS:End() ) EndIf If Len(aITems) >= 7 nI:=7 @ 02, 4+((nI-1)*7.5) BUTTON OBUT07 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT07:Cargo:="2", oDlgMsgS:End() ) EndIf#else If Len(aITems) >= 1 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT01 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 Font oFontLH ; ACTION ( OBUT01:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 2 nI:=2 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT02 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 Font oFontLH ; ACTION ( OBUT02:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 3 nI:=3 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT03 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 Font oFontLH ; ACTION ( OBUT03:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 4 nI:=4 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT04 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 Font oFontLH ; ACTION ( OBUT04:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 5 nI:=5 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT05 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 Font oFontLH ; ACTION ( OBUT05:Cargo:="2", oDlgMsgS:End() ) ; ToolTIp StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 6 nI:=6 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT06 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 Font oFontLH ; ACTION ( OBUT06:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 7 nI:=7 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT07 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 Font oFontLH ; ACTION ( OBUT07:Cargo:="2", oDlgMsgS:End() ) ; ToolTIp StrTran(aItems[nI],"&","") XP EndIf#EndifFor nI := 1 to Len(aITems) cVar := "OBUT"+StrZero(nI,2) &(cVar):Cargo:="1"NextcVar := "OBUT"+StrZero(nPosInicial,2)oDlgMsgS:BStart := {|| &(cVar):SetFocus() }ACTIVATE DIALOG oDlgMsgS CENTEREDFor nI := 1 to Len(aITems) cVar := "OBUT"+StrZero(nI,2) If &(cVar):Cargo = "2" nOpcao:=nI EndifNextReturn(nOpcao) Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 13, 2015 Report Share Posted May 13, 2015 MsgSelect( { "@Impressora", "@PDF", "@HTML", "Titulo" },"Mensagem?" ) // ,2 Quote Link to comment Share on other sites More sharing options...
leo@lhsistemas.com Posted May 13, 2015 Author Report Share Posted May 13, 2015 Kapiaba, se retirar a opção inicial, o msgselect vai abrir com o primeiro botão selecionado. Beleza... Se der ENTER neste primeiro botão a fonte muda sozinha. Faltou informar que oFONTLH é a definição abaixo: Define Font oFontLH Name "Ms Sans Serif" Size 6,4 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 13, 2015 Report Share Posted May 13, 2015 Não entendi? Quote Link to comment Share on other sites More sharing options...
leo@lhsistemas.com Posted May 13, 2015 Author Report Share Posted May 13, 2015 MsgSelect({"@Impressora","@PDF","@HTML","Titulo","Mensagem ?",2) *************************************************************************Function MsgSelect( aItems, cValue, cTitle,nPosInicial)Local nOpcao:=1,cVar,nTam,cOpcao,oBmpPrivate cTitulo:="Selecione uma Opcao !",oDlgMsgS,oBut01,oBut02,oBut03,; oBut04,oBut05,oBut06,oBut07#ifdef __CLIPPER__#Else #include "TSButton.ch"#EndIf/* Standard icon resource IDs */#define IDI_APPLICATION 32512#define IDI_HAND 32513#define IDI_QUESTION 32514#define IDI_EXCLAMATION 32515#define IDI_ASTERISK 32516If cValue != Nil cTitulo:=cValueEndifcTitle := If(cTitle=Nil,"Selecione ?",cTitle)nPosInicial := If(nPosInicial=NIL,1,nPosInicial)nTam := Len(aItems)*13.33DEFINE DIALOG oDlgMsgS FROM 5,10 TO 12, 14+nTam TITLE cTitulo@ 00.7,01 ICON oICon Of oDlgMsgSoIcon:hIcon := LoadIcon(0, IDI_QUESTION)@ 00.7,05 Say Alltrim(cTitle) Of oDlgMsgSnI:=1 If Len(aITems) >= 1 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT01 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT01:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 2 nI:=2 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT02 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT02:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 3 nI:=3 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT03 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT03:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 4 nI:=4 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT04 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT04:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 5 nI:=5 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT05 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT05:Cargo:="2", oDlgMsgS:End() ) ; ToolTIp StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 6 nI:=6 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT06 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT06:Cargo:="2", oDlgMsgS:End() ) ; ToolTip StrTran(aItems[nI],"&","") XP EndIf If Len(aITems) >= 7 nI:=7 @ 02.45, 3.5+((nI-1)*8) sBUTTON OBUT07 Prompt aItems[nI] OF oDlgMsgS ; SIZE 40, 12 ; ACTION ( OBUT07:Cargo:="2", oDlgMsgS:End() ) ; ToolTIp StrTran(aItems[nI],"&","") XP EndIf#EndifFor nI := 1 to Len(aITems) cVar := "OBUT"+StrZero(nI,2) &(cVar):Cargo:="1"NextcVar := "OBUT"+StrZero(nPosInicial,2)oDlgMsgS:BStart := {|| &(cVar):SetFocus() }ACTIVATE DIALOG oDlgMsgS CENTEREDFor nI := 1 to Len(aITems) cVar := "OBUT"+StrZero(nI,2) If &(cVar):Cargo = "2" nOpcao:=nI EndifNextReturn(nOpcao) Faz o teste ai Kapi.. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 13, 2015 Report Share Posted May 13, 2015 MsgSelect({"@Impressora","@PDF","@HTML","Titulo","Mensagem ?",2) Isto não passa na minha compilação e eu nao tenho a TSBUTTON E os @ dos BUTTONS está dando conflito. Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 14, 2015 Report Share Posted May 14, 2015 Bom Dia.. Compilei seu código e deu tudo certo, exceto o StrTran e :Cargo de resto funcionou sem alterar os fonts do buttons. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.