Page 1 of 2
xBrowser click
Posted: Wed Oct 11, 2023 2:30 pm
by oliveiros junior
Hi guys good morning!
I would like to know if it is possible to assign an action when clicking just once on a cell in the xBrowser, and another question is about the SetDlgGradient command, when dividing a screen as follows: SetDlgGradient( { { 0.9, CLR_WHITE, CLR_WHITE }, { 0.1 , CLR_BLACK, CLR_BLACK }, .F. } ) , the SAY commands placed on the screen remain the background color defined in SetDlgGradient, my question is, would it be possible to determine the background color of the SAY commands?
Thank you in advance for your help.
Oliveiros Junior
Re: xBrowser click
Posted: Wed Oct 11, 2023 2:55 pm
by karinha
Mira:
Code: Select all | Expand
Pasta de c:\fwh1905\samples
08/03/2022 18:53 3.830 XBROWED.PRG
Eu não entedi a dúvida nos SAYS? Você pode trocar a COR, inclusive em TEMPO REAL.
Você tem um pequeno exemplo para testes?
Obg. abs.
Regards, saludos.
Re: xBrowser click
Posted: Wed Oct 11, 2023 3:13 pm
by oliveiros junior
Oi Karinha, obrigado pela resposta. O caso do SAY é o seguinte:
Criei uma dialog e pintei com o comando SetDlgGradient( { { 0.9, CLR_WHITE, CLR_WHITE }, { 0.1 , CLR_BLACK, CLR_BLACK }, .F. } ), que é 9/10 branco e 1/10 negro. Dai coloquei uma imagem e escrevi sobre a imagem, com um SAY. Na parte branca, aparece com o fundo branco, independente da cor que eu coloque, e na parte negra, aparece o fundo negro, independente da cor colocada para o fundo.
Att.,
Junior
Re: xBrowser click
Posted: Wed Oct 11, 2023 3:37 pm
by karinha
oliveiros junior wrote:Oi Karinha, obrigado pela resposta. O caso do SAY é o seguinte:
Criei uma dialog e pintei com o comando SetDlgGradient( { { 0.9, CLR_WHITE, CLR_WHITE }, { 0.1 , CLR_BLACK, CLR_BLACK }, .F. } ), que é 9/10 branco e 1/10 negro. Dai coloquei uma imagem e escrevi sobre a imagem, com um SAY. Na parte branca, aparece com o fundo branco, independente da cor que eu coloque, e na parte negra, aparece o fundo negro, independente da cor colocada para o fundo.
Att.,
Junior
Faça um TESTE, retire o SetDlgGradient e use o GRADIENT aGrad direto no DEFINE DIALOG... Diga o que ocorre.
Obg. abs.
Regards, saludos.
Re: xBrowser click
Posted: Wed Oct 11, 2023 3:45 pm
by karinha
Oliveiros, Salvo engano,
Code: Select all | Expand
SetDlgGradient( { { 0.9, CLR_WHITE, CLR_WHITE }, { 0.1 , CLR_BLACK, CLR_BLACK }, .F. } )
Isto está errado.
Regards, saludos.
Re: xBrowser click
Posted: Wed Oct 11, 2023 3:50 pm
by karinha
Oliveiros, Que tal?
Code: Select all | Expand
// C:\FWH..\SAMPLES\CAMILO.PRG
#include "FiveWin.ch"
#Define CLR_ORANGE nRGB( 255, 165, 000 ) //-> Orange - Laranja
#Define CLR_SOFTYELLOW nRGB( 255, 251, 225 )
FUNCTION Main()
LOCAL oDlg, oGroup, oSalida, oFont, oSkinB, aGrad
LOCAL lFivePro := .T.
LOCAL lDialog := .T.
LOCAL lObjects := .F.
LOCAL oRadMenu := 1
LOCAL cName := SPACE( 10 )
LOCAL cAddress := SPACE( 30 )
LOCAL oBtn, oGet1, oGet2
LOCAL nColor := 1
oSkinB = TSkinButton():New()
oSkinB:nClrBorder0_N := RGB( 249, 194, 179 )
oSkinB:nClrBorder1_N := RGB( 181, 61, 29 )
oSkinB:aClrNormal := { { 0.2, RGB( 000, 128, 000 ), RGB( 000, 128, 000 ) }, ;
{ 0.8, RGB( 109, 135, 100 ), RGB( 109, 135, 100 ) } }
SkinButtons( oSkinB )
SetGetColorFocus()
tGet():lDisColors := .F.
tGet():nClrTextDis := CLR_HBLUE
tGet():nClrPaneDis := CLR_WHITE
// aGrad := { { 1, CLR_WHITE, CLR_HCYAN } }
// aGrad := ( { { 0.9, CLR_WHITE, CLR_BLACK }, { 0.1 , CLR_WHITE, CLR_BLACK }, .F. } )
aGrad := ( { { 0.5, CLR_WHITE, CLR_BLACK }, { 0.5 , CLR_WHITE, CLR_BLACK }, .F. } )
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -14 BOLD
DEFINE DIALOG oDlg FROM 8, 2 TO 25, 50 TITLE "Group Color by Camilo" ;
FONT oFont GRADIENT aGrad
oDlg:lHelpIcon := .F.
@ 1, 1 SAY "&Name:" OF oDlg COLORS CLR_CYAN, CLR_WHITE TRANSPARENT UPDATE
@ 1, 6 GET oGet1 VAR cName OF oDlg COLORS CLR_BLACK, CLR_WHITE UPDATE
@ 2, 1 SAY "&Address:" OF oDlg COLORS CLR_CYAN, CLR_WHITE TRANSPARENT ;
UPDATE
@ 2, 6 GET oGet2 VAR cAddress OF oDlg COLORS CLR_BLACK, CLR_WHITE UPDATE
@ 3, 9 GROUP oGroup TO 7, 20 LABEL "Group Color" OF oDlg ;
COLOR CLR_ORANGE, CLR_WHITE TRANSPARENT
@ 4, 9 RADIO oRadMenu PROMPT "&Novice", "A&vanced", "&Expert" OF oDlg
@ 6, 5 BUTTON oBtn PROMPT "&Color" OF oDlg SIZE 50, 12 ;
ACTION SET_COLOR( oGroup, nColor )
oBtn:cToolTip := "Cambiar Color del Group"
@ 6, 17 BUTTON oSalida PROMPT "&Salida" OF oDlg SIZE 50, 12 ;
ACTION( oDlg:End() ) CANCEL
oSalida:cToolTip := "salida - Exit - Cancelar"
ACTIVATE DIALOG oDlg CENTERED ON INIT( CTRLS_COLORS( oDlg ) )
oFont:End()
RETURN NIL
FUNCTION SET_COLOR( oGroup, nColor )
LOCAL oIni, oBrush, oBmp
LOCAL nTipo, cStyle, cFile, cLogo, nRow, nCol, lSelect
nColor := ChooseColor()
oGroup:SetColor( nColor, CLR_WHITE )
oGroup:Refresh()
RETURN( nColor )
// By Giovanny Vecchi
FUNCTION CTRLS_COLORS( f_oDlgContainer )
LOCAL lc_aCtrls := {}, lc_iFor := 0
LOCAL lc_aItemsRadio := {}
lc_aCtrls := f_oDlgContainer:aControls
FOR lc_iFor := 1 TO Len( lc_aCtrls )
IF ValType( lc_aCtrls[lc_iFor] ) == "O"
IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"
aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems, ;
{|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
_oRadId:SetColor( CLR_CYAN, CLR_WHITE ) } } )
ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"
// SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )
// lc_aCtrls[lc_iFor]:SetColor( G_COLOR_SYS( 31 ), G_COLOR_SYS( 1 ) )
ENDIF
ENDIF
NEXT
RETURN NIL
// FIN -> kapiabafwh@gmail.com
Regards, saludos.
Re: xBrowser click
Posted: Wed Oct 11, 2023 4:01 pm
by karinha
// .T. TRUE, divide o GRADIENT ao meio, gostei. hahaha.
Code: Select all | Expand
aGrad := ( { { 0.5, CLR_WHITE, CLR_BLACK }, { 0.5 , CLR_WHITE, CLR_BLACK }, .T. } )
Regrads, saludos.
Re: xBrowser click
Posted: Wed Oct 11, 2023 6:13 pm
by oliveiros junior
Oi Karinha,
Quanto ao SetDlgGradient( { { 0.9, CLR_WHITE, CLR_WHITE }, { 0.1 , CLR_BLACK, CLR_BLACK }, .F. } ), ele funciona, mister RAO quem orientou.
Obrigado quanto a sua proposta. Vou experimentar e retorno.
Att.,
Oliveiros Junior
Re: xBrowser click
Posted: Wed Oct 11, 2023 10:42 pm
by nageswaragunupudi
I would like to know if it is possible to assign an action when clicking just once on a cell in the xBrowser,
You can assign an action to code-block:
Code: Select all | Expand
oBrw:bLClicked := { |row,col,flags,brw| youraction( ... ) }
The default behavior of XBrowse is that single left click on a cell navigates to that cell. We feel assigning a different action to single left click may be inconsistent with normal behaviour and confusing to users. Instead better to use right-click or double-click.
Anyway, the decision is yours.
another question is about the SetDlgGradient command, when dividing a screen as follows: SetDlgGradient( { { 0.9, CLR_WHITE, CLR_WHITE }, { 0.1 , CLR_BLACK, CLR_BLACK }, .F. } ) , the SAY commands placed on the screen remain the background color defined in SetDlgGradient, my question is, would it be possible to determine the background color of the SAY commands?
Whatever background you have for the dialog, if you define a Say with COLOR clause. eg:
1) if the Dialog is not transparent, the say is displayed with its own back color.
2) if the Dialog is transparent, the say is displayed transparently, i.e., back color of the say is not painted.
Re: xBrowser click
Posted: Mon Oct 16, 2023 5:30 pm
by oliveiros junior
Mr Rao, does it only work over the line?
Thanks
Oliveiros Junior
Re: xBrowser click
Posted: Tue Oct 17, 2023 2:26 am
by nageswaragunupudi
Mr Rao, does it only work over the line?
I do not understand your question.
Re: xBrowser click
Posted: Tue Oct 17, 2023 4:03 pm
by karinha
Oliveiros, seria algo
assim? Sempre que possível, post o .PRG, ok?
https://forums.fivetechsupport.com/~fiv ... 18&start=0
Regards, saludos.
Re: xBrowser click
Posted: Tue Oct 17, 2023 4:12 pm
by oliveiros junior
Olá João,
É bem simples, o Senhor Rao respondeu em parte (clique sobre a linha). Porém o que eu necessito é tratar cada célula da xBrowser como se fosse um botão. Dar um simples click sobre ela e ela executar uma ação.
Att.,
Oliveiros Junior
Re: xBrowser click
Posted: Tue Oct 17, 2023 4:22 pm
by karinha
Re: xBrowser click
Posted: Tue Oct 17, 2023 4:58 pm
by oliveiros junior
Mr Rao,
I need to treat each xBrowser cell as if it were a button. Simply click on it and it will perform an action.
The bLClicked command, it seems, treats the entire line.
Att.,
Oliveiros Junior