topic
stringlengths
1
63
text
stringlengths
1
577k
oDlg:bGotFocus No funciona con recursos en DLL
Buanas tardes, Hasta ahora no había usado "oDlg:bGotFocus" y, al querer implementarlo me encuentro con que no funciona (tampoco el oDlg:bLostFocus). Aclaro que tengo los recursos definidos en una DLL que actualizo con Pelles-C. Ej. que no funciona: [code=fw:1kfmirvg]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"dialog1"</span> <span style="color: #0000ff;">of</span> oWnd<br />   oDlg:<span style="color: #000000;">bGotFocus</span>:=<span style="color: #000000;">&#123;</span>|| msgsound<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"laser.wav"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  <span style="color: #B900B9;">// sonido para probar</span><br /><span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">center</span> <span style="color: #0000ff;">nowait</span></div>[/code:1kfmirvg] En Cambio, si defino el dialog desde código, no hay problemas y el sonido es escuchado cada vez que el dialog pierde el foco. Ej. que sí funciona: [code=fw:1kfmirvg]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">from</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">of</span> oWnd  <br />   oDlg:<span style="color: #000000;">bGotFocus</span>:=<span style="color: #000000;">&#123;</span>|| msgsound<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"laser.wav"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  <span style="color: #B900B9;">// sonido para probar</span><br /><span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">center</span> <span style="color: #0000ff;">nowait</span></div>[/code:1kfmirvg] Esto obviamente es un mínimo ejemplo ya que el dialog desde recursos tiene muchos controles. Soy consciente que la cuestión está en las propiedades de los recursos dentro de la DLL. Logré hacer que funcionara incluyendo en las propiedades, "Window style DS_CONTROL" (siempre editando la DLL con el Pelles-C), pero tiene la particularidad que el dialog es mostrado sin marco y sin caption. ¿A Alguien le pasó?. ¿Como lo soluciono?. Gracias. Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
oDlg:bGotFocus No funciona con recursos en DLL
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=25706&start=30#p143679">viewtopic.php?f=3&t=25706&start=30#p143679</a><!-- l -->
oDlg:end()
Ciao a tutti Non capisco come posso stabilire quando un 'DIALOG' non e' piu' presente dal momento che il suo valtype risulta ancora 'O' dopo aver applicato il metodo end (oDlg:end()) Allego un esempio di prova. [code=fw:qqwk5j83]<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 />*------------------------------------------------------------<br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />*------------------------------------------------------------<br /><br />   <span style="color: #00C800;">local</span> oDlg<br />   <span style="color: #00C800;">local</span> nI1   := <span style="color: #000000;">1</span><br />   <span style="color: #00C800;">local</span> lOk   := .F.<br />   <span style="color: #00C800;">local</span> cCod  := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br /><br />  <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test"</span>  <br /><br />   @ <span style="color: #000000;">01</span>, <span style="color: #000000;">03</span> <span style="color: #0000ff;">GET</span> cCod <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span><br />   @ <span style="color: #000000;">03</span>, <span style="color: #000000;">05</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span>     <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span>  <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>lOk := .T., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">03</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span>  <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>lOk := .F., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span>  <span style="color: #0000ff;">VALID</span> OkExit<span style="color: #000000;">&#40;</span>lOk, oDlg<span style="color: #000000;">&#41;</span><br />   <br />   alert<span style="color: #000000;">&#40;</span>valtype<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br />*------------------------------------------------------------<br /><span style="color: #00C800;">FUNCTION</span> OkExit <span style="color: #000000;">&#40;</span>lOk, oWnd<span style="color: #000000;">&#41;</span><br />*------------------------------------------------------------<br /><br />   <span style="color: #00C800;">local</span> lRet := .T.<br /><br />   sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <br />   <span style="color: #00C800;">IF</span> lOk   <br />      MsgMeter<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> | oMeter, oText, oDlg, lEnd | lRet := Elabora<span style="color: #000000;">&#40;</span> oMeter, oText, oDlg, @lEnd, oWnd <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />             <span style="color: #ff0000;">"Elabora"</span>, <span style="color: #ff0000;">"Attendere..."</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> lRet<br />         Chiudi<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span>lRet<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span>   <br />      Chiudi<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br /><br /><br />*------------------------------------------------------------<br /><span style="color: #00C800;">FUNCTION</span> Elabora<span style="color: #000000;">&#40;</span> oMeter, oText, oDlg, lEnd, oWnd <span style="color: #000000;">&#41;</span><br />*------------------------------------------------------------<br /><br />   <span style="color: #00C800;">local</span> nI1 := <span style="color: #000000;">1</span><br /> <br />   sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   oMeter:<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">10000</span>  <br />   <span style="color: #00C800;">FOR</span> nI1 := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">10000</span><br />       oMeter:<span style="color: #000000;">Set</span><span style="color: #000000;">&#40;</span>nI1<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">NEXT</span><br />   oWnd:<span style="color: #0000ff;">update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /><br /><br />*------------------------------------------------------------<br /><span style="color: #00C800;">FUNCTION</span> Chiudi <br />*------------------------------------------------------------<br /><br />   sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   MsgAlert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Uscita"</span>, <span style="color: #ff0000;">"Avviso"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">nil</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:qqwk5j83] Grazie a tutti
oDlg:end()
Per una DIALOG modale è garantito che questa sia chiusa dopo l'ACTIVATE DIALOG. EMG
oDlg:omsgbar
I must refresh the msg of the oDlg:oMsgbar with a news string I try with oDlg:oMsgBar:cMsg := cMytext or oDlg:oMsgBar:cMsgdef:= cMytext and then oDlg:oMsgBar:refresh() but give me error not found cMsg or cMsgdef how I can resolve ?
oDolphin:Seek( ) QUERY PAGINADO
Estimado Daniel y colegas.. como buscar, en un qry. PAGINADO con medio millón de registros ? [code=fw:12qzcemi]<div class="fw" id="{CB}" style="font-family: monospace;">cQry += <span style="color: #ff0000;">" FROM clientes order by codigo LIMIT 1000"</span><br />oCte := ::<span style="color: #000000;">oCon</span>:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span> cQry <span style="color: #000000;">&#41;</span><br />oCte:<span style="color: #000000;">SetPages</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1000</span> <span style="color: #000000;">&#41;</span><br />lSeek := .f.<br /><span style="color: #00C800;">for</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> oCte:<span style="color: #000000;">nMaxPages</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCte:<span style="color: #000000;">GoToPage</span><span style="color: #000000;">&#40;</span> i <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> oCte:<span style="color: #000000;">seek</span><span style="color: #000000;">&#40;</span> cstr<span style="color: #000000;">&#40;</span> nClave <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"CODIGO"</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lSeek := .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span> <br /><br /><span style="color: #00C800;">if</span> !lSeek<br />&nbsp; &nbsp;? <span style="color: #ff0000;">"no existe el cliente ..."</span><br />endit</div>[/code:12qzcemi] se puede hacer de otra forma? o quizás modificar el METHOD SEEK de dolphin ? saludos..
oDolphin:Seek( ) QUERY PAGINADO
Hola no es posible, el seek solo funciona sobre al consulta activa, si tienes activa una paginacion la busqueda se hace por la la cantidad de registros de que contenga la pagina
oDolphin:Seek( ) QUERY PAGINADO
Lo que puedes hacer, es pedir al usuario una parte del nombre a buscar y realizar una consulta por esa parte, eso te va a traer solamente los registros que lo contengan puedes hacerlo al principio, al final o en cualquier parte del dato acortas muchos las consultas cuando trabajas con tablas con gran cantidad de registros, yo lo utilizo para trabajar en modo remoto y realmente anda muy bien. Mira seria así solo los registros que coincidan al principio cQry += " FROM clientes where "nombrecampo" like "dato%' solo los registro que coincidan al final cQry += " FROM clientes where "nombrecampo" like "%dato' solo los registro que contengan parte del dato cQry += " FROM clientes where "nombrecampo" like "%dato%' Es importante validar que el dato no este vacio sino te va a traer toda la tabla Saludos
oDolphin:Seek( ) QUERY PAGINADO
Héctor gracias por tu sugerencia, en mi caso solo quiero buscar un registro, con un campo numérico: oQry:Seek( cstr( nCodigo ), "CODIGO" ) la tabla solo tiene un registro con ese código, con tu estrategia como seria? saludos. gracias.
oDolphin:Seek( ) QUERY PAGINADO
Cesar Sería de la siguiente manera Oqry (es la conexión al servidor) if empty(ncodigo) return .f. endif Resul:=Oqry:query('select field, field from nom_base where codigo like '+ " '%" +alltrm(str( nCodigo ))+" %' " ) if Resul:lastrec() = 0 Resul:end() Msginfo('No existe ninguna coincidencia",' Sin coincidencia') return .f. endif if Resul:lastrec() = 1 aquí tienes la coincidencia exacta haces lo que necesitas Resul:end() return .t. else Aquí tienes los datos que coinciden con el enviado esto lo puedes mostrar como quieras para que el usuario seleccione. Yo normalmente lo muestro en una dbf con los campos indexados que necesito y lo muestro en un xbrowse con autosort para darte una idea con una coincidencia de 1000 datos tarda entre 1 y 2 segundos en mostrarte los datos, hablamos de todo el proceso, es muy rápido. endif Espero que te sirva
oDolphin:Seek( ) QUERY PAGINADO
Hector, excelente explicacion, lo voy a llevar acabo gracias. saludos.
oExcel:Quit()
To All I use Ole to create excel files and when I finish .. I always close Excel with oExcel:Quit() .. unfortunately if I open the task manager I still see Excel running as an open task. When I quit my application .. the Excel task closes. What am I missing to make sure Excel close and not linger as an open process? Thanks Rick Lipkin
oExcel:Quit()
Try oBook:Close() oExcel:Quit() oExcel := Nil
oExcel:Quit()
Another solution forces EXCEL to be closed ( or define any other app ) [color=#0000FF:3emdxajv][b:3emdxajv]WINEXEC( "taskkill /F /IM EXCEL.EXE"[/b:3emdxajv][/color:3emdxajv] call [color=#0000FF:3emdxajv]taskkill /?[/color:3emdxajv] to get the parameters regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
oExcel:Quit()
One of the problems is If there is an Excel error or prompt you might loose control of the excel connection. Sometime I turn on the visibility so I can see if there are any messages from Excel program. Also before trying to create a file from excel, I have started checking for the (.xlsx) files existence and deleting it . That way if i cannot delete it I know it is still open from a prior or current Excel session. It's things like that makes it harder to automate ole tasks.
oExcel:Quit()
Please, <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=22&t=32928">viewtopic.php?f=22&t=32928</a><!-- l -->
oExcel:Quit()
[quote="Rick Lipkin":2w6jzudw]To All I use Ole to create excel files and when I finish .. I always close Excel with oExcel:Quit() .. unfortunately if I open the task manager I still see Excel running as an open task. When I quit my application .. the Excel task closes. What am I missing to make sure Excel close and not linger as an open process? Thanks Rick Lipkin[/quote:2w6jzudw] Can I see a sample (better if compilable and runnable) of your code? EMG
oExcel:Quit()
[quote="cnavarro":fs7tkosd]Try oBook:Close() oExcel:Quit() oExcel := Nil[/quote:fs7tkosd] Mr Cristobal's advice works for me. After oExcel := nil, the excel goes out of memory.
oExcel:Quit()
[quote="nageswaragunupudi":2ee34ene][quote="cnavarro":2ee34ene]Try oBook:Close() oExcel:Quit() oExcel := Nil[/quote:2ee34ene] Mr Cristobal's advice works for me. After oExcel := nil, the excel goes out of memory.[/quote:2ee34ene] It is only needed if oExcel is a static, public or private variable. I recommend to use a local variable instead. EMG
oExcel:Quit()
Enrico, Please, you can put a small example using a local variable?
oExcel:Quit()
Here it is: [code=fw:2temyehg]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oExcel, oSheet<br /><br />&nbsp; &nbsp; oExcel = CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Excel.Application"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; oExcel:<span style="color: #000000;">WorkBooks</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; oSheet = oExcel:<span style="color: #000000;">ActiveSheet</span><br /><br />&nbsp; &nbsp; oSheet:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> = <span style="color: #ff0000;">"This is a test"</span><br /><br />&nbsp; &nbsp; oSheet:<span style="color: #000000;">SaveAs</span><span style="color: #000000;">&#40;</span> CURDRIVE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">":<span style="color: #000000;">\"</span> + CURDIR() + "</span>\ThisIsATest.xlsx<span style="color: #ff0000;">" )<br /><br />&nbsp; &nbsp; oExcel:Quit()<br /><br />&nbsp; &nbsp; RETURN NIL</span></div>[/code:2temyehg] EMG
oExcel:Quit()
Ah !, Ok, I understand, only in the event that Excel does not remain open
oExcel:Quit()
To All I have been updating some old code especially where all variables are defined Static at the top of the reports .. part of the code upgrade was to remove all the Statics and use Local's instead. In many cases oExcel was not defined at all ( as in this case ) .. Once I re-defined oExcel and oSheet as local to my Excel file extraction, Excel now un-loads from memory with oExcel:Quit() Sorry for such a stupid error, however .. I now will go back and look at all my reports and make sure the Static to Local variable conversion makes sure oExcel and oSheet are defined and defined Local to each report module. Thanks for everyone's input .. Rick Lipkin
oExcel:Quit() sin grabar (ToleAuto)
Sres, una consulta, estoy usando una hoja excel preexistente, solo para cargar datos e imprimir, hasta ahi todo Ok, pero para finalizar utilizo : oExcel:Quit() Si finaliza, pero el problema es que me pregunta "Desea guardar los cambios efectuados en <nombre de hoja>" Lo que puntualmente necesito es que NO me pregunte nada, simplemente cierre el Excel y listo, hay algun parametro para que este metodo no pregunte nada ? Muchas gracias
oExcel:Quit() sin grabar (ToleAuto)
::oWorkBook:SaveAs(cFileXls) ::oExcel:Visible = .T. // ::oExcel:Quit() ::Excel := Nil saludos.
oExcel:Quit() sin grabar (ToleAuto)
Cesar, gracias por tu respuesta, lo acabo de probar y ya no me pregunta si grabo o no la hoja, pero al terminar la rutina y regresar al programa a continuar veo que deja el Excel cargado en memoria, la idea es que imprima y lo cierre. Gracias de todas formas
oExcel:Quit() sin grabar (ToleAuto)
// ::oExcel:Visible = .T. ::oExcel:Quit()
oFld:LoadPages and RESIZE16
Hi, is there any way to apply the RESIZE16 clause to folder pages loaded from resources ? Thanks in advance. Best Regards, Marco Turco
oFld:LoadPages and RESIZE16
Marco, You have to modify Class TFolder Method LoadPages to admit a third parameter: METHOD LoadPages( aResNames, bRedefineControls, lResize16 ) CLASS TFolder and then issue an ACTIVATE DIALOG oDlg ... RESIZE16 if lResize16 is true
oFld:SetColor( ""N/G"" ) doesn't work ?
Hello, I wanted to change from Gradient to Single-Color with [color=#FF0000:1uadl9il]oFld:SetColor( "N/G" )[/color:1uadl9il] It seems, it doen't work. I tested with < Testfld3.prg > with the same result. To get it working, I used the Gradient-function with two same colors. [img:1uadl9il]http&#58;//www&#46;pflegeplus&#46;com/pictures/foldercolor&#46;jpg[/img:1uadl9il] function Another() local oWnd, oFld DEFINE WINDOW oWnd TITLE "FiveWin Dynamic folders" ; FROM 5, 5 TO 20, 50 COLOR "N/G" @ 0.5, 1 FOLDER oFld PROMPT "&xBase", "&And OOP", "&Power" ; OF oWnd SIZE 260, 180 [color=#FF0000:1uadl9il]oFld:SetColor( "N/G" )[/color:1uadl9il] @ 1, 1 BUTTON "&Hello" OF oFld:aDialogs[ 1 ] ; ACTION MsgInfo( "Hello world!" ) SIZE 80, 20 ACTIVATE WINDOW oWnd return nil Using Gradient-Function : [img:1uadl9il]http&#58;//www&#46;pflegeplus&#46;com/pictures/foldercolor1&#46;jpg[/img:1uadl9il] Best regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
oFld:Update doesn't refresh the xbrowse
Hi all, it seems that having a folder with an xbrowse inside and changing a value into the xbrowse then the xbrowse is not refreshed using the oFld:Update method()
oFld:Update doesn't refresh the xbrowse
Marco, Did you specify the OF clause of the browse? Regards, James
oFld:Update doesn't refresh the xbrowse
Yes, the problem appears on xbrowse over a folder, anyway I will try to make a self-contained.....
oFld:Update doesn't refresh the xbrowse
Mr. Marco Please assign oBrw:lUpdate := .t. Also as Mr. James suggested, make sure you have defined xbrowse as "of oFld". If you have used the clause "UPDATE" while defining XBrowse, at present, this clause is only dummy and is not really setting oBrw:lUpdate := .t.. Let us expect this clause will work correctly from the next release of FWH onwards.
oFld:Update doesn't refresh the xbrowse
Ok, solved. I didn't know that the "UPDATE" clause was a dummy, now with oFld:lUpdate=.t. all runs fine. Thanks for your quick support, very appreciated.
oFolder:SetColor()
I Tried this and this does not work. Is there a way to change the color of a folder. Thanks Willy.
oFolder:SetColor()
Willy, If you are using XP themes then you can't change the folder color You can change the color of the dialogs that the folder manages oFld:aDialogs
oFolder:SetColor()
Thanks Antonio, I have also tried with oFold1:aDialogs[1]:Setcolor() But this does also not work
oFolder:SetColor()
Hello Antonio, could you please post a bit of code how to change the color of the folder dialogs. Thanks in advance Otto
oFolder:SetColor()
[code:1wt0gu26]1 24 "Windows&#46;Man"[/code:1wt0gu26] When you use this line in your Resources file, it will not work Otherwise you can use this [code:1wt0gu26]oDlg&#58;SetColor&#40;Rgb&#40;0,0,0&#41;,Rgb&#40;200,200,255&#41;&#41; oFold1&#58;SetColor&#40;Rgb&#40;0,0,0&#41;,Rgb&#40;200,200,255&#41;&#41; oFold1&#58;aDialogs&#91;1&#93;&#58;SetColor&#40;Rgb&#40;0,0,0&#41;,Rgb&#40;200,200,255&#41;&#41; oFold1&#58;aDialogs&#91;2&#93;&#58;SetColor&#40;Rgb&#40;0,0,0&#41;,Rgb&#40;200,200,255&#41;&#41; oFold1&#58;aDialogs&#91;3&#93;&#58;SetColor&#40;Rgb&#40;0,0,0&#41;,Rgb&#40;200,200,255&#41;&#41; oFold1&#58;aDialogs&#91;4&#93;&#58;SetColor&#40;Rgb&#40;0,0,0&#41;,Rgb&#40;200,200,255&#41;&#41; oFold1&#58;aDialogs&#91;5&#93;&#58;SetColor&#40;Rgb&#40;0,0,0&#41;,Rgb&#40;200,200,255&#41;&#41;[/code:1wt0gu26] It works with me. Greetings Willy
oFolder:SetColor()
Thank you, Willy. It is working. Do you also know how to change the TAB of the folder? Thanks in advance, Otto
oFolder:SetColor()
Try assigning oFolder:aPrompts[ n ] and refresh the folder (not tested). EMG
oFolder:SetColor()
How do you assingn? I tried oFld:aPrompts[ 1 ]:SetColor(Rgb(0,0,0),Rgb(168,207,110)) but get no exported method. Regards, Otto
oFolder:SetColor()
[quote="Otto":101w1jri]Do you also know how to change the TAB of the folder?[/quote:101w1jri] I thought you wanted to change the prompt of a TAB. EMG
oFont
I dont understand why LOCAL oFont := TFONT():NEW( "SEGOE UI", 0, - 12 , .F., .F.,,,,,,,,,,, ) is bigger than LOCAL oFont := TFONT():NEW( "SEGOE UI", 0, 12 , .F., .F.,,,,,,,,,,, ) Tx U
oFont
It's an expected Windows API behavior. EMG
oFont
The negative sign really means points instead of pixels. Without the negative it means pixels. So, 0,-12 is a 12 point font. 0,12 is a font 0 pixels wide and 12 pixels high. I suspect the zero defaults to something larger than 0. James
oFont
A point is 1/72 of an inch, so a 12 point font would be 12/72 inch. This is independent of the device that is displaying the font. Pixels are dependent on the device (screen, printer) so they would be different heights on different devices. For this reaon you would generally want to use fonts defined in points rather than pixels. There is a good definition of points in wikipedia. Regards, James
oFont
Hello, You can use my < Fontpainter >, to get all Informations, You need. The will be a new Release in a short Time with Background ( Brush-, Gradient- and Image-Selection ) <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=18085&p=94745&hilit=fontpaint#p94745">viewtopic.php?f=3&t=18085&p=94745&hilit=fontpaint#p94745</a><!-- l --> [img:15h2dthy]http&#58;//www&#46;pflegeplus&#46;com/pictures/fontpaint&#46;jpg[/img:15h2dthy] Preview Release [color=#FF0000:15h2dthy][b:15h2dthy][size=150:15h2dthy]Fontedit 2.1a[/size:15h2dthy][/b:15h2dthy][/color:15h2dthy] Create any Font-Background. [img:15h2dthy]http&#58;//www&#46;pflegeplus&#46;com/pictures/newf1&#46;jpg[/img:15h2dthy] [img:15h2dthy]http&#58;//www&#46;pflegeplus&#46;com/pictures/newf2&#46;jpg[/img:15h2dthy] [img:15h2dthy]http&#58;//www&#46;pflegeplus&#46;com/pictures/newf3&#46;jpg[/img:15h2dthy] [img:15h2dthy]http&#58;//www&#46;pflegeplus&#46;com/pictures/newf4&#46;jpg[/img:15h2dthy] [img:15h2dthy]http&#58;//www&#46;pflegeplus&#46;com/pictures/newf5&#46;jpg[/img:15h2dthy] Best regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
oFtp:DIRECTORY('*.*'""HD"") -> Binary
Hola de nuevo, Soy nuevo en lo relacionado a FTP. Ya cuento con un sito FTP pero no he logrado bajar archivos aun tomando en cuenta todos los ejemplos que he visto. El problema radica basicamente en que al abrir un oFtp y despues usar oFtp:DIRECTORY('*.*',"HD") con xbrowse siempre me da elementos que dicen "Binary", a que se puede deber? Salu2
oFtp:DIRECTORY('*.*'""HD"") -> Binary
Please check your landing directory while connecting FTP. Please check the folder name, I believe that it is case sensitive. Please verify that you have permission in the directory which you are trying to list. I check the availability of a file in a particular folder using the below given code [code=fw:1iwbtw79]<div class="fw" id="{CB}" style="font-family: monospace;">aFiles:=oFtp:<span style="color: #000000;">Directory</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Web/cstock/CStock.exe"</span> <span style="color: #000000;">&#41;</span></div>[/code:1iwbtw79] Regards [b:1iwbtw79]Anser[/b:1iwbtw79]
oFtp:DIRECTORY('*.*'""HD"") -> Binary
A ver si te sirve este sample, yo lo hago así: [code=fw:1w1jpwmg]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #B900B9;">// Chequeo de Conexión</span><br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Conectando con FTP..."</span>, <span style="color: #ff0000;">"Aguarde..."</span>,;<br />           <span style="color: #000000;">&#123;</span> || ::<span style="color: #000000;">oInternet</span>:= TInternet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> lConxOk:= !Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oInternet</span>:<span style="color: #000000;">hSession</span> <span style="color: #000000;">&#41;</span>, ;<br />                    <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oFTP</span>:= TFTP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> _SITIO, ::<span style="color: #000000;">oInternet</span>, _USER, _PASSW <span style="color: #000000;">&#41;</span>, ;<br />                      <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> lConxOk:= !Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oFTP</span>:<span style="color: #000000;">hFTP</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span>, ;<br />                          <span style="color: #000000;">&#40;</span> Alert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"No se puede conectar con el sitio FTP:"</span>+CRLF+ ;<br />                                   _SITIO+CRLF+<span style="color: #ff0000;">"reintente luego"</span>,, <span style="color: #ff0000;">"Imposible continuar"</span>,, IDI_HAND, <span style="color: #00C800;">TRUE</span> <span style="color: #000000;">&#41;</span>, ;<br />                            ::<span style="color: #000000;">oInternet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />                    <span style="color: #000000;">&#40;</span> Alert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Sesión de Internet no disponible!"</span>,, <span style="color: #ff0000;">"Lo siento"</span> <span style="color: #000000;">&#41;</span>, ;<br />                      ::<span style="color: #000000;">oInternet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />  <br /><span style="color: #B900B9;">// En otro metodo chequeo la existencia del archivo que voy a descargar</span><br />   ...<br />   cWebPath:= <span style="color: #ff0000;">"public_html/backup/"</span><br />   aFileBack:= ::<span style="color: #000000;">oFTP</span>:<span style="color: #000000;">Directory</span><span style="color: #000000;">&#40;</span> cWebPath+cArchUnPack <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">if</span> ! aFileBack<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>F_SIZE<span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span><br />         aFuenteW  := <span style="color: #000000;">&#123;</span> cWebPath+cArchUnPack <span style="color: #000000;">&#125;</span><br />         aDestinoHD:= <span style="color: #000000;">&#123;</span> cPathUnPack+<span style="color: #ff0000;">"<span style="color: #000000;">\"</span>+cArchUnPack }<br />      else<br />         Alert( "</span>No existe el archivo <span style="color: #ff0000;">"+Upper( cArchUnPack )+"</span> !<span style="color: #ff0000;">"+CRLF+ ;<br />                "</span>en el sitio: <span style="color: #ff0000;">"+_SITIO+CRLF+ ;<br />                "</span>Verifique que hayan hecho la copia de seguridad<span style="color: #ff0000;">",, "</span>Imposible Restaurar<span style="color: #ff0000;">",, IDI_HAND, TRUE )<br /><br />         return( nil )<br />      end<br /></span></div>[/code:1w1jpwmg]
oFtp:Directory() devuelve nombres erroneos
Hola, El metodo Directory de la clase oFtp devuelve, algunas veces, nombres de ficheros con caracteres extraños y/o incluyendo varios archivos en el mismo nombre ? El asunto me viene pasando desde hace varios años, pero sólo hoy me he atrevido a explicar. No he visto este asunto referenciado en el foro. ¿ Alguna idea de alguien ? Salu2
oFtp:Directory() devuelve nombres erroneos
Mira se ayuda: [url:74pntr75]https&#58;//www&#46;4shared&#46;com/rar/j7hmst-Jba/meuftp&#46;html[/url:74pntr75] Saludos.
oFtp:Directory() devuelve nombres erroneos
Estimado Señor, Lo que vd. me propone es un cambio total en mi forma de manejar el Ftp. Yo, en cambio, sólo preguntaba por un pequeño error que tiene la clase Ftp. Gracias en todo caso.
oFtp:Directory() devuelve nombres erroneos
Estimado Paquito, ¿Puede ser que el servidor esté enviando los nombres en UTF-8? Si es así seguramente se ven mal. ¿Puedes subir un ejemplo para ver cual es el posible cambio? Eso de tener varios ficheros con el mismo nombre puede ser provocado por la confusión al consultar si existe un determinado fichero con un caracter especial (con tilde, por ejemplo). Un saludo
oFtp:Directory() devuelve nombres erroneos
Estimadísimo Carlos, Un ejemplo de fichero que erroneamente devuelve el metodo oFtp:Directory(), sería este: "045in 0 LŒ. € È`RÿÓ Ÿ D FILECSV.zip" El archivo real es FILECSV.zip, pero lo devuelve con caracteres sucios. Practicamente pasa siempre que hago un oFtp:Directory() Utilizo la clase TFtp y el metodo de oFtp:Directory() originales. Gracias por tu interés.
oFtp:Directory() devuelve nombres erroneos
Vuelvo con el asunto. He hecho unas investigaciones y todo apunta a que el problema es un problema de codificacion. Pareciera que hay que apagar el UTF8 antes de hacer el oftp:directory Lo que me parece muy raro es que a nadie le haya pasado antes. ¿ Es que nadie usa ftp-fwh contra servidores trabajando en utf-8? <!-- m --><a class="postlink" href="https://stackoverflow.com/questions/11775604/php-ftp-get-folder-name-with-utf8-encoding/26101338">https://stackoverflow.com/questions/117 ... g/26101338</a><!-- m --> La pregunta seria: ¿ Como mandar al ftp el comando OPTS UTF8 OFF ?
oFtp:Directory() devuelve nombres erroneos
Actualmente tienes el UTF8 activo en tu aplicacion? Si no es asi, deberías probar activando el UTF8, quiero decir en el proceso que utiliza FTP [code=fw:23cgrjec]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />  <span style="color: #00C800;">local</span> cOldCode  := HB_SETCODEPAGE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"UTF8"</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #B900B9;">//local lUni        := FW_SetUnicode( .T. )</span><br />   .../..<br /><br />   HB_SETCODEPAGE<span style="color: #000000;">&#40;</span> cOldCode <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">//FW_SetUnicode( lUni )</span><br /><br /> </div>[/code:23cgrjec]
oFtp:Directory() devuelve nombres erroneos
Cristobal, Gracias por tu respuesta, pero no creo que deba ser eso. A veces el oFtp:Directory me devuelve archivos con este nombre: è`r+``er`w´rèëëé3´´3algo.zipr`w´rèëëé3fichero.zip donde se puede observar que vienen dos archivos. Es como si no entendiera el caracter LF o asi. Es como si el server ftp estuviera en *nix OS y no se entendiera con Windows. Esto ya lo vi hace tiempo con otra aplicacion. Para "salvarlo" lo que hice fue depurar el array aDir devuelto en aDir:= oFtp:Directory() Lo curioso es que a nadie más le haya pasado. Saludos
oFtp:Directory() devuelve nombres erroneos
[quote="hmpaquito":1x09mnib]Cristobal, Gracias por tu respuesta, pero no creo que deba ser eso. Saludos[/quote:1x09mnib] Paco, si puedes, prueba lo que te digo a ver qué te devuelve
oFtp:Directory() devuelve nombres erroneos
Cristobal, Ok, haré lo que me dices. Voy a hacer un testing a ver que me devuelve antes y despues, indicando la codificacion que me dices. gracias por tu interés.
oFtp:Directory() devuelve nombres erroneos
Traigo un ejemplo del array que devuelve el metodo oFtp:Directory() (está todo pasado a cadena) [code=fw:3io9rmlu]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>C. Len: <span style="color: #000000;">12</span> <span style="color: #ff0000;">"011XSL.zip"</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>N. <span style="color: #000000;">1740</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>D. <span style="color: #000000;">21</span>/<span style="color: #000000;">06</span>/<span style="color: #000000;">18</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>C. Len: <span style="color: #000000;">8</span> <span style="color: #ff0000;">"18:25:00"</span> <span style="color: #000000;">&#125;</span> <br />&nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>C. Len: <span style="color: #000000;">12</span> <span style="color: #ff0000;">"015XSL.zip"</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>N. <span style="color: #000000;">529</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>D. <span style="color: #000000;">21</span>/<span style="color: #000000;">06</span>/<span style="color: #000000;">18</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>C. Len: <span style="color: #000000;">8</span> <span style="color: #ff0000;">"18:01:00"</span> <span style="color: #000000;">&#125;</span> <br />&nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>C. Len: <span style="color: #000000;">44</span> <span style="color: #ff0000;">"034in &nbsp; &nbsp;æû)&nbsp; Ô &nbsp; &nbsp;Ì &nbsp;D &nbsp; &nbsp; &nbsp;011XSL.zip"</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>N. <span style="color: #000000;">0</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>D. <span style="color: #000000;">21</span>/<span style="color: #000000;">06</span>/<span style="color: #000000;">18</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>C. Len: <span style="color: #000000;">8</span> <span style="color: #ff0000;">"14:10:00"</span> <span style="color: #000000;">&#125;</span> <br />&nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>C. Len: <span style="color: #000000;">44</span> <span style="color: #ff0000;">"045BuscaClientes.dat &nbsp;D &nbsp; &nbsp; &nbsp;015XSL.zip"</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>N. <span style="color: #000000;">26403</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>D. <span style="color: #000000;">20</span>/<span style="color: #000000;">06</span>/<span style="color: #000000;">18</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>C. Len: <span style="color: #000000;">8</span> <span style="color: #ff0000;">"20:23:00"</span> <span style="color: #000000;">&#125;</span><span style="color: #ff0000;">"</span></div>[/code:3io9rmlu] Si os dais cuenta, los dos primeros items son correctos: dos ficheros. En cambio los dos ultimos están mal: tienen caractereres extraños, uno contiene dos nombres de archivo.
oFtp:Directory() devuelve nombres erroneos
Cristobal, Acabo de probar tu indicacion y sigue saliendo mal. ¿ Alguna idea más que puedas compartir ? Gracias PD 1. El UTF8 del hb_SetCodePage() lo coge bien puesto que lo muestro, despues de establecerlo con msgInfo(hb_setCodePage()) y muestra UTF8 PD 2. Es como si la clase TFtp no recogiese bien el directory porque no se parase en el separador LF o el que corresponda y por tanto mezclara mas de un nombre de archivo con cada archivo y ademas le añadiera basura. ** EDITADO 23/6/18 ** Adjunto codigo fuente de la prueba [code=fw:35ldv293]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//-------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> probandoftp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oInternet := TInternet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oFtp<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aFiles<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nI, aMask, cIp, nPuerto, cUser, cPassword<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> cFolder:= <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> cFull<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> lPasivo:= .t.<br /><br />&nbsp; &nbsp;REQUEST HB_CODEPAGE_UTF8<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> cOldCode<br /><br />&nbsp; &nbsp;cOldCode:= Hb_SetCodepage<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"UTF8"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>coldcode, hb_setcodepage<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; cIp &nbsp; &nbsp; &nbsp;:= <span style="color: #ff0000;">"prueba.algo.com"</span><br />&nbsp; &nbsp; &nbsp; nPuerto &nbsp;:= &nbsp;<span style="color: #000000;">2043</span><br />&nbsp; &nbsp; &nbsp; *<br /><br /><br />&nbsp; &nbsp; &nbsp; cUser &nbsp; &nbsp;:= <span style="color: #ff0000;">"ELUSUARIO"</span><br />&nbsp; &nbsp; &nbsp; cPassword:= <span style="color: #ff0000;">"4c3PASS"</span><br />&nbsp; &nbsp; &nbsp; *<br />&nbsp; &nbsp; &nbsp; oFTP &nbsp; &nbsp; &nbsp;:= TFTP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cIp, oInternet, cUser, cPassword, lPasivo, nPuerto <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> oFTP:<span style="color: #000000;">hFTP</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;amask:= <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"*.zip"</span>, <span style="color: #ff0000;">"*.*"</span>, <span style="color: #ff0000;">"*.sql"</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> ni:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>amask<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cFull:= cFolder+ <span style="color: #ff0000;">"/"</span>+ aMask<span style="color: #000000;">&#91;</span>nI<span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aFiles = oFTP:<span style="color: #000000;">Directory</span><span style="color: #000000;">&#40;</span> cFull<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msgInfo</span><span style="color: #000000;">&#40;</span>hb_valtoexp<span style="color: #000000;">&#40;</span>aFiles<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"oFtp:hFtp is Null"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;oInternet:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Done!"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;HB_SETCODEPAGE<span style="color: #000000;">&#40;</span> cOldCode <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />*</div>[/code:35ldv293]
oFtp:Directory() devuelve nombres erroneos
Segun <!-- m --><a class="postlink" href="https://stackoverflow.com/questions/42025253/does-ftp-support-utf-character-set">https://stackoverflow.com/questions/420 ... racter-set</a><!-- m --> hay q trabajar el ftp en modo binary. Sabe alguien como establecer el ftp en modo binary ?
oFtp:SetCurrentDirectory / oFtp:GetCurrentDirectory
Olá, Para setar o diretorio corrente no ftp eu uso: oFtp:SetCurrentDirectory() e para buscar o nome do diretorio atual ? Não achei nada sobre oFtp:GetCurrentDirectory() Obrigado, Rossine.
oGet : Seleccionar todo
En un objeto GET necesito que, al tomar el foco, se quede todo seleccionado, al igual que hace el submenú del oGet "Seleccionar todo". He probado con oGet:bGotFocus = { || oGet:SelectAll() } pero no funciona. Utilizo FWH 2.8 y xHarbour 0.99.61
oGet : Seleccionar todo
[quote="Manuel Aranda":bxmf2qpk]En un objeto GET necesito que, al tomar el foco, se quede todo seleccionado, al igual que hace el submenú del oGet "Seleccionar todo". He probado con oGet:bGotFocus = { || oGet:SelectAll() } pero no funciona. Utilizo FWH 2.8 y xHarbour 0.99.61[/quote:bxmf2qpk] // Testing a GET #include "FiveWin.ch" [code:bxmf2qpk] //------------------------------------------------------------------------// function Main&#40;&#41; local oDlg local dDay &#58;= Date&#40;&#41; local oGet DEFINE DIALOG oDlg TITLE "Just a get" @ 2, 2 SAY "Date&#58;" OF oDlg @ 2, 6 GET oGet VAR dDay OF oDlg SIZE 40, 10 SPINNER ; VALID ! Empty&#40; dDay &#41; @ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg&#58;End&#40;&#41; @ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg&#58;End&#40;&#41; CANCEL oGet&#58;bGotFocus &#58;= &#123; || oGet&#58;SelectAll&#40;&#41; &#125; ACTIVATE DIALOG oDlg CENTERED return nil //------------------------------------------------------------------------// procedure AppSys // Xbase++ requirement return //------------------------------------------------------------------------// #ifdef __XPP__ #define GetNew _GetNew #endif CLASS TClipGet FROM Get METHOD Display&#40;&#41; VIRTUAL ENDCLASS //---------------------------------------------------------------------------// function GetNew&#40; nRow, nCol, bVarBlock, cVarName, cPicture, cColor &#41; return TClipGet&#40;&#41;&#58;New&#40; nRow, nCol, bVarBlock, cVarName, cPicture, cColor &#41; //---------------------------------------------------------------------------// [/code:bxmf2qpk] Saludos
oGet : Seleccionar todo
Gracias, karinha, pero sigue sin funcionar. Supongo que tendrá que ver con la versión de fwh que tengo. Saludos, Manuel
oGet : Seleccionar todo
Manuel, METHOD SelectAll() INLINE ::SetSel( 0, -1 )
oGet : Seleccionar todo
Antonio: Así es como lo tengo en TGET.PRG y no funciona. En realidad lo que me ocurre es que en el menú contextual del oGet la opción "Pegar" no funciona correctamente, es decir, hay que seleccionar previamente todo el contenido del oGet para que "Pegar" te copie todo el contenido de "Copiar", si no es así, se produce un pegado parcial. Saludos, Manuel
oGet:Cadena de caracteres
Hola,"oGet:cText" me devuelve el ultimo caracter de la cadena que se esta creando en el GET.Como obtengo la cadena completa que se esta formando?Por ejemplo si estoy escribiendo NOMBRE, oGet:cText me devuelve cada una de las letras a medida que voy escribiendo la palabra NOMBRE; lo que quiero es que me devuelva la cadena completa escrita hasta ese momento; que cuando presione M me devuelva "NOM" y no sola 'M". Lo que quiero es tener la cadena de un numero para calcular otros campos a medida que se van entrando los numeros y no tener que esperar salir del campo para hacer dicho calculo con la opcion VALID.Saludos,George
oGet:Cadena de caracteres
[quote="George":46dy3omn]Hola, "oGet:cText" me devuelve el ultimo caracter de la cadena que se esta creando en el GET. Como obtengo la cadena completa que se esta formando? Por ejemplo si estoy escribiendo NOMBRE, oGet:cText me devuelve cada una de las letras a medida que voy escribiendo la palabra NOMBRE; lo que quiero es que me devuelva la cadena completa escrita hasta ese momento; que cuando presione M me devuelva "NOM" y no sola 'M". Lo que quiero es tener la cadena de un numero para calcular otros campos a medida que se van entrando los numeros y no tener que esperar salir del campo para hacer dicho calculo con la opcion VALID. Saludos, George[/quote:46dy3omn]George:Aquí está este ejemplo. Espero te sirva.#include "FiveWin.ch"#include "Inkey.ch"function Main() local oDlg, oGet, oBtn local cText := space( 40 ) local nKey:=LastKey() DEFINE DIALOG oDlg FROM 2,2 TO 10,50 @1,2 GET oGet VAR cText OF oDlg oGet:bPostKey := { || MsgInfo( Left(oGet:cText,oGet:nPos-1)+CHR(nKey) ) } @2,2 BUTTON oBtn PROMPT "Saliendo" OF oDlg ACTION oDlg:End() ACTIVATE DIALOG oDlg CENTEREDreturn nilSaludosFrancisco J. Alegría P.Chinandega, Nicaragua
oGet:Cadena de caracteres
George,Prueba con oGet:GetText()
oGet:Cadena de caracteres
Francisco / AntonioGracias por contestar.Francisco,Tu ejemplo trabaja perfecto. Antonio,Usando "oGet:GetText()" estaba obteniendo el mismo resultado que usando oGet:cText; es decir solo me presentaba el ultimo caracter tecleado.El problema era que estaba usando un msginfo() y la clausula UPDATE y esto me causaba ese problema.Con la ayuda de ustedes ya se como resolver este problema.GraciasGeorge
oGet:KeyChar()
Hello Antonio, In my programs I use the nearly the same code as c:\FWH\samples\keybsim.prg for keyboard input with a touchscreen. Since the last or one of the last updates of Fivewin this does not work any more. Please test keybsim.prg. Thanks in advance and best regards, REDEFINE BUTTON oBtn1 ID 101 OF oDlg ACTION (MsgBeep(),; oGet1:SetFocus(.t.),; oGet1:KeyChar(ASC("1"))) Mag. Otto Atzwanger
oGet:KeyChar()
Linking in control.prg from dez. 2010 resolves the problem. Best regards, Otto
oGet:KeyChar()
Hello Antonio, If I change the new method _SetFocus() with the method _SetFocus() from Dez. 2010 all is working. Can you please advice me what to do. Best regards, Otto [code=fw:2cnn3gfj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />METHOD _SetFocus() CLASS TControl<br /><br />&nbsp; &nbsp;local hCtrlNext<br /><br />&nbsp; &nbsp;if ::lWhen()<br />&nbsp; &nbsp; &nbsp; if ::oWnd:IsKindOf( "TDIALOG" )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::oWnd:PostMsg( WM_NEXTDLGCTL, ::hWnd, 1 )<br />&nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SetFocus( ::hWnd )<br />&nbsp; &nbsp; &nbsp; endif<br />&nbsp; &nbsp;else<br />&nbsp; &nbsp; &nbsp; hCtrlNext = GetWindow( ::hWnd, GW_HWNDNEXT )<br />&nbsp; &nbsp; &nbsp; if GetParent( hCtrlNext ) != ::oWnd:hWnd<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hCtrlNext = GetWindow( ::oWnd:hWnd, GW_CHILD )<br />&nbsp; &nbsp; &nbsp; endif<br />&nbsp; &nbsp; &nbsp; if ::oWnd:IsKindOf( "TDIALOG" )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::oWnd:PostMsg( WM_NEXTDLGCTL, hCtrlNext, 1 )<br />&nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SetFocus( hCtrlNext )<br />&nbsp; &nbsp; &nbsp; endif<br />&nbsp; &nbsp;endif<br /><br />return nil<br />*/</span><br /><br /><span style="color: #00C800;">METHOD</span> _SetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TControl<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hCtrlNext<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; SetFocus<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; hCtrlNext = GetWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, GW_HWNDNEXT <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> GetParent<span style="color: #000000;">&#40;</span> hCtrlNext <span style="color: #000000;">&#41;</span> != ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">hWnd</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hCtrlNext = GetWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">hWnd</span>, GW_CHILD <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; SetFocus<span style="color: #000000;">&#40;</span> hCtrlNext <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:2cnn3gfj]
oGet:KeyChar()
Otto, In your code instead of doing oGet:SetFocus(), do SetFocus( oGet:hWnd ) and use the most recent Class TControl Method SetFocus() code as it has advantages over previous versions <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
oGet:KeyChar()
Hello Antonio, c:\FWH\samples\keybsim.prg REDEFINE BUTTON oBtn1 ID 101 OF oDlg ACTION (MsgBeep(),; oGet1:SetFocus( oGet1:hWnd ),; oGet1:KeyChar(ASC("1"))) I tried this way but with no success. Do I need 11.9 version of FiveWin? Best regards, Otto
oGet:KeyChar()
Otto, There is a little error in your code, it is this way: REDEFINE BUTTON oBtn1 ID 101 OF oDlg ACTION (MsgBeep(),; SetFocus( oGet1:hWnd ),; oGet1:KeyChar(ASC("1")))
oGet:Paste()
Hi, in this little samples ther is a problem. Please try ths 1) select "Marco" from the first get using popget function selecting "Copia" (Copy) 2) then go to the second get. 3) you can note that text is selected ("Enrico") 4) click the right mouse and select "Incolla" (Paste) 5) the result is "EnricoMarco" This is wrong the result would be "Marco" because "Enrico" was selected Many thanks Marco [code=fw:2t2oh95i]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> EM_SETSEL <span style="color: #000000;">177</span><br /><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oDlg<br />   <span style="color: #00C800;">local</span> oGet1 , cGet1 := <span style="color: #ff0000;">"Marco                "</span><br />   <span style="color: #00C800;">local</span> oGet2 , cGet2 := <span style="color: #ff0000;">"Enrico               "</span><br />   <span style="color: #00C800;">local</span> oGet3 , cGet3 := <span style="color: #ff0000;">"                     "</span><br /><br /><br />   <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg<br /><br />   @ <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">get</span> oGet1 <span style="color: #0000ff;">var</span> cGet1 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">update</span><br /><br />   oGet1:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || oGet1:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> EM_SETSEL, Len<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> cGet1 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oGet1:<span style="color: #000000;">bRClicked</span>  := <span style="color: #000000;">&#123;</span> || PopGet<span style="color: #000000;">&#40;</span> oGet1 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   @ <span style="color: #000000;">2</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">get</span> oGet2 <span style="color: #0000ff;">var</span> cGet2 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">update</span><br />   oGet2:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || oGet2:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> EM_SETSEL, Len<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> cGet2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oGet2:<span style="color: #000000;">bRClicked</span>  := <span style="color: #000000;">&#123;</span> || PopGet<span style="color: #000000;">&#40;</span> oGet2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   @ <span style="color: #000000;">3</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">get</span> oGet3 <span style="color: #0000ff;">var</span> cGet3 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">update</span><br />   oGet3:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || oGet3:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> EM_SETSEL, Len<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> cGet3 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oGet3:<span style="color: #000000;">bRClicked</span>  := <span style="color: #000000;">&#123;</span> || PopGet<span style="color: #000000;">&#40;</span> oGet3 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">FUNCTION</span> POPGET<span style="color: #000000;">&#40;</span> oGet <span style="color: #000000;">&#41;</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oMen<br /><br /><br /> <span style="color: #0000ff;">MENU</span> oMen <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br /><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Taglia"</span>           <span style="color: #0000ff;">ACTION</span> oGet:<span style="color: #000000;">Cut</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copia"</span>            <span style="color: #0000ff;">ACTION</span> oGet:<span style="color: #000000;">Copy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Incolla"</span>          <span style="color: #0000ff;">ACTION</span> oGet:<span style="color: #000000;">Paste</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Annulla"</span>          <span style="color: #0000ff;">ACTION</span> oGet:<span style="color: #000000;">Undo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Svuota"</span>           <span style="color: #0000ff;">ACTION</span> svuota<span style="color: #000000;">&#40;</span> oget <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Seleziona"</span>        <span style="color: #0000ff;">ACTION</span> oGet:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> EM_SETSEL, Len<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">varget</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Seleziona tutto"</span>  <span style="color: #0000ff;">ACTION</span> oGet:<span style="color: #000000;">SelectAll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> oMen:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">nBottom</span> , oGet:<span style="color: #000000;">nLeft</span> , oGet <span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> SVUOTA<span style="color: #000000;">&#40;</span> oGet <span style="color: #000000;">&#41;</span><br />M->xSvuotata := oget:<span style="color: #000000;">varget</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />M->cGetCargo := oget:<span style="color: #000000;">cargo</span><br />oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> uValBlank<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">VarGet</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2t2oh95i]
oGet:Paste()
Thank you Enrico!
oGet:Paste()
[code=fw:1k39yxvz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Incolla"</span> <span style="color: #0000ff;">ACTION</span> INCOLLA<span style="color: #000000;">&#40;</span> oGet <span style="color: #000000;">&#41;</span></div>[/code:1k39yxvz] [code=fw:1k39yxvz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> INCOLLA<span style="color: #000000;">&#40;</span> oGet <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> nLo, nHi<br /><br />&nbsp; &nbsp; oGet:<span style="color: #000000;">GetSelPos</span><span style="color: #000000;">&#40;</span> @nLo, @nHi <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> nHi != nLo<br />&nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">GetDelSel</span><span style="color: #000000;">&#40;</span> nLo, nHi <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; oGet:<span style="color: #000000;">EditUpdate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; oGet:<span style="color: #000000;">Paste</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1k39yxvz] EMG
oGet:SetBrush ( daniel )
Why when i SetBrush to a GET all other receive same brush ? i want use setbrush distinct the get´s. someone can help ?
oGet:SetBrush ( daniel )
I tryed use DrawBitmap( hDc, gBmp, 0, 0 ) it´s Work, more make hidden in Text of Get. <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> [code=fw:1wkwf7ve]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> filldis<span style="color: #000000;">&#40;</span> hDC, oGet<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> gBmp<br /><span style="color: #00C800;">if</span> .not. oGet:<span style="color: #000000;">lActive</span> <span style="color: #B900B9;">//.or. oGet:lReadOnly</span><br />&nbsp; &nbsp; &nbsp; gBmp:= GradientBmp<span style="color: #000000;">&#40;</span> oGet, oGet:<span style="color: #000000;">nWidth</span>, oGet:<span style="color: #000000;">nHeight</span>, <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">0.50</span>, nrgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">208</span>,<span style="color: #000000;">202</span><span style="color: #000000;">&#41;</span>, nrgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">161</span>,<span style="color: #000000;">149</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span><span style="color: #000000;">0.50</span>, nrgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">252</span>,<span style="color: #000000;">75</span>,<span style="color: #000000;">70</span> &nbsp;<span style="color: #000000;">&#41;</span>, nrgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">247</span>,<span style="color: #000000;">174</span>,<span style="color: #000000;">157</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DrawBitmap<span style="color: #000000;">&#40;</span> hDc, gBmp, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//DrawMasked( hDc, hPen, 0, 0 ) too no work</span><br /><span style="color: #B900B9;">/*<br />&nbsp;i tryed too create xBrush inside this function and SEtBush(xBrush) for oGET more <br />&nbsp;when make this, all get stay red. :( i want only get disabled...<br />*/</span><br />&nbsp; <br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1wkwf7ve]
oGet:SetBrush ( daniel )
Lailton i'm checking... i'll reply very soon
oGet:SetBrush ( daniel )
Okay thanks
oGet:SetBrush ( daniel )
Lailton... Brush Class before create a new brush verifies that new brush not same other. check: style, color, Bmp File or Bmp Res, but in our samples we not use these, so the brush class "think" is same brush each time we can use a little trick to solve it... [code=fw:dsd5g4y2]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> GradGet<span style="color: #000000;">&#40;</span> _oDlg <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oControl<br /><span style="color: #00C800;">local</span> aColors := ARRAY<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> hBmp, n<br /><span style="color: #00C800;">local</span> oBrush<br /><br />aColors <span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.4</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">231</span>, <span style="color: #000000;">240</span>, <span style="color: #000000;">244</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">159</span>, <span style="color: #000000;">212</span>, <span style="color: #000000;">240</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />                  <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.6</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">126</span>, <span style="color: #000000;">188</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">188</span>, <span style="color: #000000;">227</span>, <span style="color: #000000;">244</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />aColors <span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.4</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">253</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">144</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />                  <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.6</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">215</span>,  <span style="color: #000000;">76</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">153</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />  <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span>_oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#41;</span><br />     oControl:= _oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><br />     <span style="color: #00C800;">if</span> oControl:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"TGET"</span><br />        oControl:<span style="color: #000000;">lTransparent</span> = .T.<br />        oControl:<span style="color: #000000;">nTxtStyle</span> = <span style="color: #000000;">4</span><br />        hBmp = GradientBmp<span style="color: #000000;">&#40;</span> oControl,;<br />                            oControl:<span style="color: #000000;">nWidth</span>,;<br />                            oControl:<span style="color: #000000;">nHeight</span>,; <br />                            aColors<span style="color: #000000;">&#91;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n%<span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />        oBrush = TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> , n <span style="color: #000000;">&#41;</span><br />        oBrush:<span style="color: #000000;">hBrush</span> = CreatePatternBrush<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />        oControl:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">&#40;</span> oBrush <span style="color: #000000;">&#41;</span><br />        DeleteObject<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">endif</span><br /><br />  <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Nil</span></div>[/code:dsd5g4y2]
oGet:SetBrush ( daniel )
Daniel, How we can create an get effect as this ? [img:16pfgzet]http&#58;//www&#46;devcomponents&#46;com/dotnetbar/img/SuperValidator&#46;png[/img:16pfgzet] or [img:16pfgzet]http&#58;//www&#46;devcomponents&#46;com/dotnetbar/img/Highlighter&#46;png[/img:16pfgzet]
oGet:SetBrush ( daniel )
Hello Silvio Now we working in Button Skins maybe is ready for this month, after will begin with GET Skins
oGet:SetBrush ( daniel )
good daniel !!
oGet:SetPos() and date
Hi all, i have aproblem to set the cursor of a get to the very first position. I tried the following [code:1bts64r2]oSearch&#58;bGotFocus &#58;= &#123; || oSearch&#58;PostMsg&#40; WM_KEYDOWN, VK_HOME, 0 &#41;, SysRefresh&#40;&#41; &#125; oSearch&#58;bGotFocus &#58;= &#123; || oSearch&#58;nPos &#58;= 1, SysRefresh&#40;&#41; &#125; oSearch&#58;bGotFocus &#58;= &#123; || oSearch&#58;SetPos&#40; 1 &#41; &#125; [/code:1bts64r2] All three methods work ok if the get variable is of type character. But neither of these methods work if the get variable contains a date. I put a small selfcontainted sample here [url:1bts64r2]http&#58;//www&#46;d-hoefner&#46;de/files/test&#46;zip[/url:1bts64r2] May be someone knows a workaround for this? Thanks and regards, Detlef
oGet:SetPos() and date
this might help :- oSearch:bGotFocus := { || oSearch:selectall(), oSearch:nPos:= 1 }
oGet:SetPos() and date
[quote="tnhoe":1q0lzb7v]this might help :- oSearch:bGotFocus := { || oSearch:selectall(), oSearch:nPos:= 1 }[/quote:1q0lzb7v] Hoe, many thanks for your hint. Unfortunatelly it doesn' t work. If i click into the middle of a get with a date variable, the cursor remains at the position where i clicked. With character gets its working ok. Thanks for your time, Hoe. Regards, Detlef
oGet:SetPos() and date
If you will build a reduced and self-contained sample of the problem then I promise to experiment with it a little. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
oGet:SetPos() and date
Enrico, I already put a sample at <!-- m --><a class="postlink" href="http://www.d-hoefner.de/files/test.zip">http://www.d-hoefner.de/files/test.zip</a><!-- m --> thanks for jumping in. Regards, Detlef
oGet:SetPos() and date
Try this: [code:k2lcc6k2]oSearch&#58;bGotFocus &#58;= &#123; || oSearch&#58;PostMsg&#40; WM_KEYDOWN, VK_HOME &#41; &#125;[/code:k2lcc6k2] EMG
oGet:SetPos() and date
[quote="EnricoMaria":3aa98cb4]Try this: [code:3aa98cb4]oSearch&#58;bGotFocus &#58;= &#123; || oSearch&#58;PostMsg&#40; WM_KEYDOWN, VK_HOME &#41; &#125;[/code:3aa98cb4] EMG[/quote:3aa98cb4] Enrico, as usual, your advice is a good one. It' s working as expected now <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> . Thanks a lot for your time. Regards, Detlef
oGet:bGotFocus Problem
I am trying to change the behavior of a GET using bGotFocus. I want the cursor to be in the 1 postion when the GET is entered and to clear the contents of the GET if the user starts typing in the first postion. The code below works when you tab or shift-tab into the GET but [b:3c12mmah]not[/b:3c12mmah] if you click into the GET. Strangely, you do hear the tone() when clicking into the GET so the codeblock is getting eval'd, but there must be other code that is getting called after the codeblock which then moves the cursor back to the click position. I have been working on this for hours with no luck. Using May 2006 FWH. Any ideas on a solution? James ------------------------- [code:3c12mmah]#include "fivewin&#46;ch" function main&#40;&#41; local oDlg, oGet, cName&#58;= "Microsoft ", oGet2, cAddress&#58;=space&#40;22&#41;, oBtn define dialog oDlg @ 1,1 get oGet var cName of oDlg oGet&#58;bGotFocus&#58;= &#123;|| oGet&#58;gohome&#40;&#41;, oGet&#58;oGet&#58;clear&#58;=&#46;t&#46;, tone&#40;300,1&#41; &#125; @ 2,1 get oGet2 var cAddress of oDlg update activate dialog oDlg return nil[/code:3c12mmah]