FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ayuda No puedo Mostrar Boton en Dialogo con Xbrowse
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Ayuda No puedo Mostrar Boton en Dialogo con Xbrowse
Posted: Mon Dec 02, 2019 09:42 PM
Amigos muy buenas tardes.

Tengo un Problema, necesito mostrar un boton, dependiendo del Valor que toma una variable, segun se cumple cierta condici贸n.

La variable " cAgendar ", toma valor "N" o "S", en una funci贸n al seleccionar un dia de atenci贸n, debe mostrar un Boton al tomar valor "S", pero en el dialogo, nunca actualiza o cambia su valor, por lo que jamas muestra el boton.

Muchos Saludos
Antonio

Dejo el codigo:
Code (fw): Select all Collapse
聽 聽 聽 聽 聽 聽 聽 聽@ 30, 10 XBROWSE oBrw3 SIZE 110,86 PIXEL OF oDlg3;
聽 聽 聽 聽 聽 聽 聽 聽聽聽 聽 聽 聽 DATASOURCE aAgenda ;
聽 聽 聽 聽 聽 聽 聽 聽聽聽 聽 聽 聽 COLUMNS 1,2,3,4,5,6,7;
聽 聽 聽 聽 聽 聽 聽 聽聽聽 聽 聽 聽 HEADERS "LU","MA","MI","JU","VI","SA","DO";
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 CELL LINES BORDER;
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 ColSizes 29,29,29,29,29,29,29


聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:lRecordSelector 聽 聽 聽:= .f.
聽 聽聽聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:nColDividerStyle := LINESTYLE_INSET
聽 聽聽聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:nRowDividerStyle := LINESTYLE_INSET
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:nOpacity 聽 聽:= 230
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:SetStyle( 2018)
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:nColorPen := CLR_RED
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:lHScroll := .F. // Barra Horizontal
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:lVScroll := .F. // Barra Ventical
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 oBrw3:nFreeze 聽 聽 聽 := 7
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 For i=1 to 7
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw3:aCols[ i ]:oDataFont := oFont2
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw3:aCols[ i]:nDataStrAlign := AL_CENTER
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw3:aCols[ i ]:cEditPicture := "DD"

聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 Next i
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 WITH OBJECT oBrw3
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 聽 聽 :bLDblClick:={||(Sele_Dia(oBrw3: SelectedCol (): Value,cPro1,cEsp1,otitu1,@cAgendar)),oDlg3:Refresh()} // Aqui mando a la Funcion
聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 END

聽 聽 聽 聽 聽 聽 聽 聽聽聽 聽 聽 聽 oBrw3:CreateFromCode()

聽 聽 聽聽 聽聽 聽 聽 聽 聽@ 18,10 BTNBMP oBoto1 SIZE 10,10 OF oDlg3 PIXEL 2007 Resource "PREV" ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ACTION (Cambia_Mes(Mes1,Ano1,-1,@oBrw3,@otitu3),oBrw3:Refresh(),otitu3:Refresh(),oBoto1:Refresh(),oBoto2:Refresh(),oGroup1:Refresh(),otitu2:Refresh())

聽 聽 聽 聽 聽 聽 聽 聽 聽@ 18,109 BTNBMP oBoto2 SIZE 10,10 OF oDlg3 PIXEL 2007 Resource "NEXT";
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ACTION (Cambia_Mes(Mes1,Ano1,1,@oBrw3,@otitu3),oBrw3:Refresh(),otitu3:Refresh(),oBoto1:Refresh(),oBoto2:Refresh(),oGroup1:Refresh(),otitu2:Refresh())

聽 聽 聽 聽 聽 聽 聽 聽 聽** Segundo Xbrowse Agenda


聽 聽 聽聽 聽聽 聽 聽 聽 聽@ 30,135 XBROWSE oBrw4 SIZE -10,-25 PIXEL OF oDlg3 DATASOURCE "Agen" FONT oFont3 ;
聽 聽 聽聽 聽聽 聽 聽 聽 聽 聽 聽 聽 HEADERS 'Nro','Hora Ate','Nombre del Paciente','R.u.t.','Celular';
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 COLUMNS 'Nro_Hor', 'Hor_Ate','Nom_Pac','Rut_Pac','Cel_Pac';
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 COLSIZES 40, 70, 250, 90, 90;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 PICTURES '999','##:##','@!','@!','@!';
聽 聽 聽 聽 聽 聽 聽 聽 CELL LINES AUTOSORT NOBORDER;
聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:nColDividerStyle := LINESTYLE_INSET
聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:nRowDividerStyle := LINESTYLE_INSET
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:bClrHeader := {|| { nRGB(000,000,000), nRGB(128,255,128) } }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:aCols[2]:bClrHeader := { || { CLR_HRED,CLR_WHITE } }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:aCols[ 2 ]:oDataFont := oFont2

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:aCols[2]:nHeadStrAlign := AL_CENTER 聽 聽 聽 聽 聽
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:aCols[2]:nDataStrAlign := AL_CENTER
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽//oBrw2:nHeadStrAligns := { AL_LEFT, AL_RIGHT, AL_CENTER, ...... } 聽 聽 聽 
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:nOpacity 聽 聽:= 230
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽 聽聽 聽 聽 聽 聽oBrw4:nHeaderHeight 聽 聽 聽:= 35
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw4:nFreeze 聽 聽 聽 := 5
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oBrw4:CreateFromCode()
聽 聽 聽 聽 聽 聽 聽 聽 聽 If cAgendar=="S"
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 @ 200,120 BTNBMP 聽SIZE 55,50 PROMPT "CREA" OF oDlg2 PIXEL 2007 Resource "#8021" FONT oFont1 ; 聽// Aqui debo Mostra Boton
聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ToolTip "GENERA AGENDA"

聽 聽 聽 聽 聽 聽 聽 聽 聽Endif
聽 聽 聽 聽 聽 聽 聽 聽 
聽 聽 聽 聽 聽 聽 聽 ACTIVATE DIALOG oDlg3 CENTERED

Return

Function Sele_Dia(FechaHoy,cPro1,cEsp1,otitu1,cAgemdar)

聽 聽 聽 聽 If Dtoc(FechaHoy)==" 聽/ 聽/ 聽 聽"
聽 聽 聽 聽 聽MsgStop( "Error DIa sin Valor ")
聽 聽 聽 聽 聽 聽 聽return
聽 聽 聽 聽 Endif
聽 聽 聽 聽 If (Dtos(FechaHoy) < Dtos(Date()))
聽 聽 聽 聽 聽 MsgStop( "Error, No puede Seleccionar Fecha Menor a Hoy")
聽 聽 聽 聽 聽 聽 聽 聽 return .f.
聽 聽 聽 聽 Endif
聽 聽 聽 cVar=cPro1 + cEsp1 + Dtos(FechaHoy)
聽 聽 聽 Sele Agen
聽 聽 聽 Agen->(OrdScope(TOPSCOPE, cVar))
聽 聽 聽 Agen->(OrdScope(BOTTOMSCOPE, cVar))
聽 聽 聽 Agen->(DbGotop())
聽 聽 聽 聽 If Eof()
聽 聽 聽 聽 聽 聽 聽cAgendar:="S"
聽 聽 聽 聽 Else
聽 聽 聽 聽 聽 聽 聽cAgendar:="N"
聽 聽 聽 聽 Endif
聽 聽 聽 聽 otitu1:SetText("AGENDAR HORAS FECHA "+dtoc(FechaHoy))
聽 聽 聽 聽 otitu1:UpDate()

聽 聽 聽 聽 Return
FWH 22.10 - HARBOUR - PELLES C
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: Ayuda No puedo Mostrar Boton en Dialogo con Xbrowse
Posted: Mon Dec 02, 2019 10:00 PM
Hola,

Me da la impresi贸n que el di谩logo ya est谩 construido cuando ejecutas la function Sele_Dia() en el bLDblClick del xBrowse. Si he interpretado bien tu c贸digo te sugiero que definas el boton al momento del construir el di谩logo
Code (fw): Select all Collapse
 @ 200,120 BTNBMP 聽oBtnxx SIZE 55,50 PROMPT "CREA"....
y luego con oBtnxx:Hide() o oBtnxx:Show() lo puedes mostrar u ocultar dependiendo el valor de cAgendar.

Tu bLDblClick podr铆a quedar as铆:
Code (fw): Select all Collapse
:bLDblClick:={||(Sele_Dia(oBrw3: SelectedCol (): Value,cPro1,cEsp1,otitu1,@cAgendar)),iif(cAgendar=="S",oBtnxx:Show(),oBtnxx:Hide()),oDlg:Refresh()} // Aqui mando a la Funcion


Es una idea, prueba y me cuentas.

Saludos,



Carlos Gallego



*** FWH-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda No puedo Mostrar Boton en Dialogo con Xbrowse
Posted: Mon Dec 02, 2019 11:11 PM

Hola Carlos

Muchas gracias por tu ayuda y por tu tiempo dedicado.

Funciono PERFECTO.

Muchos Saludos

Antonio

FWH 22.10 - HARBOUR - PELLES C
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: Ayuda No puedo Mostrar Boton en Dialogo con Xbrowse
Posted: Mon Dec 02, 2019 11:28 PM

Antonio, con mucho gusto, y me alegro que te funcionara.

Saludos,



Carlos Gallego



*** FWH-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Continue the discussion