topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
Calendario anual | Un último detalle para TDatePicker -recibido como observación de un cliente- no aparece el 31 de marzo, por lo que deben considerarse 38 columnas y no 37. |
Calendario anual | Aquí os dejo una agenda anual basada totalmente en TPickDate.Si alguien está interesado, el ejecutable puede usarse de forma autonoma, y el PRG junto al RC puede integrarse dentro del propio codigo.El calendario indica la fecha actual y permite marcar tareas (arrastrando o no) de hasta seis tipos diferentes, representados por otros tantos colores, está corregido lo del 31 de Marzo etc.El código que gestiona la agenda está "reciclado" de una antigua aplicación mia, pero que aún es bastante correcto aunque está ahí para mejorarse.[url:v51d7maq]http://cid-6be220caaa0bc6fd.skydrive.live.com/self.aspx/Agenda%20Anual/agenda%20ANUAL.zip[/url:v51d7maq][img:v51d7maq]http://cid-6be220caaa0bc6fd.skydrive.live.com/self.aspx/Agenda%20Anual/CalAnual.jpg[/img:v51d7maq] |
Calendario anual | Excelente, te recomendaría que le hicieras llegar a Otto el fuente con la corrección para que todos vayamos por el mismo rumbo, ya que la idea original fue de él y es quien ha estado recopilando y organizando las modificaciones |
Calendario anual | Marchando..... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
Calendario anual | Tuve necesidad de agregar otros arreglos. Para conservar la esencia de la clase es mejor agregar un método y ya desde el programa pasar las series que se deseen. oPickDate:AddSerie( aDays, nColor, nBrush )He aquí los cambios:[code:bj51cscf]
#Include "FiveWin.ch"
MemVar nClrM // Color principal usado en toda la aplicación
// por definición GetSysColor(2)
CLASS TPickDate FROM TControl
DATA dStart, dEnd, dTemp, lMove
DATA nYear
DATA oBrushSunday, oBrushSelected, oFontHeader
DATA nLeftStart, nTopStart
DATA bSelect
DATA aSeries, aColors // días especiales
CLASSDATA lRegistered AS LOGICAL
METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, nYear, nClrFore, nClrBack )
METHOD Redefine( nId, oWnd )
METHOD Paint()
METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
METHOD Destroy()
METHOD AddSerie()
METHOD LButtonDown( nRow, nCol, nKeyFlags )
METHOD LButtonUp( nRow, nCol, nKeyFlags )
METHOD PreviousYear() INLINE ::nYear--, ::Refresh()
METHOD NextYear() INLINE ::nYear++, ::Refresh()
METHOD EraseBkGnd( hDC ) INLINE 0
METHOD MouseMove( nRow, nCol, nKeyFlags )
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, nYear, nClrFore, nClrBack ) CLASS TPickDate
DEFAULT nWidth := 800,;
nHeight := 300,;
nLeft := 0,;
nTop := 0,;
nYear := Year( Date() ), ;
oWnd := GetWndDefault(),;
nClrM := GetSysColor( 2 )
::lMove = .F.
::nTopStart = 0 // for header
::nLeftStart = 65 // col header
::aSeries = {}
::aColors = {}
::nTop = nTop
::nLeft = nLeft
::nBottom = nTop + nHeight - 1
::nRight = nLeft + nWidth - 1
::nYear = Year( Date() )
::oWnd = oWnd
::dStart := ::dEnd := ::dTemp := Date()
::nClrText = nClrFore
::nClrPane = nClrBack
::nStyle = nOr( WS_CHILD, WS_VISIBLE, WS_TABSTOP, WS_BORDER )
DEFINE BRUSH ::oBrushSunday COLOR LightColor(240,nClrM) // Sundays column
DEFINE BRUSH ::oBrushSelected COLOR nRGB( 240, 232, 188 ) // Selected days
DEFINE FONT ::oFont NAME "MS Sans Serif" SIZE 0, -10 BOLD
DEFINE FONT ::oFontHeader NAME "MS Sans Serif" SIZE 0, -10
#ifdef __XPP__
DEFAULT ::lRegistered := .F.
#endif
::Register()
if ! Empty( oWnd:hWnd )
::Create()
oWnd:AddControl( Self )
else
oWnd:DefControl( Self )
endif
return self
//----------------------------------------------------------------------------//
METHOD Redefine( nId, oWnd ) CLASS TPickDate
DEFAULT oWnd := GetWndDefault(), ;
nClrM:= GetSysColor( 2 )
::nId = nId
::oWnd = oWnd
::lMove = .F.
::nTopStart = 0 // for header
::nLeftStart = 65 // col header
::dStart := ::dEnd := ::dTemp := Date()
::nYear = Year( Date() )
::aSeries = {}
::aColors = {}
DEFINE BRUSH ::oBrushSunday COLOR LightColor(240,nClrM) // Sundays column
DEFINE BRUSH ::oBrushSelected COLOR nClrM // Selected days
DEFINE FONT ::oFont NAME "MS Sans Serif" SIZE 0, -10 BOLD
DEFINE FONT ::oFontHeader NAME "MS Sans Serif" SIZE 0, -10
::SetColor( 0, 0 )
::Register()
oWnd:DefControl( Self )
return Self
//----------------------------------------------------------------------------//
METHOD Paint() CLASS TPickDate
local aInfo := ::DispBegin()
local hDC := ::hDC, cDay, nDay, n, dDate, nColStep, nRowStep
local dTmpDate, nMonth := 0, nLeftCol := 0
local nColor, cDate // para evaluar días especiales
local lBrush, nBrush, oBrush, nI
FillRect( hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
nRowStep = ( (::nHeight-3) - ::nTopStart ) / 13
// Uso de Gradient() en vez de GradientFill()
Gradient( ::hDC, { 0, 0, ::nHeight, ::nWidth }, LightColor(250,nClrM), LightColor(200,nClrM), .T. )
dDate = CToD( "01/01/" + Str( ::nYear, 4 ) )
dDate += 8 - DoW( dDate )
nColStep = ( ::nWidth - ::nLeftStart - 3 ) / 38
Gradient( ::hDC, { 0, 0, nRowStep - 1, ::nWidth }, LightColor(225,nClrM), LightColor(175,nClrM), .T. )
::Say( ( ::nTopStart + ( nRowStep / 2 ) - ( ::oFont:nHeight / 2 )),;
( ( ::nLeftStart + nColStep ) / 2 ) - ( GetTextWidth( hDC, Str( ::nYear, 4 ), ::oFont:hFont ) / 2 ),;
Str( ::nYear, 4 ),,, ::oFont, .T., .T. )
// Paint Sunday background color
for n = 1 to 37 step 7
FillRect( hDC, { 0, ::nLeftStart + ( nColStep * n ),;
::nHeight - 1, ::nLeftStart + ( nColStep * ( n + 1 ) ) }, ::oBrushSunday:hBrush )
next
for nMonth = 1 to 12
::Line( ::nTopStart + nMonth * nRowStep, 0,(::nTopStart + nMonth * nRowStep), ::nWidth - 1 )
::Say( ::nTopStart + nMonth * nRowStep + ( nRowStep / 2 ) - ( ::oFont:nHeight / 2 ), 3, cMonth( RegionDate(nMonth, Str( Year( Date() ), 4 ))) ,,, ::oFont, .T., .T. )
next
// fill selected days
if ::lMove
dTmpDate = Min( ::dStart, ::dEnd )
while dTmpDate <= Max( ::dStart, ::dEnd )
nMonth = Month( dTmpDate )
nLeftCol = ::nLeftStart + ( nColStep * ( DoW( RegionDate( nMonth, Str( ::nYear, 4 ) ) ) ) ) + ;
nColStep * ( Day( dTmpDate ) - 1 )
FillRect( hDC, { ::nTopStart + month(dTmpDate) * nRowStep + 1,;
nLeftCol, ::nTopStart + Month( dTmpDate ) * nRowStep + nRowStep,;
nLeftCol + nColStep}, ::oBrushSelected:hBrush )
dTmpDate++
end
endif
// Draw days
for n = 1 to 37
::Line( 0, ::nLeftStart + ( nColStep * n ), ::nHeight - 1, ::nLeftStart + ( nColStep * n ) )
nColor := if( DoW( dDate ) ==1, CLR_RED, 0 )
cDay = SubStr( CDoW( dDate++ ), 1, 1 )
::Say( ( ::nTopStart + nRowStep * 0.4 )-2,;
::nLeftStart + ( nColStep * n ) + ( nColStep / 2 ) - ( GetTextWidth( hDC, cDay, ::oFont:hFont ) / 2 ) + 1,;
cDay, nColor, 0, ::oFont, .T., .T. )
next
// Draw months
for nMonth = 1 to 12
dDate = RegionDate(nMonth,Str( ::nYear, 4 ) )
nDay = DoW( dDate )
while Month( dDate ) == nMonth
cDay = AllTrim( Str( Day( dDate ) ) )
nColor := 0
lBrush :=.F.
cDate := DtoS( dDate)
// identifica el día y define el pintado
if DoW( dDate ) == 1 // sunday
nColor := CLR_RED
else
FOR nI=1 TO Len(::aSeries)
IF AScan(::aSeries[nI],cDate)<>0
nColor:=::aColors[nI][1]
nBrush:=::aColors[nI][2]
lBrush:=.T.
nI:=Len(::aSeries)
ENDIF
NEXT nI
endif
if !lBrush
if dDate=Date() // current day
nColor := CLR_YELLOW
nBrush := CLR_GREEN
lBrush := .T.
endif
endif
if lBrush
nMonth = Month( dDate )
nLeftCol = ::nLeftStart + ( nColStep * ( DOW( RegionDate( nMonth, Str( ::nYear, 4 ) ) ) ) ) + ;
nColStep * ( Day( dDate ) - 1 )
DEFINE BRUSH oBrush COLOR nBrush
FillRect( hDC, { ::nTopStart + month(dDate) * nRowStep + 1,;
nLeftCol + 1, ::nTopStart + Month( dDate ) * nRowStep + nRowStep,;
nLeftCol + nColStep}, oBrush:hBrush )
oBrush:End()
endif
::Say( ( ::nTopStart + nMonth * nRowStep + ( nRowStep * 0.4 ) )-2,;
::nLeftStart + ( nColStep * nDay++ ) + ( nColStep / 2 ) - ( GetTextWidth( hDC, cDay, ::oFont:hFont ) / 2 ) + 1,;
cDay, nColor, 0, ::oFontHeader, .T., .T. )
dDate++
end
next
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, hDC, Min( ::dStart, ::dEnd ), Max( ::dStart, ::dEnd ), Self )
endif
::DispEnd( aInfo )
return 0
//----------------------------------------------------------------------------//
METHOD Destroy() CLASS TPickDate
::oBrushSunday:End()
::oBrushSelected:End()
::oFontHeader:End()
return Super:Destroy()
METHOD AddSerie( aSerie, nColor, nBrush ) CLASS TPickDate
AAdd( ::aSeries, aSerie )
AAdd( ::aColors, { nColor, nBrush } )
RETURN Len( ::aSeries )
//----------------------------------------------------------------------------//
METHOD LButtonDown( nRow, nCol, nKeyFlags ) CLASS TPickDate
local nMonth := Int( ( nRow - ::nTopStart ) / ( ( ::nHeight - ::nTopStart ) / 13 ) )
local nDay := Int( ( nCol - ::nLeftStart ) / ( ( ::nWidth - ::nLeftStart ) / 38 ) ) - ;
DoW( RegionDate( nMonth, Str( ::nYear, 4 ) ) ) + 1
if nDay > 0 .and. nMonth > 0 // to work with valid dates only
::dStart := CToD( AllTrim( AllTrim( Str( nDay ) )+ "/" + Str( nMonth ) ) + "/" + Str( ::nYear, 4 ) )
::lMove := .T.
::Refresh( .F. )
endif
return Super:LButtonDown( nRow, nCol, nKeyFlags )
//-----------------------------------------------------------------//
METHOD LButtonUp( nRow, nCol, nKeyFlags ) CLASS TPickDate
if ValType( ::bSelect ) == "B"
Eval( ::bSelect, Min( ::dStart, ::dEnd ), Max( ::dStart, ::dEnd ), Self )
endif
::lMove := .F.
return Super:LButtonUp( nRow, nCol, nKeyFlags )
//-----------------------------------------------------------------//
METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TPickDate
local nMonth := Int( ( nRow - ::nTopStart ) / ( ( ::nHeight - ::nTopStart ) / 13 ) )
local nDay := Int( ( nCol - ::nLeftStart ) / ( ( ::nWidth - ::nLeftStart ) / 38 ) ) - ;
DoW( RegionDate( nMonth, Str( ::nYear, 4 ) ) ) + 1
local dEnd
if nDay > 0 .and. nMonth > 0 // to work with valid dates only
dEnd = CToD( AllTrim( Str( nDay ) ) + "/" + AllTrim( Str( nMonth ) ) + "/" + Str( ::nYear, 4 ) )
if ! Empty( dEnd ) .and. dEnd != ::dTemp // for reducing continuous refreshes
::dTemp := dEnd
::dEnd = dEnd
::Refresh( .F. )
if ValType( ::bChange ) == "B"
Eval( ::bChange, Min( ::dStart, ::dEnd ), Max( ::dStart, ::dEnd ), Self )
endif
endif
endif
return Super:MouseMove( nRow, nCol, nKeyFlags )
//-----------------------------------------------------------------//
function RegionDate( nMonth, cYear )
return CToD( "01/" + AllTrim( Str( nMonth ) ) + "/" + cYear )
//-----------------------------------------------------------------//
// LightColor(nDegrade,nColor) para degradar o suavisar color
#pragma BEGINDUMP
#include <Windows.h>
HARBOUR HB_FUN_LIGHTCOLOR( )
{
COLORREF lColor = hb_parnl(2);
LONG lScale = hb_parni(1);
long R = MulDiv(255-GetRValue(lColor),lScale,255)+GetRValue(lColor);
long G = MulDiv(255-GetGValue(lColor),lScale,255)+GetGValue(lColor);
long B = MulDiv(255-GetBValue(lColor),lScale,255)+GetBValue(lColor);
hb_retnl( RGB(R, G, B) );
}
#pragma ENDDUMP
[/code:bj51cscf] |
Calendario anual | Alfredo,Gracias por las mejoras a la Clase TPickDate que hemos desarrollado entre Otto y FiveTech <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Calendario anual | Antonio:¿Por qué no creas un planning a partir de esa clase?. Sería una característica muy buena para la próxima build. |
Calendario desplegado desde recurso | Hola a todos
Cómo se obtiene el valor del calendario desplegado?
[img:w8tk0dk5]http://200.58.176.148/paquetes/calendario.jpg[/img:w8tk0dk5]
que al seleccionar el día luego dar aceptar tome el valor.
[code=fw:w8tk0dk5]<div class="fw" id="{CB}" style="font-family: monospace;"><br />fDia:=Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #0000ff;">REDEFINE</span> DTPICKER oFec <span style="color: #0000ff;">VAR</span> fDia <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> oFec:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>fDia<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /> </div>[/code:w8tk0dk5]
No cambia el valor
Gracias por la ayuda
Saludos
Adhemar |
Calendario en un Get de Fecha | Estimados
Existe alguna funcion que en un Campor Get de Fecha tenga el icono de calendario ?
gracias
salu2
david
argentina |
Calendario en un Get de Fecha | Hola David
Hay Varias funciones de fecha y de calculadoras para ser usadas en los Gets, pero son de terceros.
Pero hay una en que viene en el FWH\SAMPLES
Set include "fivewin.ch"
set include "dtpicker.ch"
Local Xfein
.
.
.
@1,1 DTPICKER Xfein of oDlg
lo utilizas como un get, espero que sea lo que buscas.
Dioni, Lima Peru |
Calendario en un Get de Fecha | Muchas gracias amigo...
Una consulta, con esa clase, pierdo la capacidad de cargar la fecha como el Get normal de una fecha, ose a medida que escriba dicha fecha pase desde dia al mes sin correrme con la fecha ?
gracias
david
argentina |
Calendario en un Get de Fecha | David,
[code=fw:gy2abg9a]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> dFecha <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@d"</span> <span style="color: #0000ff;">ACTION</span> fechas<span style="color: #000000;">(</span><span style="color: #000000;">)</span> BITMAP <span style="color: #ff0000;">"CALENDARIO"</span></div>[/code:gy2abg9a]
fechas es una función donde desplegaras el calendario o una que ya tengas elaborada. |
Calendario en un Get de Fecha | William
En la Funcion Fecha() cómo mostraria el calendario que muestra el Datepicker?
Gracias por la ayuda
Saludos
Adhemar |
Calendario en un Get de Fecha | Adhemar,
Propiamente no seria el DATEPICKER. Pero podría ser el calendario que hay varios de terceros o puedes hacer el propio.
es cuestión de buscarle cual calendario queda. |
Calendario en un Get de Fecha | Gracias, distinguido
Saludos
Adhemar |
Calendario integrado a Google Calendar | El ejemplo no es funcional.
Saludos |
Calendario integrado a Google Calendar | ¡Hola
Recientemente se han desarrollado un calendario integrado con el calendario de Google
Fue desarrollado utilizando el método de autenticación OAuth 2.0 Google que es la nueva forma de autenticación para utilizar Google simbólico.
Algunas de las imágenes:
Permiso:
[img:hkxsejs0]http://imagizer.imageshack.us/v2/640x480q90/922/IjvZTb.jpg[/img:hkxsejs0]
Pantalla de inicio:
[img:hkxsejs0]http://imagizer.imageshack.us/v2/640x480q90/921/81RT2K.jpg[/img:hkxsejs0]
Detalles:
[img:hkxsejs0]http://imagizer.imageshack.us/v2/640x480q90/921/dswGwA.jpg[/img:hkxsejs0]
La aplicación completa tiene el control con base de datos local.
La plena aplicación tiene control con la base de datos local.
Para mysql está listo, pero es fácilmente adapdata a cualquier otro tipo de base de datos (DBF, Postgres, etc).
Estoy vendiendo el código de la aplicación para poder incluir el orden del día en su aplicación
El método de autenticación OAuth 2.0 se puede utilizar para cualquier otra integración con Google.
Para ejecutar el modo DEMO:
* Debe crear un proyecto API de Google: [url:hkxsejs0]https://console.developers.google.com/apis/[/url:hkxsejs0]
* Habilitar la API de Google Calendar
* Crear credenciales "ID de cliente de OAuth 2.0." En tipo de aplicación, elegir la opción "Otros".
* Ejecutar descargar el archivo JSON y cambie su nombre por "client_id.json".
* Ponga junto con la solicitud
** Para facilitar la aplicación del modo de demostración, me puse mi archivo "CLIENT_ID.JSON" para descargar. Pero es por un período limitado.
Descargar: [url:hkxsejs0]https://bitbucket.org/wmanesco/schedule/downloads/client_id.json[/url:hkxsejs0]
Para comprar el código de correo electrónico para <!-- e --><a href="mailto:manesco.william@gmail.com">manesco.william@gmail.com</a><!-- e -->
Cualquier problema o duda, enviar correo electrónico o responder aquí
Gracias
Descargar: [url:hkxsejs0]https://bitbucket.org/wmanesco/schedule/downloads/Schedule.rar[/url:hkxsejs0] |
Calendario integrado a Google Calendar | Ese error está pasando? Publica aquí para ver |
Calendario integrado a Google Calendar | Para facilitar la aplicación del modo de demostración, me puse mi archivo "CLIENT_ID.JSON" para descargar. Pero es por un período limitado.
[url:3uvb11xv]https://bitbucket.org/wmanesco/schedule/downloads/client_id.json[/url:3uvb11xv] |
Calendario integrado a Google Calendar | Ahora si funciona.
Saludos |
Calendario integrado a Google Calendar | Este archivo debe ser generado para cada aplicación.
Es a través de él que es controlado para limitar la búsqueda por día, si no me equivoco es de 1.000.000 de consultas por día.
También tiene la opción de no usar un archivo y obtener la información necesaria y mantenemos fijas en el código. |
Calendario para dias festivos | Amigos:
Necesito mostrar un calendario de 12 meses en donde el usuario pueda seleccionar
los días festivos del año.
He visto que en Pelles existe un control llamado CALENDAR, alguien lo ha usado?
tendrá un ejemplo?
También he visto la clase TCalex (me parece que es de Daniel García) pero creo
que va más orientado a crear agendas, o me equivoco?, y no es precisamente lo
que necesito.
Saludos |
Calendario... | Hola a todos...
Me gustaria saber si existe alguna clase para mostrar un pequeño calendario y como debo usarla....
Saludos y gracias..
Elías Torres. |
Calendario... | Puedes usar DatePicker, busca en la ayuda DTPicker y veras como usarlo. Utiliza el calendario del sistema y es lo mas rapido y elegante.
Yo hice una adaptación de MsgDate de FiveWin, es bastanten mas lento que DatePicker, aunque me permite un mayor control. La verdad es que no la suelo usar, pero por si te vale aqui tienes el fuente.
[code:1a3ynyof]//---------------------------------------
FUNCTION MsgDate( dDate, cPrompt,oGet )
//----------------------------------------
local oDlg, oFont, oCursor, dSelect
local nRow, nCol, nMonth, aMonths:={},nYear,cDay:=' '
local cOldMode := Set( _SET_DATEFORMAT,;
If( __SetCentury(), "dd/mm/yyyy", "dd/mm/yy" ) )
IF Empty(dDate)
dDate:=Date()
ENDIF
FOR nMonth = 1 to 12
AAdd( aMonths, CMonth( CToD( "01/"+padl( nMonth, 2 ) + "/98")))
NEXT nMonth
nMonth := Month( dDate )
nYear := Year(dDate)
dSelect := dDate
DEFINE FONT oFont NAME GetSysFont() SIZE 0, -10
DEFINE DIALOG oDlg SIZE 200, 190 TITLE cPrompt FONT oFont // -> 6 weeks
oDlg:SetText(IF(cPrompt==NIL,dDateToString( dDate ),cPromt))
@ 0.32, .70 COMBOBOX nMonth ITEMS aMonths SIZE 40,90 OF oDlg ;
ON CHANGE MoveCalendar(oDlg, 1, nMonth )
@ 6.6, 60 BTNBMP PROMPT "-" SIZE 8,8.3 ACTION ( MoveCalendar(oDlg, 3 ))
@ 6.6, 86 BTNBMP PROMPT "+" SIZE 8,8.3 ACTION ( MoveCalendar(oDlg, 4 ))
@ 0.42, 8.7 GET nYear PICTURE "9999" SIZE 14, 9 OF oDlg WHEN .F.
ATail( oDlg:aControls ):Cargo = "YEAR"
dDate-= Day( dDate ) - 1
while DoW( dDate ) != 2 // Monday
dDate --
enddo
FOR nCol:=1 TO 7
cDay+=SubStr(CDoW(dDate++),1,3)+Space(4)
NEXT
dDate-=7
@ 1.3,0 SAY cDay COLOR CLR_WHITE, CLR_HBLUE SIZE 110,6
for nRow = 3 to 8
for nCol = 1 to 7
@ nRow * 10, ( nCol * 14 ) - 12 BTNBMP ;
PROMPT Str( Day( dDate ), 2 ) SIZE 12, 10 NOBORDER ;
ACTION ( dDate := ::Cargo, oDlg:End( IDOK ) )
ATail( oDlg:aControls ):Cargo = dDate
ATail( oDlg:aControls ):nClrText = If( dDate == Date(), CLR_HRED,;
If( dDate == dSelect, CLR_HBLUE, If( Month( dDate ) == nMonth,;
CLR_BLACK, CLR_GRAY ) ) )
IF ATail( oDlg:aControls ):Cargo == dSelect
ATail( oDlg:aControls ):lPressed = .t.
ENDIF
dDate++
next
next
dDate:=dSelect
oDlg:Cargo:=dDate
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oDlg:aControls[ 3 ]:SetFocus() )
IF oGet != NIL
oGet:VarPut( If( oDlg:nResult == IDOK, dDate, dSelect ) )
oGet:Refresh()
ENDIF
Set( _SET_DATEFORMAT, cOldMode )
RETURN If( oDlg:nResult == IDOK, dDate, dSelect )
//----------------------------------------------
STATIC FUNCTION MoveCalendar( oDlg, nMode, nVar)
//----------------------------------------------
local dSelect := oDlg:Cargo
local n
local nFirstButton := 0
local nLastButton := 0
local nDate := 0
local nSkip := 0
local nPYear := 0
local nDay, nMonth, nYear
local dWork
local nDays := 0
for n := 1 TO Len( oDlg:aControls )
if oDlg:aControls[ n ]:ClassName() == "TBTNBMP"
nFirstButton := If( nFirstButton == 0, If(nSkip<2, 0, n), nFirstButton )
nLastButton := n
nSkip++
oDlg:aControls[ n ]:lPressed := .F.
endif
if ValType( oDlg:aControls[ n ]:Cargo ) == "C"
if oDlg:aControls[ n ]:Cargo == "YEAR"
nPYear := n
endif
endif
next n
nDay := Day( dSelect )
nMonth := Month( dSelect )
nYear := Year( dSelect )
do case
case nMode == 1 //Cambio de mes
nMonth := nVar
case nMode == 3
nYear --
case nMode == 4
nYear ++
ENDCASE
dSelect := CToD( padl( nDay, 2) + "/"+padl( nMonth, 2 ) + "/"+right(padl( nYear, 4 ), 2))
WHILE Empty(dSelect) //Retorcede hasta fecha vailida
dSelect := CToD( padl( --nDay, 2) + "/"+padl( nMonth, 2 ) + "/" +right(padl( nYear, 4 ), 2))
END
cLongDate := dDateToString( dSelect )
oDlg:SetText(cLongDate)
oDlg:aControls[ nPYear ]:VarPut( nYear)
dWork := Ctod( "01/" + padl( nMonth, 2 ) + "/" + right(padl( nYear, 4 ), 2))
while DoW( dWork ) > 1
dWork --
enddo
for n := nFirstButton TO nLastButton
oDlg:aControls[ n ]:SetText( Str( Day( dWork ), 2 ) )
oDlg:aControls[ n ]:Cargo = dWork
oDlg:aControls[ n ]:nClrText = If( dWork == Date(), CLR_HRED,;
If( dWork == dSelect, CLR_HBLUE, If( Month( dWork ) == nMonth,;
CLR_BLACK, CLR_GRAY ) ) )
if dWork == dSelect
oDlg:aControls[ n ]:lPressed = .T.
endif
dWork++
next n
for n := 1 TO Len( oDlg:aControls )
oDlg:aControls[ n ]:Refresh()
next n
oDlg:Cargo := dSelect
return nil
[/code:1a3ynyof]
Modo de uso , coloco un boton pequeño a la derecha del GET con el siguiente código.
[code:1a3ynyof]REDEFINE BUTTON ID 4 OF oDlg ACTION (MsgDate( dFecha,,oGetFec))[/code:1a3ynyof] |
Calendario... | Gracias Biel, pero tengo un problema a la hora de usarlo.... Vamos a ver si utilizo el código que me has mandado me da un error al compilar algo asi como:
"unresolved external symbol HB_FUN_DDATETOSTRING..."
es decir que la funcion datetostring() no me la reconoce. Por otro lado no encuentro la ayuda sobre DTPicker....He visto que FW tiene una propia llamada msgdate() pero tampoco me la reconoce. Supongo que a lo mejor tengo que incluir algun "include" pero nose cual es...
Saludos.
Elías Torres. |
Calendario... | Hola Elias,
parece que se me olvido de poner la funcion dDateToString. Aqui la tienes.
[code:1isv45pv]//------------------------------------
static function dDateToString( dDate )
//------------------------------------
local cSay := CDoW( dDate ) + ", " + ;
Str( Day( dDate ), 2 ) + " " + ;
CMonth( dDate ) + " " + ;
Str( Year( dDate ), 4 )
return cSay[/code:1isv45pv]
Referente a DTPicker, en Fivewin comands guide, en la pestaña busqueda, dtpicker.
[quote:1isv45pv]Include file: DTPICKER.CH
Creating a DTPICKER from source code
@ <nRow>, <nCol> DTPICKER [ <oDTPicker> VAR ] <uVar> ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ COLOR | COLORS <nClrText> [,<nClrBack> ] ] ;
[ SIZE <nWidth>, <nHeight> ];
[ FONT <oFont> ] ;
[ DESIGN ] ;
[ CURSOR <oCursor> ] ;
[ PIXEL ] ;
[ UPDATE ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
[ ON CHANGE <uChange> ] ;
[ HELPID | HELP ID <nHelpId> ]
Using a DTPicker from a resource Dialog Box
REDEFINE DTPICKER [ <oDTPikcer> VAR ] <uVar> ;
[ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ COLOR | COLORS <nClrText> [,<nClrBack> ] ] ;
[ VALID <ValidFunc> ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ ON CHANGE <uChange> ] ;[/quote:1isv45pv]
Desde código
[code:1isv45pv]
LOCAL dTmp:=Date()
@ 1, 1 DTPICKER dTmp SIZE 50, 12 OF oDlg[/code:1isv45pv] |
Calendario... | Biel, gracias por la ayuda. Te comento lo que me ocurre...
Al utilizar msgdate(), me muestra el calendario, pero al avanzar de mes y luego retroceder, el año me lo cambia y en vez de poner 2007 me pone 1907... Y a parte me da un error en una variable, concretamente en IDOK cuando pulso sobre el dia que quiero, me dice que esa variable no existe.
Otra duda que me ha surgido, se supone que ya está implementado la clase msgdate(), pero debo poner todo el codigo en mi programa para que me lo muestre. No me bastaría con llamar a esa funcion solamente?...
Alguna sugerencia?
Saludos y gracias.
Elías Torres. |
Calendario... | Hola Elias,
incluye las siguientes lineas en tu programa.
Al inicio de la aplicacion
[code:394n8rk4]Set EPOCH TO 1919[/code:394n8rk4]
y en el prg donde hayas colocado los fuentes de msgdate
[code:394n8rk4]#define IDOK 1[/code:394n8rk4]
Y creo que con esto ya te funcionara correctamente.
De todas formas prueba el DTPicker que esta muy bien, y es el calendario nativo del sistema operativo.
Referente a lo que comentas de si hace falta incluir los fuentes, pues en la versión que tengo yo de FWPPC que no es la última, msgdate no estaba implementado, por tanto, si es necesario, en la tuya si ya esta implementado, no haria falta incluir los fuentes. |
Calendario... | Gracias Biel, probaré lo que me comentas y tambien la otra opcion..
Ya te diré que tal..
Saludos.
Elías Torres. |
Calendarios Google - Uso | Hola a todos,
Estaba pensando en usar la libreria REST para Google de Cristóbal Navarro (gracias Sr. Cristóbal por la conferencia y la librería)
Así pues, lo que pretendo es que en mi programa de escritorio se puedan editar las citas y luego se puedan ver y compartir a través de INet.
¿ Como hacerlo ? ¿ Descargando el calendario y editandolo en el escritorio con fwh el calendario y luego subiendo las modificaciones ?
Alguna idea, pls. Gracias. |
Calendarios Google - Uso | Exactamente como has dicho
Has de realizar una interfaz ( UI ) para la introduccion de datos y a partir de ahi enviarlo al calendario
Algo asi
[img:3p5vj585]https://s9.postimg.cc/e8ulg4pen/calend1.png[/img:3p5vj585]
[img:3p5vj585]https://s9.postimg.cc/5dtr5m8bz/calend2.png[/img:3p5vj585]
Cuando tengas la introducción de datos lo vemos, si necesitas algo mas |
Calendarios con agenda | Hola a todos,
Cual creeis que es la mejor opcion para un calendario con agenda ?
Microsoft Outlook manejado con Ole
Google-calendars con su Api
Cualquiera de las multiples clases que la gente generosamente ha cedido a este foro.
Viendo Microsoft-Outlook veo que tiene de todo, es la pera limonera... y me hace preguntarme que si es el mejor pq usar otro ? Pero quiza tambien sea demasiado complejo o tenga demasiadas cosas..
La TDatePicker que desarrollaron Otto y Antonio Linares tiene la ventaja que ves todo un año en la pantalla y eso me gusta...
En fin... que no se que hacer...
Saludos |
Calendarios con agenda | [quote="hmpaquito":2xlv2qji]
La TDatePicker que desarrollaron Otto y Antonio Linares tiene la ventaja que ves todo un año en la pantalla y eso me gusta...
En fin... que no se que hacer...
Saludos[/quote:2xlv2qji]
Primero que nada, has de buscar algo que cubra tus necesidades. Elegir herramientas tan completas como outlook, etc. suele traer la complicación que requiere para un usuario aprender esa herramienta y su funcionamiento. Yo soy de la política de "hacer lo justo y necesario" para las aplicaciones. Es el usuario quien debe decir qué necesita y quiere. Indudablemente con herramientas muy completas y complejas, una aplicación gana mucho valor, pero creo que siempre debemos tener en cuenta que eso trae complejidad de manejo para el usuario.
Por otro lado, outlook, google calendar, etc. son herramientas de terceros, lo cual es algo que obliga a una dependencia de terceros, de lo que todos solemos huir como alma que lleva el diablo. Imaginas que mañana Microsoft o Google cambian cualquier tipo de tratamiento en sus herramientas? Mínimo te tocaría recompilar tu aplicación... sino reconstruir un módulo por completo.
Yo en este aspecto, el de un calendario con agenda, lo tendría bastante claro, la TDatePicker de Otto y Antonio. La puedes mejorar, modificar y no dependes de terceros, sino de tí mismo, pudiéndole dar la complejidad que quieras al usuario.
No te aporto nada más que una simple opinión...
Suerte para este 2009!!!!!
Saludos! |
Calendarios con agenda | triumvirato,
Gracias por responder....
La ventaja de usar herramientas tipo Office es que el usuario puede pensar... que programa mas listo tengo que se "entiende" con los programas de Microsoft. Las desventajas: las que tu comentas !
La desventaja del calendar de Otto y Antonio es que hay que hacer un estimable trabajo de programacion y nunca quedara tan "fino" (bonito) como lo de MsOutlook (requeriria mucho trabajo conseguirlo)
Saludos
[quote="triumvirato":3orryhre][quote="hmpaquito":3orryhre]
La TDatePicker que desarrollaron Otto y Antonio Linares tiene la ventaja que ves todo un año en la pantalla y eso me gusta...
En fin... que no se que hacer...
Saludos[/quote:3orryhre]
Primero que nada, has de buscar algo que cubra tus necesidades. Elegir herramientas tan completas como outlook, etc. suele traer la complicación que requiere para un usuario aprender esa herramienta y su funcionamiento. Yo soy de la política de "hacer lo justo y necesario" para las aplicaciones. Es el usuario quien debe decir qué necesita y quiere. Indudablemente con herramientas muy completas y complejas, una aplicación gana mucho valor, pero creo que siempre debemos tener en cuenta que eso trae complejidad de manejo para el usuario.
Por otro lado, outlook, google calendar, etc. son herramientas de terceros, lo cual es algo que obliga a una dependencia de terceros, de lo que todos solemos huir como alma que lleva el diablo. Imaginas que mañana Microsoft o Google cambian cualquier tipo de tratamiento en sus herramientas? Mínimo te tocaría recompilar tu aplicación... sino reconstruir un módulo por completo.
Yo en este aspecto, el de un calendario con agenda, lo tendría bastante claro, la TDatePicker de Otto y Antonio. La puedes mejorar, modificar y no dependes de terceros, sino de tí mismo, pudiéndole dar la complejidad que quieras al usuario.
No te aporto nada más que una simple opinión...
Suerte para este 2009!!!!!
Saludos![/quote:3orryhre] |
Calendário DTPicker em BTNGET é possível ? | Amigos é possível chamar o calendário da classe DTPicker de um BTNGET?
EX?
REDEFINE BTNGET oget[17] var DATA ID 102 OF oFld resource "LUPA" ACTION( DTPICKER ???? ) <---É POSSÍVEL ?
AMIGOS SE FOR POSSÍVEL, COMO DEVO FAZER PARA FUNCIONAR ?
AOKISANTOS |
Calendário DTPicker em BTNGET é possível ? | up !!!! |
Calendário DTPicker em BTNGET é possível ? | up!!! |
Calendário DTPicker em BTNGET é possível ? | Antonio não é possível ? <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> |
Call C function from Clipper .PRG | I have created a function in C that I want to call from a PRG clipper code.Clipper Code:[code:2lwt9rwv]MsgInfo( "In Clipper Prog" )
::oRect := CRect():New( GetWorkRect(), 'Options',,, .t. ) // SPI_GETWORKAREA
[/code:2lwt9rwv]
[b:2lwt9rwv]GetWorkRect() is the function that I have created in C:[/b:2lwt9rwv]
[code:2lwt9rwv]#include <extend.api>
#include <ClipApi.h>
// #include <WinSock.h>
#include <fwmsgs.h>
typedef struct _RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;
BOOL
SystemParametersInfoA(
UINT uiAction,
UINT uiParam,
PVOID pvParam,
UINT fWinIni);
/*
* GetWorkRect()
*
* Wrapper to SystemParametersInfo(SPI_GETWORKAREA,...
* Retrieves the size of the work area on the primary display monitor.
* The work area is the portion of the screen not obscured by the system taskbar
* or by application desktop toolbars. The pvParam parameter must point to a RECT
* structure that receives the coordinates of the work area, expressed in virtual
* screen coordinates.
*/
CLIPPER GETWORKREC() // --> { nTop, nLeft, nBottom, nRight }
{
RECT rct;
rct.top = 0;
rct.left = 0;
rct.bottom = 0;
rct.right = 0;
#define SPI_GETWORKAREA 48
SystemParametersInfoA(SPI_GETWORKAREA,0,&rct,0);
hb_reta( 4 );
_storni( rct.top, (WORD)-1, 1 );
_storni( rct.left, (WORD)-1, 2 );
_storni( rct.bottom, (WORD)-1, 3 );
_storni( rct.right, (WORD)-1, 4 );
}
[/code:2lwt9rwv]
[b:2lwt9rwv]When I link using vc98 results are:[/b:2lwt9rwv]
[code:2lwt9rwv]c:\dev\pcr5>link @KEYLESS\build\pcrHBH.lnk /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:libcmt /LIBPATH:C:\HarbourM\lib /OUT:C:\DEV\PCR5\KEYLESS\EXE\HB\PCREGW.EXE
hbrtl.lib(tgetint.obj) : warning LNK4006: _HB_FUN_GETNEW already defined in FiveHM.lib(TCLIPGET.obj); second definition ignored
hbw32.lib(win_dll.obj) : warning LNK4006: _HB_FUN_CALLDLL already defined in FiveHCM.lib(CALLDLL.obj); second definition ignored
CPCREG.OBJ : error LNK2001: unresolved external symbol _HB_FUN_GETWORKRECT
COPYDATA1.obj : error LNK2001: unresolved external symbol "int __cdecl SystemParametersInfoA(unsigned int,unsigned int,void *,unsigned int)" (?SystemParametersInfoA@@YAHIIPAXI@Z)
C:\DEV\PCR5\KEYLESS\EXE\HB\PCREGW.EXE : fatal error LNK1120: 2 unresolved externals
[/code:2lwt9rwv][b:2lwt9rwv]Question 1:[/b:2lwt9rwv]How do I resolve the unresolved external? I do include the GetWorkRect OBJ file in the link.[b:2lwt9rwv]Question 2:[/b:2lwt9rwv]How do I resolve the problem with SystemParametersInfoA?Just to be sure, I did remove the reference to SystemParametersInfoA and complied the OBJ again. When I link with that OBJ, I only have the first unresolved external _HB_FUN_GETWORKRECT.[b:2lwt9rwv]Question 3:[/b:2lwt9rwv]I'd like to get rid of the warnings, but for now, I'm still able to run the resulting EXE if I delete the code that creates the unresolved Externals up to the point where I call the MsgInfo() function.Thanks, Paul |
Call C function from Clipper .PRG | [quote="paulrhanson":3rlc2gq3]Question 2: How do I resolve the problem with SystemParametersInfoA?
[/quote:3rlc2gq3]Hi Paul:Here you are a working sample (compiled with xHarbour and borland):[code:3rlc2gq3]#include "FiveWin.ch"
function Main()
local oDlg, ;
aRect := GetWorkRect()
DEFINE DIALOG oDlg From 00,00 to 400,500 TITLE "Work Rect" PIXEL OF oDlg COLORS CLR_BLACK,CLR_WHITE
@ 10, 10 SAY "1=" + cValToChar( aRect[ 1 ] ) OF oDlg SIZE 50, 10 PIXEL
@ 20, 10 SAY "2=" + cValToChar( aRect[ 2 ] ) OF oDlg SIZE 50, 10 PIXEL
@ 30, 10 SAY "3=" + cValToChar( aRect[ 3 ] ) OF oDlg SIZE 50, 10 PIXEL
@ 40, 10 SAY "4=" + cValToChar( aRect[ 4 ] ) OF oDlg SIZE 50, 10 PIXEL
ACTIVATE DIALOG oDlg CENTERED
Return nil
#pragma BEGINDUMP
#include <Windows.h>
#include <ClipApi.h>
#include <WinUser.h>
BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni) ;
/*
* GetWorkRect()
*
* Wrapper to SystemParametersInfo(SPI_GETWORKAREA,...
* Retrieves the size of the work area on the primary display monitor.
* The work area is the portion of the screen not obscured by the system taskbar
* or by application desktop toolbars. The pvParam parameter must point to a RECT
* structure that receives the coordinates of the work area, expressed in virtual
* screen coordinates.
*/
HB_FUNC( GETWORKRECT ) // --> { nTop, nLeft, nBottom, nRight }
{
RECT rct;
rct.top = 0;
rct.left = 0;
rct.bottom = 0;
rct.right = 0;
SystemParametersInfoA( SPI_GETWORKAREA, 0, &rct, 0 ) ;
hb_reta( 4 );
_storni( rct.top, -1, 1 );
_storni( rct.left, -1, 2 );
_storni( rct.bottom, -1, 3 );
_storni( rct.right, -1, 4 );
}
#pragma ENDDUMP
[/code:3rlc2gq3]Regards.Manuel Mercado |
Call C function from Clipper .PRG | Dear Mr Mercado,Thanks! I'm rather new at this and have aquired a rather complex set of source code that I'm trying to convert from regular FW to FWH. So I'm learning all at once.Could you please provide for me the method of compile commands and link commands. Do you use the standard Fivetech buildh.bat to compile and link?Thanks again, Paul |
Call C function from Clipper .PRG | [quote="paulrhanson":1xt31sbw]Could you please provide for me the method of compile commands and link commands. Do you use the standard Fivetech buildh.bat to compile and link?[/quote:1xt31sbw]Building the posted sample I used the standard BuildX.bat from \fwh\samples. I haven't tried with Harbour (BuildH.bat)Regards.Manuel Mercado |
Call Center - Slow Application Launch | [b:248muoxd]Slow Application Launch [/b:248muoxd]
When I start my application for the first time after booting the computer (W7 and Linux-Wine) or just reboot the machine, the application needs about 1 to 2 minutes to show the first dialog (main application screen).
After then, at each subsequent application start, the first dialog (main application screen) is shown in about 5-6 seconds.
On the main application dialog, there are several folders/tabs (about 12). Each folder/tab contains 10-15 buttons.
I have an impression that working with many [b:248muoxd]folders/tabs[/b:248muoxd] is quite slow.
My machine contains i7 processor and a lot of memory so I would say it is not the processor/memory problem.
The same problem on pure W7 machine and on Linux/Wine combination
Anyone have an experience with slow running applications which uses folders/tabs?
Any suggestion appreciated
Thanks
[url=http://www.image-share.com/ijpg-2597-232.html:248muoxd][IMG=http://www.image-share.com/upload/2597/232m.jpg][/url:248muoxd]
xHB 2011E , FWH_10.5 |
Call Center - Slow Application Launch | Dubrabko,
Maybe your app manages too much controls, but that should not affect that much.
You are using old xHB and FWH versions. I would suggest to upgrade and use the most recent code, and please consider to migrate to Harbour as that could make an important difference.
Harbour has greatly improved along these years. All of you should realize that using an old version of xHarbour/Harbour does not help you at all. A lot of work has been done on Harbour (and on FWH) and the current version (3.2) works really fine.
I can't say for sure that is the reason of the slowness that you comment, but for sure, you should notice a difference if you use the most recent Harbour and FWH. |
Call Center - Slow Application Launch | Slowness is directly related to the memory management, and Harbour has improved so much on that area.
Maybe there are other factors too that we may review. But lets first discard that the problem does not come from using those old versions. Thanks |
Call Center - Slow Application Launch | Metro
Looks like a nice app .. what back end database are you using .dbf or Ado?
Rick Lipkin |
Call Center - Slow Application Launch | Antonio, Rick
Thanks for the quick reply.
Application when starting, really works well and quickly
Yeah, I'm thinking about crossing the Harbour, but I'm not sure I have a [b:1r1e1bzk]good solution for working with MySQL database[/b:1r1e1bzk]!
The first version, works with a PgSQL - (Xbase language) which proved to be slow and unstable. (50 USER, 2 million records). The problem was to work with indexes. So I switched to natural SQL without Xbase language.
The second version works with MySQL database and xHarbour use for connection to the database and everything else is the SQL syntax (nErr = osql: exec (cSql, ...)) |
Call Center - Slow Application Launch | Sharing my experiences:
This has nothing to do with FWH, xHb/xHarbour/Harbour. Whatever we use the result will not be much different.
Initially sometime is taken to establish connection with the remote server, opening some tables and reading some data necessary to start the initial main window. It is here the delay occurs and we need to optimize this part. This time mostly depends on the connection speeds, the amount of data we read. We should be *extremely* cautious when dealing with huge tables. When opening very large tables, never to open without where clause so that only a small subset is read.
We need to measure the time it takes from "function Main()" till "ACTIVATE WINDOW/DIALOG". This is the time we need to optimize and this has nothing to do with fwh or (x)Harbour. This may depend on what library we are using to communicate with the Sql server and what are we doing initially (what tables we are opening and reading).
Even after the best optimization, this process does take a few seconds, and even that delay is not acceptable for good user experience. In such cases we can adopt one the following strategies suitable to our application.
1. Display a progress message while doing the initial setup. Or display a logo and in the background do the initial setup.
2. Display the main window without data and display progress messase while doing the initial setup. |
Call Center - Slow Application Launch | Yes, I agree with Rao. What he explains makes perfect sense and I missed to consider it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Call Center - Slow Application Launch | Rao,
Thank you for your experience
I will describe the flow of the program:
[code=fw:247e56tu]<div class="fw" id="{CB}" style="font-family: monospace;"><br />/ / ----------------------------<br /><span style="color: #00C800;">Function</span> Main <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> InitSys <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DefTableName <span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">if</span> TestConecction <span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">if</span> SysLogin <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> MainApp <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> / / Msg<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">Return</span><br /> / / ----------------------------<br /> MainApp <span style="color: #00C800;">function</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndCRM<br /><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWndCRM <span style="color: #0000ff;">TO</span> cMesage <span style="color: #B900B9;">//x ---------------> With this message I am presenting the message of progress</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> <span style="color: #0000ff;">ON</span> oWndCRM DefDlg <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span><br /> / / ----------------------------<br /> DefDlg <span style="color: #00C800;">function</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"PHONENEW_WIDE"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">ID</span> xxx <span style="color: #0000ff;">OF</span> oDlg<br /> <span style="color: #B900B9;">// x ------------------------------> Here's delay</span><br /> Def_Fold1 <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// x ------------------------------> or here</span><br /><br /> Def_Fold1 <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//x ------------------------------> or here</span><br /> <span style="color: #B900B9;">//...</span><br /><br /> Def_Fold16 <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /> <span style="color: #00C800;">Return</span><br /> / / ----------------------------<br /> </div>[/code:247e56tu]
The delay is always at forming Folder!
In the first version (PgSQL) I used (xHarbour) and accessing the tables on Xbase way. As dbf-bases (So-open, seek, append, reclock, ....) And then that happened, just what you are suggesting. Very slow and unstable.
In the second version (MySQL) using xHarbour exclusively for connection to the server (localhost, network, remout-SSH). manipulation of data across functions [b:247e56tu]nErr = osql: exec (cSql, ...)[/b:247e56tu], where cSql pure SQL syntax. I work exclusively with the array. It works very fast and stable.
I think it is well settled with the notification:
SET MESSAGE OF oWndCRM TO cMesage
Best regards |
Call Center - Slow Application Launch | Initial setap is completely finished, and the connection to the database until it comes to SysLogin() functions .
[url=http://www.image-share.com/ijpg-2598-179.html:1vp7a13g][IMG=http://www.image-share.com/upload/2598/179m.jpg][/url:1vp7a13g]
[i:1vp7a13g]2-Display the main window without data and display progress messase while doing the initial setup.[/i:1vp7a13g]
The main window is formed without data. I just checked the log-in username / password. |
Call Center - Slow Application Launch | Dubrabko,
A possible solution is not to redefine all the controls in all the folder pages at the same time:
1. Just build the first page (the one that it is visible).
2. When a different folder tab is clicked, then you could check if it has been defined such folder tab (use a static variable or so to control it, or check if oFld:aDialogs[ x ] length is zero) and then redefine it.
This way you don't build everything at once.
I have not tested it myself, but it should work. Please try it and if you get troubles, then I will explain you an alternative way to redefine the controls in each tab (the idea would be to use Class TFolder METHOD LoadPages( aResNames, bRedefineControls )) |
Call Center - Slow Application Launch | Antonio,
I created only one folder, but the problem is about the same.
After reset the computer, the first time delay 4 min and every next start almost immediately.
[url=http://www.image-share.com/ijpg-2600-42.html:2weiuz57][IMG=http://www.image-share.com/upload/2600/42m.jpg][/url:2weiuz57]
Best regards
Dubravko Basic |
Call Center - Slow Application Launch | [quote="metro":1gb9pbir]Antonio,
I created only one folder, but the problem is about the same.
After reset the computer, the first time delay 4 min and every next start almost immediately.
[url=http://www.image-share.com/ijpg-2600-42.html:1gb9pbir][IMG=http://www.image-share.com/upload/2600/42m.jpg][/url:1gb9pbir]
Best regards
Dubravko Basic[/quote:1gb9pbir]
You are showing some data in the browse box on left.
How are you reading the data? From what table? What is your Sql? |
Call Center - Slow Application Launch | Rao,
The system works with a MySQL database.
There are several modes of operation.
1 - Free Mode
The agent logs on to the system and gain FrontEnd
[url=http://www.image-share.com/ijpg-2600-81.html:184o2pxp][IMG=http://www.image-share.com/upload/2600/81m.jpg][/url:184o2pxp]
From the admin gets the task (Combobox - contry, Conty, Town addres ... etc). Once selected, press the button Refresh. The program is only now reads data from a table and displays the brows.
2 - Job Mode
Agent when logging select job that will work.
[url=http://www.image-share.com/ijpg-2600-80.html:184o2pxp][IMG=http://www.image-share.com/upload/2600/80m.jpg][/url:184o2pxp]
Applications, before forming folder prepare array data (arraj variable is public). By measuring I found that it takes a very short time.
After logging gain FrontEnd:
[url=http://www.image-share.com/ijpg-2600-42.html:184o2pxp][IMG=http://www.image-share.com/upload/2600/42m.jpg][/url:184o2pxp]
The problem exists in both modes of operation.
This is the SQL query - Mode 1
cComm: = "SELECT salutation, first_name, last_name, title,
account_name,email1,primary_address_street,primary_address_city,primary_address_postalcode,id,phone_home,phone_mobile,phone_work,phone_other "+;
"FROM" + cLeads + "" +;
"WHERE" cWhereQ + + "" +;
"ASC"
Best regards
Dubravko Basic |
Call Center - Slow Application Launch | I see that all the time taken is for reading data from the tables.
You need to optimize this area.
Keep aside all windows and dialogs and folders.
Just write small code to read the data and optimize on the speeds. After that you incorporate the windows/folders, etc.
One hint: There will never be any major delays with fwh/(x)Harbour. Any major delay is only due to time taken to read data.
I guess you are dealing with very large files. You need to work on optimizing your queries. In particular it is a technique to optimize where clauses if we are dealing with large tables. Much depends on creating right indexes and usages of the indexed fields in our where clauses.
For example, if the where clause is "WHERE DEPT = 10", the query is damn slow if there is no index on DEPT.
By the way we do not know what are you using to connect to MySql server. Are you using ADO or TMySql or TDolphin? |
Call Center - Slow Application Launch | Rao,
Thanks for your reply
[i:8jg3s4dl]1) I see that all the time is taken for reading data from the tables.
You need to optimize this area.[/i:8jg3s4dl]
The data is read into an array and what you see in the picture is the brows array. Not all the time.
[i:8jg3s4dl]2) Keep aside all windows and dialogs and folders.
Just write small code to read the data and optimize on the speeds. After that you incorporate the windows / folders, etc..[/i:8jg3s4dl]
Exactly read data
[i:8jg3s4dl]3) One hint: There will never be any major delays with FWH / (x) Harbour. Any major delay is only due to time taken to read the data.[/i:8jg3s4dl]
No. MySQL has a very good set Index. Speed ??data retrieval is measured and it is very good.
[i:8jg3s4dl]4) I guess you are dealing with very large files. You need to work on optimizing your queries. In particular it is a technique to optimize where clauses if we are dealing with large tables. Much depends on creating right indexes and usages of the indexed fields in our where clauses.
For example, if the where clause is "WHERE DEPT = 10", the query is damn slow if there is no index on DEPT.[/i:8jg3s4dl]
Yes. The database is very large. I have optimized the MySQL server to work with large data.
[i:8jg3s4dl]5) By the way we do not know what are you using to connect to MySQL server. Are you using ADO or TMySql or TDolphin?
[/i:8jg3s4dl]
I use xHarbour SQL RDD. Connection of the base can be seen:
[url:8jg3s4dl]http://forums.fivetechsupport.com/viewtopic.php?f=3&t=25346&p=139607&hilit=ssh%20#p138353[/url:8jg3s4dl]
I mentioned, I'm on line at the base constantly, but the data read (or insert, update)
when we need to. Browse array only, not the database (table).
The problem is that after a reset or when the computer is turned on, the formation of the app is about 4 minutes, and all other activation apps are fast!
Does the problem would be to cache or something?
Best regards
D. Basic |
Call Center - Slow Application Launch | Antonio, Rao
After a more detailed analysis, I found the problem.
Actually, there are two things that affect the above problem.
[b:1bem7tzw]After the formation of the folder[/b:1bem7tzw], perform all the functions listed in COMOBOX ... ON CHANGE funx()
Function funx() is actually a SQL query.
I assume that this function is executed only when changing the ComboBox, not when defining folder. The solution is the variable that changed after the first start.
Another thing is the SQL query. When executed for the first time, takes on a large base for a long time. Another time, when he executed the same query is already cached and executed significantly shorter.
By optimizing queries and good indexing applications work very well with large databases.
Summary, Mr. Rao, you're absolutely right.
Dubravko Basic |
Call Center - Slow Application Launch | I didn't see this before, but from your original description, my first thought would be that the app is slow the first time because you have just started the computer. Is it still running background processes ? Leave it on all the time and see what happens when you enter the program for the first time the next day.
Windows has a lot of background work today when first started. This includes updating, backups, and far more. I find it takes a lot of time from the CPU. Even though it has an i7, my understanding is that most work will still be done by one processor unless the tasks are specifically written to take advantage of the others ( info drawn from some Microsoft posts ).
Tim |
Call Center - Slow Application Launch | Tim
I tried to explain the whole problem (now that I know what is causing the slowness of the app) starting from the MySQL database. When you turn on the computer I start the MySQL database (localhost). Cash in the database is empty. If I send a SQL query on a large table, the first time you are running, the response I get for example 50 sec. When I send the same query again, the response I get for example, 1.2 sec. The reason is cached internally in the MySQL database.
When I start the program, in the folder there are several ComboBox and ... ON CHANGE FunX ();
Function FunX() real SQL query that acts as above. So, in that sense, and application had delay!
[b:22v8ptit]I presumed,[/b:22v8ptit] to be executed FunX() when defining the ComboBox
I solved the problem so it does not authorize the execution of the function while the application is not fully formed, and of course, optimizing SQL queries and good indexing.
Of course, Windows is doing everything in the background, but that's not the problem here.
Dubravko Basic |
Call HTML form in FWH application | I would like to display an HTML form from within a Win32 Desktop application ( NOT MOD_HARBOUR PLEASE )
From a website the following is called:
<form name=”PrePage” method = “post” action = “https://SourceServer.com/payment/Catalog.aspx”>
<input type = “hidden” name = “LinkId” value =”jiehiu378208kijfiiuie” />
<input type = “image” src =”//content.SourceServer.com/images/getit.gif” /></form>
Though I use this on my server now, hackers are trying to access it. The last time they did it, they diverted payments to their PayPal account ( knowing PP lets them get away with the theft ). I want to remove the "Store" from my website completely and have the access only in my application which is NOT web based. |
Call HTML form in FWH application | Tim,
I don't think I completely understand the ask. What exactly do you want to be able to do from your application? |
Call HTML form in FWH application | On a website, I define a popup form with the code I provided. That links to a secured credit card gateway. It is an HTML form.
I want to have a menu option in my program that will popup the same form. Yes, it would display it in the default web browser on that computer, and the individual would then process the form ( on that same browser ).
I need to pass that entire script to the web browser from within the program. Right now it's easy to call websites, but I don't pass all the extra information. For Example:
ACTION ShellExecute( nil, "open", "http://fivetech.com" ) will open that website, but how can I pass the data above to open a form in the browser ? |
Call HTML form in FWH application | Tim,
I was also looking for showing html from FW and I found this function on the forum and was playing with it.
I put your form insite the html file you have to put in the samples dir of you choise (change the path in the prg)
It seem to put the data into the form, but dos not send. It can however be a starting point from where to look.
[code=fw:pnz8yl47]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00D7D7;">#Define</span> OLECMDID_PRINT <span style="color: #000000;">6</span><br /><span style="color: #00D7D7;">#Define</span> OLECMDEXECOPT_PROMPTUSER <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#Define</span> OLECMDEXECOPT_DONTPROMPTUSER <span style="color: #000000;">2</span><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oWnd, oActiveX1, oActiveX2, cTemp<br /><br /> cTemp = <span style="color: #ff0000;">'<head><link rel="stylesheet" href="temp.css"></head><table class="styled-table"><thead><tr><th>36</th><th>38</th>'</span><br /> cTemp += <span style="color: #ff0000;">'<th>40</th><th>42</th><th>44</th></tr></thead><tbody><tr><td></td><td>1</td><td>1</td><td>1</td><td>2</td></tr></tbody></table>'</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveWin multiple ActiveX support"</span><br /><br /> <span style="color: #B900B9;">//@ 10, 10 ACTIVEX oActiveX1 PROGID "Shell.Explorer" OF oWnd SIZE 500, 150</span><br /> @ <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&OK"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">ACTION</span> drukhtml<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//oActiveX1:Do( "Navigate2", "c:\fwharb\samples\temp.html" )</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> drukhtml<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cHtml:= <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wharb<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\t</span>emp.html"</span><br /> printhtml<span style="color: #000000;">(</span>cHtml,<span style="color: #000000;">1</span>,.t.<span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">FUNCTION</span> PrintHtml<span style="color: #000000;">(</span>cHtmlOrUrl,nCopies,lShow<span style="color: #000000;">)</span><br /><span style="color: #00C800;">static</span> oWnd1:=<span style="color: #00C800;">nil</span>, oBar, oIe<br /><span style="color: #00C800;">local</span> i<br /><span style="color: #00C800;">default</span> lShow:=.f.,nCopies:=<span style="color: #000000;">1</span><br /><span style="color: #00C800;">if</span> oWnd1=<span style="color: #00C800;">nil</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd1<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd1<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">'Print'</span><br /><span style="color: #00C800;">endif</span><br />oIe = TActiveX<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWnd1, <span style="color: #ff0000;">"Shell.Explorer"</span> <span style="color: #000000;">)</span><br />oIe:<span style="color: #00C800;">Do</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Navigate2"</span>, cHtmlOrUrl<span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> lshow<br />oWnd1:<span style="color: #000000;">oClient</span> = oIe<br />ShowWindow<span style="color: #000000;">(</span>oWnd1, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> && <span style="color: #000000;">1</span>=Show,<span style="color: #000000;">0</span>=hide<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd1<br />oWnd1:<span style="color: #0000ff;">Center</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br />sysrefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> PrintHtml2<span style="color: #000000;">(</span>cHtmlOrUrl,nCopies,lShow<span style="color: #000000;">)</span><br /><span style="color: #00C800;">static</span> oWnd:=<span style="color: #00C800;">nil</span>, oBar, oIe<br /><span style="color: #00C800;">local</span> i<br /><span style="color: #00C800;">default</span> lShow:=.f.,nCopies:=<span style="color: #000000;">1</span><br /><span style="color: #00C800;">if</span> oWnd=<span style="color: #00C800;">nil</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">'Print'</span>;<br /><span style="color: #0000ff;">ACTION</span> oIe:<span style="color: #00C800;">Do</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ExecWB"</span>, OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER <span style="color: #000000;">)</span><br />oIe = TActiveX<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWnd, <span style="color: #ff0000;">"Shell.Explorer"</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br />oIe:<span style="color: #00C800;">Do</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Navigate2"</span>, cHtmlOrUrl<span style="color: #000000;">)</span><br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> alltrim<span style="color: #000000;">(</span>oIe:<span style="color: #000000;">document</span>:<span style="color: #000000;">readyState</span><span style="color: #000000;">)</span> <> <span style="color: #ff0000;">'complete'</span><br />sysrefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />waitseconds<span style="color: #000000;">(</span>.<span style="color: #000000;">5</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">enddo</span><br /><span style="color: #00C800;">if</span> lshow<br />oWnd:<span style="color: #000000;">oClient</span> = oIe<br />ShowWindow<span style="color: #000000;">(</span>oWnd, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> && <span style="color: #000000;">1</span>=Show,<span style="color: #000000;">0</span>=hide<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br />oWnd:<span style="color: #0000ff;">Center</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">else</span><br /><span style="color: #00C800;">for</span> i=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nCopies<br />msgwait<span style="color: #000000;">(</span><span style="color: #ff0000;">'Printing large receipt ('</span> + alltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>i<span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">' of '</span>+alltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>nCopies<span style="color: #000000;">)</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">' copies).'</span>,,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><br />oIe:<span style="color: #00C800;">Do</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ExecWB"</span>, OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER <span style="color: #000000;">)</span><br /><span style="color: #00C800;">next</span> i<br /><span style="color: #00C800;">endif</span><br />sysrefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:pnz8yl47]
temp.html has folowing code inside :
<form name=”PrePage” method = “post” action = “https://SourceServer.com/payment/Catalog.aspx”>
<input type = “hidden” name = “LinkId” value =”jiehiu378208kijfiiuie” />
<input type = “image” src =”//content.SourceServer.com/images/getit.gif” /></form> |
Call HTML form in FWH application | Perhaps write the .html to a local file then pass that file name into ShellExecute(), instead of a url, and depend on Windows default file handler to open in the browser based on file extension. |
Call HTML form in FWH application | [quote:3pz9i5ab]I was also looking for showing html from FW and I found this function on the forum and was playing with it.[/quote:3pz9i5ab]
Please consider using the built-in FWH function
[code=fw:3pz9i5ab]<div class="fw" id="{CB}" style="font-family: monospace;"><br />HTMLVIEW<span style="color: #000000;">(</span> cHtmlFile <span style="color: #000000;">)</span> <span style="color: #B900B9;">// give full path of the file</span><br /> </div>[/code:3pz9i5ab] |
Call HTML form in FWH application | [quote="nageswaragunupudi":ut0j47cw][quote:ut0j47cw]I was also looking for showing html from FW and I found this function on the forum and was playing with it.[/quote:ut0j47cw]
Please consider using the built-in FWH function
[code=fw:ut0j47cw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />HTMLVIEW<span style="color: #000000;">(</span> cHtmlFile <span style="color: #000000;">)</span> <span style="color: #B900B9;">// give full path of the file</span><br /> </div>[/code:ut0j47cw][/quote:ut0j47cw]
Works also for me !
But is seems that just as the other option that HTMLVIEW also needs a file with a Path and HTML code inside it to work. Ok for viewing links, websites,...
I my case I browse a Xbrowse that has a field inside a memo that has HTML code to build a table based on data. So, when moving the browse, I want the dialog where the html is showing to refresh with new data
For now I think I can move the browse, save the htmlcode to a file and then call the htmlview with the updated htmlcode. Should work, but maybe there can be updated function that will show plain html data from a
variable data.
When cTemp = used, htmlview will also startup google and give a result of a google seek for the code (cTemp = used as a seeking parameter)
[code=fw:ut0j47cw]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> htmlzien<span style="color: #000000;">(</span>cFile,oWnd1<span style="color: #000000;">)</span><br /> cTemp = <span style="color: #ff0000;">'<head><link rel="stylesheet" href="temp.css"></head><table class="styled-table"><thead><tr><th>36</th><th>38</th>'</span><br /> cTemp += <span style="color: #ff0000;">'<th>99</th><th>42</th><th>44</th></tr></thead><tbody><tr><td></td><td>1</td><td>1</td><td>1</td><td>2</td></tr></tbody></table>'</span><br /><br /> htmlview<span style="color: #000000;">(</span>cTemp<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// htmlview(cTemp,"Titel",oWnd1,10,10,400,350)</span><br /> <span style="color: #B900B9;">//htmlview(cFile,"Titel",oWnd1,10,10,400,350)</span><br /><br /><span style="color: #00C800;">Return</span><br /><br /> </div>[/code:ut0j47cw] |
Call HTML form in FWH application | Tim,
ACTION ShellExecute( nil, "open", "http://www.fivetechsoft.com?param1=Tim¶m2=Stone" )
The above issues a "GET" request as the params go on the URL after the "?"
If you want those params not to be seen on the URL then you have to use "MSXML2.XMLHTTP" or CURL to do a "POST" request |
Call Help from ? on dialog | Hi,
I have help files called either from a menu or by pressing F1 but would like to use the ? on the system menu of a dialog (created in an .rc file) to also call the relevant help file. What command or code should I use?
Thanks in advance
Gary |
Call Help from ? on dialog | Hello Gary,
have a look at FWH - samples => [color=#FF0000:1jfep3on]Newhelp.prg[/color:1jfep3on]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
Call a Dll from an Exe | I have setup a simple exe and dll. I am attempting to dynamicly call a dll from an exe. In my simple example I am calling the dll and execution is passing to the Dll no problem. However, when the dll returns, execution ends, and does NOT resume in the exe as I would suspect. I am using the fwh\samples\tutor01.prg as the dll example, and I am using the testdll.prg as the exe. My environment is xharbour 0.99.51 - fwx v2.6 using borland compiler.Can anyone point me in the proper direction on this issue?Any help is greatly appreciated. |
Call a Dll from an Exe | Don,What build...bat are you using to build the DLL ?Is it a pcode only DLL or a self contained DLL ? |
Call a Dll from an Exe | What build...bat are you using to build the DLL ? I modified the buildhd.bat in the fivewin samples to adher to my environment - did not change any compile / link switches.I am attempting to create a self contained dll. |
Call a Dll from an Exe | Don,Here it is working fine using FWH 8.06 and current xHarbour provided with it. Here you have the EXE and the DLL, so you can test it yourself:<!-- m --><a class="postlink" href="http://www.mediafire.com/?hwwlfmibi1u">http://www.mediafire.com/?hwwlfmibi1u</a><!-- m --> |
Call a Dll from an Exe | Antonio - Thank you for the quick response and sample.This example works great <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Can you send the source - and scripts used to make/link?This is exactly what I am atempting, however - my exe never gets control back after the dll return.Thank you for your help |
Call a Dll from an Exe | Don, I used the same sources as you: the ones from fwh\samples without modifying them:[code:3cosdfvb]
#include "FiveWin.ch"
function Main()
HbDLLEntry( "MAIN" )
MsgInfo( "ok from EXE" )
return nil
DLL FUNCTION HBDLLENTRY( cProc AS LPSTR ) AS LONG PASCAL LIB "Tutor01.dll"
[/code:3cosdfvb]I guess the differences come from the different xHarbour build that we are using. I suggest you to upgrade to the most recent FWH and xHarbour. |
Call a Dll from an Exe | Antonio - Thank you for the assistance. The most current xHarbour we have is v1.0 - with FWH v7What versions are you using?I also noticed in the scripts a reference to maindll.objI do not have this module - what is it?Thanks again for all your help |
Call a Dll from an Exe | Don,We are using current FWH 8.06 with the xHarbour (June 2008) published on these forums in <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=2486">http://fivetechsoft.com/forums/viewtopic.php?t=2486</a><!-- m -->maindll.obj is a Harbour/xHarbour module, that it is not included by default in the setup file. Here you have it:<!-- m --><a class="postlink" href="http://rapidshare.com/files/123510556/maindll.obj.html">http://rapidshare.com/files/123510556/maindll.obj.html</a><!-- m --> |
Call a Dll from an Exe | Hi Antonio i have the same problem with tutor01.prg and testdll.prg using the buildhd.bat.
I DONT HAVE THE FILE NAMED MIANDLL.OBJ, SO I REM THE LINE BUT....
It runs the DLL but does not cam back in the EXE file.
Any solution for me ?
FWH 8.1 HARBOUR 1.01 (build. 9361) |
Call a Dll from an Exe | Hi to all,
can sameone very kkkiiiinnnnddddlllyyyy pass me the maindll.obj ?
Tks |
Call a Dll from an Exe | Romeo,
Files names have been changed in Harbour, here you have what it is available now:
[url:2x54i4gd]http://www.mediafire.com/file/mijlz2nhol1/maindllh.obj[/url:2x54i4gd]
[url:2x54i4gd]http://harbour-project.svn.sourceforge.net/viewvc/harbour-project/trunk/harbour/src/vm/[/url:2x54i4gd] |
Call a Dll from an Exe | Romeo,
I think it is going to be much more convenient and easier for you if you upgrade to the most recent Harbour version and also if you use HRB files instead of DLL files. There have been so many changes in Harbour. |
Call a FWH program from another and leave it open (SOLVED) | How can I call a FiveWin program from another and leave it open ? For example: 1. Program A calls program B 2. Program B opens and STAYS open but control returns to A 3. Program A closes but B is left open.Thank you.RUN /B /I START program.exeStart is a Windows command. |
Call a FWH program from another and leave it open (SOLVED) | I think WinExec( 'program.exe' ) does the same thing. |
Call a NAS over a VPN connection | Hello,
Can we open a VPN connection from FWH ?
There is a FWH program on laption's that needs to connect via VPN to a NAS,
Once connection is ok, connect to a database.
We can do it step by step, by clikking on the icons, but can we also do all this from insite the FWH program? |
Call a function periodically | Hi all,
Is there a way to call a function periodically throughout the execution of an application. Thank you !
Regards, |
Call a function periodically | Take a look at FW\samples\testtim4.prg |
Call a function periodically | Thank you james! |
CallDLL() & GetProcAddress(). | Hola , buen dìa
En 32 bits se usan CallDLL() y GetProcAddress().
Y en 64 ?
Saludos |
CallDll32 funny | Hi Antonio
I have a Fwh and xHb aplication using latest Sept/Oct2006 Fw28/xHb
This app call the tMutex.prg class Create method below. The tMutex create method calls CallDLL32(.....). In my application when CallDLL32 is called, i get a pop up msgalert "CallDll32", with a title of "calldll.c". I have tracked this down to \fwh\source\winapi\calldll.c which contains
#ifdef __BORLANDC__
..........
#else
CLIPPER CALLDLL32( PARAMS )
{
#ifndef UNICODE
MessageBox( 0, "CallDll32", "CallDll.c", 0 );
#else
MessageBox( 0, L"CallDll32", L"CallDll.c", 0 );
#endif
}
It seems the above CLIPPER CALLDLL32 is being called in error?
In addition, if I ignore the above msgalert, in the line of code below (::hMutex := CallDLL32(...) is set to an array (in stead of a numeric handle), the 2nd element of which is the correct hMutex handle
If I move tMutex.prg to earlier in my xbp link script, the problem is resolved, but that is an unsatisfactory solution
Can you think what might be causing this?
Thanks
Peter
*********************
Method Create( sMutexAttr, lInitialOwner, cName ) Class TMutex
Local hDLL := LoadLib32( iKERNEL )
Local cFarProc, cFunc := "CreateMutexA", cBuffer := Nil
Default lInitialOwner := .F., cName := "FiveWin App"
If ValType( sMutexAttr ) == "O" .and. ;
Upper( sMutexAttr:className() ) == "TSTRUCT"
cBuffer := sMutexAttr:cBuffer
Endif
::cName := cName
If Abs( hDLL ) > 32 /*LPSTR*/ // LPSTR fails under 32bits!
cFarProc := GetProc32( hDLL, cFunc, iASPASCAL, LONG, LONG, LONG, STRING )
::hMutex := CallDLL32( cFarProc, ;
If( cBuffer # Nil, @cBuffer, cBuffer ), ; // lpMutexAttributes, security descriptor structure or nil
Bool2Int( lInitialOwner ), ; // bInitialOwner, initial owner
cName + Chr(0) ) // lpName, object name
FreeLib32( hDLL )
If cBuffer # Nil
sMutexAttr:cBuffer := cBuffer
Endif
Else
::Failed( hDLL, cFunc )
Endif
Return Self
********************* |
CallDll32 funny | Peter,
In 32 bits you have to use CallDLL() and GetProcAddress().
The functions you are using are just for 16 bits, to access 32 bits ones. |
CallDll32 funny | Thank you
I now see that tMutex.prg does have the following at the bottom of the tMutex.prg (see end of mail)
So that would mean the fwh calldll.c function 'CLIPPER CALLDLL32( PARAMS )' is being called instead of the 'Function CallDLL32' below (in tMutex).
This should only happen if calldll.c (in FiveHcm.lib) is linked in before tMutex.prg. I am using xBuildW.exe which links FiveHcm.lib in automatically - I will have to investigate further
****************
#ifdef __HARBOUR__
Function LoadLib32( cDll )
Return LoadLibrary( cDll )
Function FreeLib32( hDll )
Return FreeLibrary( hDll )
Function GetProc32( hDLL, cFunc, lType, nRetType, nPType1, nPType2, nPType3, nPType4, nPType5, nPType6, nPType7, nPType8, nPType9, nPType10 )
Return GetProcAddress( hDLL, cFunc, lType, nRetType, nPType1, nPType2, nPType3, nPType4, nPType5, nPType6, nPType7, nPType8, nPType9, nPType10 )
Function CallDLL32( cFarProc, uParam1, uParam2, uParam3, uParam4, uParam5, uParam6, uParam7, uParam8, uParam9, uParam10 )
Return CallDLL( cFarProc, uParam1, uParam2, uParam3, uParam4, uParam5, uParam6, uParam7, uParam8, uParam9, uParam10 )
#endif |
CallDll32 funny | Peter,
Better do a search & replace for those functions names in TMutex source code instead of using those wrappers. |
CallNamedPipe | Hi friends,
I need make one function with "CallNamedPipe", in C is:
[code:3cbflxxw] TCHAR chReadBuf[BUFSIZE];
BOOL fSuccess;
DWORD cbRead, cbWritten, dwMode;
LPTSTR lpszPipename = TEXT("\\\\.\\pipe\\myPIPE");
LPTSTR lpszWrite = TEXT("no llego nada");
fSuccess = CallNamedPipe(
lpszPipename,
lpszWrite,
(lstrlen(lpszWrite)+1)*sizeof(TCHAR),
chReadBuf,
BUFSIZE*sizeof(TCHAR),
&cbRead,
20000);
if (fSuccess || GetLastError() == ERROR_MORE_DATA)[/code:3cbflxxw]
What i need for make this function in xHarbour?
Tank´s |
CallNamedPipe en FW | Amigos,
Mi código estaba hecho para FWH, pero ahora necesito pasarlo tambien para FW, comencé pero me tira un error al compilar, podrían ayudarme?
[code:23s4gnqt]#include "winten.h"
#include "windows.h"
#ifndef __HARBOUR__
#include "clipapi.h"
#else
#include "hbapi.h"
#endif
#define BUFSIZE 512
#ifndef __HARBOUR__
CLIPPER COMANDOCEM( PARAMS )
#else
HB_FUNC ( COMANDOCEM )
#endif
{
#ifndef __HARBOUR__
char chReadBuf[BUFSIZE];
#else
TCHAR chReadBuf[BUFSIZE];
#endif
BOOL fSuccess;
DWORD cbRead, cbWritten, dwMode;
#ifndef __HARBOUR__
LPSTR lpszPipename = _parc( 1 ) ;
LPSTR lpszWrite = _parc( 2 ) ;
#else
LPTSTR lpszPipename = hb_parc( 1 ) ;
LPTSTR lpszWrite = hb_parc( 2 ) ;
#endif
OutputDebugString( _parc(1) );
#ifndef __HARBOUR__
fSuccess = CallNamedPipe(
lpszPipename,
lpszWrite,
(lstrlen( lpszWrite) + 1 ) * sizeof( char ),
chReadBuf,
BUFSIZE * sizeof( char ),
&cbRead,
200000 );
#else
fSuccess = CallNamedPipe(
lpszPipename,
lpszWrite,
( lstrlen( lpszWrite ) + 1 ) * sizeof( TCHAR ),
chReadBuf,
BUFSIZE*sizeof( TCHAR ),
&cbRead,
20000);
#endif
}
[/code:23s4gnqt]
Error:[quote:23s4gnqt]Warning source\pipeclte.c 74: Call to function 'CallNamedPipe' with no prototype in function COMANDOCEM
Warning source\pipeclte.c 89: 'fSuccess' is assigned a value that is never used in function COMANDOCEM
[/quote:23s4gnqt] |
Called from HBCLASS:NEW(0) | Olá
Estou gerando um exe com xharbour 09961 + fwh 26, qdo executo gera
o erro abaixo:
Called from HBCLASS:NEW(0)
Called from TFont(0)
Called from Principal(83)
Compilei a lib fivehx.lib novamente com o novo compilador, compilei
todos meus prgs novamente mas não está funcionando. |
Called from HBCLASS:NEW(0) | Joao,
Tienes un ejemplo pequeño que reproduzca el error ? gracias |
Called from HBCLASS:NEW(0) | VERIFIQUE A LINHA 83 DE PRINCIPAL.PRG
VOCE ESTA DEFININDO AS FONTES? SE SIM, FECHA-AS AO SAIR?
POSTE O CODIGO.
OU SIMPLESMENTE, VÁ PARA O FORUM EM PORTUGUES, EM:
<!-- m --><a class="postlink" href="http://www.fivewin.com.br">http://www.fivewin.com.br</a><!-- m --> |
Called from: => STARTPAGE( 0 ) | buenas tardes.
intento hacer un listado (no factura) solo impresion de items.
y al querer Ejecutar la rutina que me realizaria le impresion me salta esto:
[code=fw:12rllni6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> Called <span style="color: #0000ff;">from</span>: => STARTPAGE<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">PRINTER</span>.PRG => PAGEBEGIN<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\imprime\TIMPQuincenal.prg => TIMPQUINCENAL:<span style="color: #000000;">HOJA1</span><span style="color: #000000;">(</span> <span style="color: #000000;">73</span> <span style="color: #000000;">)</span></div>[/code:12rllni6]
que es?
gracias |
Called from: => STARTPAGE( 0 ) | Muestre el código. Y vea PRINT.CH si tiene algo mal.
Saludos. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.