topic
stringlengths
1
63
text
stringlengths
1
577k
generar listado a pdf
Verhoven, Puedes instalar PDFCreator que es gratis (open source): <!-- m --><a class="postlink" href="https://sourceforge.net/project/showfiles.php?group_id=57796">https://sourceforge.net/project/showfil ... p_id=57796</a><!-- m --> Te instala una impresora que automaticamente te genera el fichero PDF preguntándote el nombre, etc. Solo tienes que imprimir en ella y te crea el fichero PDF. En caso de que no quieras tener que seleccionar la impresora, puedes usar la clase TPdf que es una contribución libre que tiene xharbour (CVS).
generar listado a pdf
Me puedes dar la dirección http del CVS o de las contribuciones para bajar la Tpdf, porque lo que necesito es generar directamente el pdf. Saludos.
generar listado a pdf
Puedes ir a <!-- w --><a class="postlink" href="http://www.sourceforge.net">www.sourceforge.net</a><!-- w --> y buscar xharbour y descargarlo desde los ficheros en el CVS, ó si tienes cvs.exe hacer estas llamadas: cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/xharbour login cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/xharbour co xharbour Pulsa enter en la primera llamada cuando te pida el login (no tienes que escribir nada) El cvs.exe puedes descargarlo desde aqui: <!-- m --><a class="postlink" href="ftp://ftp.harbour-project.org/dev/cvs.zip">ftp://ftp.harbour-project.org/dev/cvs.zip</a><!-- m -->
generar listado a pdf
Y ¿cómo se hace so Oskar?. Tengo instalado el openoffice. Pero no se más. Saludos.
generar listado a pdf
[quote="Verhoven":7ggtleo1]Y ¿cómo se hace so Oskar?. Tengo instalado el openoffice. Pero no se más. Saludos.[/quote:7ggtleo1] Verhoven, <!-- m --><a class="postlink" href="http://oskar.sytes.net">http://oskar.sytes.net</a><!-- m --> Ahi tienes la clase para generar PDF. Te contesta oskar directamente ahí, te sugiero darte de alta.
generar listado a pdf
Me dice que no se puede mostrar la página. Saludos.
generar listado a pdf
Perdón si resulto pesado pero ahora al pinchar en esa que dice aquí tienes la clase me sale lo siguiente: [i:2kfpcjwl]Directly downloading images is not permitted on the Netfirms FREE plan. If you are the owner of this site, either ensure that this image is embedded in a web page, or upgrade to one of the Netfirms premium plans. [/i:2kfpcjwl] No se que significa. Pero si puedes me lo mandas a la dirección de correo directamente: pazbores(arroba)yahoo.es Saludos
generar listado a pdf
Estimado Oskar, he conseguido compilar tu clase y ver el ejemplo, que por cierto falla al intentar poner datos en celdas aunque apunta muy buenas maneras especialmente paro los que usamos openoffice, pero en cualquier caso, no veo la manera de mandar a un fichero pdf un listado generado con el objeto PRINT de fw usando esta clase tuya. Saludos.
generar listado a pdf
El compilador de puertosur para xharbour 2.4.
generar listado a pdf
Oskar se puede acceder a Writer con esa clase? Atte CDG
generar listado a pdf
[quote="oskar":3f919fp4]Verhoven aqui tienes la clase [url=http&#58;//olin&#46;netfirms&#46;com/TOO&#46;zip:3f919fp4]TOpenOffice[/url:3f919fp4] en el zip va un fichero que se llama Main.Prg, es un programa de demo que te muestra lo que puedes hacer con la clase espero te sirva[/quote:3f919fp4] Oskar, he tratado inutilmente de registrarme en tu sitio, podrías por favor enviarme a mi también esta clase?
generar listado a pdf
baixei o pdfcretor .muito bom.. mas eu quero somente alguns relatorios em pdf e gostaria de controlar dentro do Five, -------------------------------------------------------------------------------- Posted: Sat Mar 11, 2006 2:11 pm Post subject: -------------------------------------------------------------------------------- Tambien puedes usar OpenOffice y su componente COM/OLE, generas el informe como en la TExcelS y lo exportas a PDF sin necesidad de tener una impresora PDF -------------------------------------------------------------------------------- Tem algum exemplo da dica acima ? <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> Ari
generar pdf e imprimirlo se puede?
Quiero hacer lo siguiente Generar en formar silenciosa (sin intervención del usuario) el pdf y luego imprimirlo sin previsualizar nada lo que hago ahora es generar 2 veces el mismo reporte, el primero va a pdf y el siguiente a impresión directa quizás esté la opción y yo no estoy viendo como se hace gracias de antemano PRINT oPrn FILE "abc.pdf" --> Saves out put to abc.pdf silently or PRINT oPrn FILE 'PDF' --> prompts for a file name and saves to the file silently or PRINT oPrn PREVIEW FILE "abc.pdf" --> saves to 'abc.pdf' and displays abc.pdf
generar pdf e imprimirlo se puede?
Talvez: [url:14dyfcj8]http&#58;//www&#46;sumatrapdfreader&#46;org/free-pdf-reader-pt&#46;html[/url:14dyfcj8] [url:14dyfcj8]http&#58;//www&#46;sumatrapdfreader&#46;org/manual-pt&#46;html[/url:14dyfcj8] [url:14dyfcj8]http&#58;//forums&#46;fofou&#46;org/sumatrapdf/[/url:14dyfcj8] Via código: [code=fw:14dyfcj8]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   WinExec<span style="color: #000000;">&#40;</span> cDirExe+<span style="color: #ff0000;">"sumatra<span style="color: #000000;">\s</span>umatrapdf.exe -reuse-instance -lang pt "</span>+<span style="color: #ff0000;">"ABC.PDF"</span> <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">//-restrict -fullscreen</span><br /> </div>[/code:14dyfcj8] Saludos.
generating index on the fly?
Hi, I have a database opened in shared mode and indexed. I can´t close the database or the index. I would like to add a new index on the fly, do a report, and restore the original index, but I can´t close either the database or index. There must be: openfile() .... doreport() function openfile() select 1 use test index test shared new select 2 use other index other shared new function doreport() select 1 saveoriginalindex() createnewindexonthefly() report restoreoriginalindex() I have tried set index &tempind additive and OrdSetFocus( 1), but always uses the new temp index, not the original one that I must restore. How can I do it?. Thanks a milion!!!!!!!!!!!!!!!!!!!!!
generating index on the fly?
The easier way might be to open your original table in a new area with a different alias. EMG
generating index on the fly?
Yes, you were right!!!!. Thanks a lot!!!!!!!
gestione folder
ciao a tutti,io vorrei creare un folder con 5 pagine, e vorrei se possibile nonfare vedere i tab tipo 1 2 3 4 5e in più mi serve sapere come posso inserire un pulsante next e previn modo tale che se premo next mi attiva la pagina successiva del folderse premo prev la pagina precedente.è possibile avere un esempio in merito?Grazie milleP.s. utilizzo la FWPPC
gestione folder
sbaglio ma c'è un po' di confusione nella domanda[code:1nytp56t] #include "FWCE&#46;ch" function main&#40;&#41; local oWnd, oFld, i DEFINE WINDOW oWnd TITLE "folder" @ 0&#46;5, 1 FOLDER oFld PROMPTS "1", "2", "3","4","5" ; SIZE 225, 245 ACTIVATE WINDOW oWnd return nil [/code:1nytp56t]questo fa il folder con 5 tabpoi per bloccarli devi aggiungereoFld:aEnable := { .f., .f., .f., .f., .f., .f.}poi per fare il bottone per andare avanti di un folder REDEFINE BUTTON obtn_next OF oFld:aDialogs[1] ACTION oFld:SetOption(2)poi per il resto devi chiedere a emg
gestione folder
grazie mille Silvio e quasi tutto quello che mi serviva,a parte nascondere i tab...un'altra cosa, ho un bottone creato cosi:@ 0.1, 8 BTNBMP aCtl[ 6 ] FILE CurDir() + "\floppy.bmp" ; PROMPT "Salva"; SIZE 50, 50 ; ACTION (msginfo('salvato') OF oFld:aDialogs[ 1 ]però la scritta salva che ho messo nel parametro promptmi scrive al centro del bottone facendo confusione con la bitmap floppy.bmp associata, si potrebbe dire che la scritta che metto del parametro prompt la sposti in basso alla bitmap e non al centro?grazie mille
gestione folder
[ <layout: CENTER, TOP, LEFT, BOTTOM, RIGHT> ]
gestione folder
SCUSAMI HO PROVATO,MA MI METTE LA SCRITTA sALVA SEMPRE AL CENTRO DOVE SBAGLIO?ECCO L'ESEMPIO@ 0.1, 8 BTNBMP aCtl[ 6 ] FILE CurDir() + "\floppy.bmp" ; PROMPT "Salva" layout BUTTOM ; SIZE 50, 50 ; ACTION (mSGINFO('SALVA')); OF oFld:aDialogs[ 1 ]
gestione folder
@ 0.1, 8 BTNBMP aCtl[ 6 ] FILE CurDir() + "\floppy.bmp" ; PROMPT "Salva" BOTTOM ; SIZE 50, 50 ; ACTION (mSGINFO('SALVA')); OF oFld:aDialogs[ 1 ]
gestione rete lan
Ciao a tutti! stò cercando di realizzare un software per gestire una rete con fwh per fare il trace route,vedere i servizi attivi ecc. qualcuno a documentazione a riguardo? Dino
gestión de licencias concurrentes en red local
Hola, Como vamos a utilizar definitivamente MSVC, no vamos a poder seguir utilizando las mochilas de Safenet en modo red lan porque no tenemos los fuentes de la librería que hizo Ren e Flores. Había pensado en controlarlo con la base de datos de los usuarios que está en el servidor , de modo que cuando se entra al programa al seleccionar el usuario y autentificarse, marco el campo lConectado con .T., y cuando sale del programa lo marco como .F., de modo que: - No se pueden crear más usuarios que los adquiridos. (esto no plantea problemas) - Un usuario no puede iniciar sesión más de 1 vez, porque se controla con lConectado. El problema me surge cómo tratar las salidas anormales del programa, bien por cuelgue, corte de luz, etc, porque en el servidor lConectado seguirá en .T. y no le dejará volver a iniciar sesión. Si permito liberar la sesión entonces nos van a engañar porque el usuario se logueará, y luego el Administrador le liberará la sesión, burlándose así el control de las licencias en red. ¿Se os ocurre por favor alguna idea?. Muchísimas gracias. Un saludo
gestión de licencias concurrentes en red local
Mira a ver si esto te sirve !!! [code=fw:g5n0kfod]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> SP_UPDCMD_CHANGE_DEVICE_TIME       0x21<br /><br /><span style="color: #00C800;">Function</span> SNGetHora<span style="color: #000000;">&#40;</span> hHeader, aData <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span> SFNTGetDeviceInfo<span style="color: #000000;">&#40;</span> hHeader, @aData <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Function</span> SNGetString<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------------------------------------</span><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"SentinelKeys.h"</span>         <span style="color: #B900B9;">/*  Header file for the Sentinel Keys client library  */</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"SentinelKeysLicense.h"</span>  <span style="color: #B900B9;">/*  Header file for this License  */</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #B900B9;">// Obtiene la licencia</span><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SFNTGETLICENSE <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />  SP_HANDLE license ;<br />  hb_retnl<span style="color: #000000;">&#40;</span> SFNTGetLicense<span style="color: #000000;">&#40;</span> DEVELOPERID, SOFTWARE_KEY, LICENSEID, <span style="color: #000000;">32</span>, &license <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />  hb_stornl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> license, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #B900B9;">// Lee un string desde  la llave</span><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SFNTREADSTRING <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   SP_BYTE value<span style="color: #000000;">&#91;</span> <span style="color: #000000;">256</span> <span style="color: #000000;">&#93;</span>;<br />   SP_DWORD length = hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>;<br /><br />   hb_retnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> SFNTReadString<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> SP_HANDLE <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> SP_DWORD <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, value, length <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />   hb_storc<span style="color: #000000;">&#40;</span> value, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>;<br />   hb_xfree<span style="color: #000000;">&#40;</span> value <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #B900B9;">// Lee la fecha y hora de la llave</span><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> GETDATETIME <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br /> SP_DEVICE_INFO deviceInfo;<br /> hb_retnl<span style="color: #000000;">&#40;</span> SFNTGetDeviceInfo<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> SP_HANDLE <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, &deviceInfo <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br /><br /> hb_stornl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> deviceInfo.timeValue.<span style="color: #0000ff;">year</span>      , <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br /> hb_stornl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> deviceInfo.timeValue.month     , <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br /> hb_stornl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> deviceInfo.timeValue.dayOfMonth, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>;<br /> hb_stornl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> deviceInfo.timeValue.hour      , <span style="color: #000000;">2</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>;<br /> hb_stornl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> deviceInfo.timeValue.minute    , <span style="color: #000000;">2</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>;<br /> hb_stornl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> deviceInfo.timeValue.second    , <span style="color: #000000;">2</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #B900B9;">// Lee un string desde  la llave</span><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SFNTGETDEVICEINFO <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   SPP_DEVICE_INFO deviceInfo;<br /><br />   hb_retnl<span style="color: #000000;">&#40;</span> SFNTGetDeviceInfo<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> SP_HANDLE <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, deviceInfo <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br /><br />   hb_stornl<span style="color: #000000;">&#40;</span> deviceInfo->timeValue.<span style="color: #0000ff;">year</span>      , <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />   hb_stornl<span style="color: #000000;">&#40;</span> deviceInfo->timeValue.month     , <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br />   hb_stornl<span style="color: #000000;">&#40;</span> deviceInfo->timeValue.dayOfMonth, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>;<br />   hb_stornl<span style="color: #000000;">&#40;</span> deviceInfo->timeValue.hour      , <span style="color: #000000;">2</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>;<br />   hb_stornl<span style="color: #000000;">&#40;</span> deviceInfo->timeValue.minute    , <span style="color: #000000;">2</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>;<br />   hb_stornl<span style="color: #000000;">&#40;</span> deviceInfo->timeValue.second    , <span style="color: #000000;">2</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:g5n0kfod]
gestión de licencias concurrentes en red local
Hola, puedes intentar algo asi: ingresa el usuario -> bloqueas su registro de usuario (u otro registro por usuario) el número de bloqueos es el número de concurrentes, si se sale del sistema creo que se quitaran los bloqueos por lo que no habria problemas por salidas por la ventana. No lo he probado, pero me intriga si funciona, nos cuentas? saludos Marcelo
gestión de licencias concurrentes en red local
Hola buenas tardes yo lo haria asi al entrar el usuario x lo activaria como .t. si entra el mismo usuario y esta la activacion como .t. , pues no darle entrada si el programa se cae por x o y lo manejeria asi al entrar activarlo como .t., y en un campo agregarle la hora en la que entro dentro del programa con un timer cada x tiempo por ejemplo 1 minuto ponerle la hora en que esta accesando el usuario si al momento de entra de vuelta el mismo usuario y checas la hora actual con la ultima hora del usuario y no tiene hora asiganda y pasa de mas de un minuto quiere decir que tubo una salida inesperada y con eso le puedes dar acceso,,, y si no pasa del minuto quiere decir que ay esta el usuario todavia saludos
gestión de licencias concurrentes en red local
Muchas gracias, voy a seguir investigando. Pablo, las funciones que necesito serían éstas: [code=fw:35a0f0jw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> SPRORELEASELICENSE <span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">function</span> SPROFORMATPACKET <span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><span style="color: #00C800;">function</span> SPROINITIALIZE <span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><span style="color: #00C800;">function</span> SPROFINDFIRSTUNIT<span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><br /><br /><span style="color: #00C800;">function</span> SPROSETHEARTBEAT<span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><span style="color: #00C800;">function</span> SPROREAD <span style="color: #000000;">&#40;</span>a,b,c,d<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:35a0f0jw] Muchas gracias a todos. Saludos
gestión de tarifas (de agua) [Solucionado]
Hola compañeros, Me gustaría pediros opinión a ver cómo se podría hacer lo siguiente. Para una comunidad de propietarios que tiene que facturar a sus clientes el agua potable, aplican una escala de tarifas: De 0 a 100 m3.....: 0,2 euros/litro De 101 a 200 m3 De 201 a 300 m3 De 301 a 400 m3 etc. Lo que no sé es de qué forma guardar estos valores en una dbf para que el cliente luego los pueda modificar y añadir más tramos. A ver si algún alma caritativa me da algo de luz por favor. Muchas gracias.
gestión de tarifas (de agua) [Solucionado]
Jose Luis Se me ocurre lo siguiente, que creo es lo más fácil: Base de datos: nTarifa IniTarifa FinTarifa Precio Con eso ya tienes los campos a rellenar, pero quizás el único problema que te vas a encontrar es cuando vas a grabar: Has de comprobar que el intervalo que defines no se superpone ni por la izda, ni por la derecha, ni interiormente con ninguno de los que ya hay grabados Espero te ayude en algo
gestión de tarifas (de agua) [Solucionado]
También otra idea sería no poner el ID de tarifa (nTarifa anterior) y crearlo con los datos de IniTarifa y FinTarifa pasándolos a cadena y concatenando ambos poniendo un separador (por ejemplo "/")
gestión de tarifas (de agua) [Solucionado]
Hola Cristóbal, Muchas gracias por tu respuesta. [quote:3ngjldq3]Has de comprobar que el intervalo que defines no se superpone ni por la izda, ni por la derecha, ni interiormente con ninguno de los que ya hay grabados[/quote:3ngjldq3] Eso es lo que realmente no sé como programarlo. Hay que sacar el desglose, ya que hay que debo facturar por tramos y sacar los tramos que correspondan. Eso es lo que no tengo tan claro cómo hacerlo: Por ejemplo, si tengo 302 m3 de consumo: De 0 a 100 m3: 0,2 x 100 m3 De 101 a 200: 0,3 x 99 De 201 a 300: 0,4 x 99 De 301 a 302: 0,5 x 2 Esto último es lo qué no se bien cómo programarlo. Muchísimas gracias de verdad.
gestión de tarifas (de agua) [Solucionado]
Amigo: También te puedes ahorrar el campo IniTarifa quedando solo FinTarifa (indexar por este campo) y Precio por litro Si pudieras ser un poco más especifico sobre cómo se hace el cobro tomando como ejemplo los 302 litros de consumo. Saludos
gestión de tarifas (de agua) [Solucionado]
Haber si entendi, como dice el colega, si creas ID para los intervalos de consumo y su tarifa, ya tienes casi todo hecho, ahora lo que necesitas es saber el monto consumido y hacer un recorrido por lo ID de los intervalos y ver si el consumo es sta dentro de alguno y en ese momento tomas el monto, si trabajas con mysql, eso lo haces solito con una clausula llamada between, si es con DBF entonces debes hacer el calculo con si es mayor o igual a nIni y menor e igual a nFin y asi saber a cual tarifa pertenece el consumo entrado, te explico.. id_tarifa 001 rango_ini 0 lts rango_fin 100 lts tarifa 0,2 euros nTarifa := nConsumo := 0 Solicitas consumo: nConsumo = 70 lts do while !eof() if nConusmo >= rango_ini and nConsumo <= rango_fin nTarifa := nConsumo * tarifa skip enddo ? "Ud pagara: " + str(nTarifa) ? "por el consumo de: " + str(nConsumo) nose si es eso lo que quieres, si es asi espero haberte ayudado y sino, alli volvemos a leer haber, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
gestión de tarifas (de agua) [Solucionado]
Hola, prueba este ejemplo, a ver si es lo que necesitas: [code=fw:3w1ezuic]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//----------------//BUSCAR UN RANGO ENTRE DOS VALORES</span><br /><span style="color: #00C800;">Function</span> DeHasta<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cAlias, oDlg, oBrw, nConsumo:=<span style="color: #000000;">0</span>, oConsumo<br /><span style="color: #00C800;">local</span> nWd := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> * &nbsp;.<span style="color: #000000;">90</span> &nbsp;<span style="color: #B900B9;">// .75</span><br /><span style="color: #00C800;">local</span> nHt := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">1.20</span> &nbsp; <span style="color: #B900B9;">// 2</span><br /><br /><br />dbCreate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"C:<span style="color: #000000;">\D</span>eHasta"</span>,<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"DE"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"HASTA"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TARIFA"</span>,<span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />dbusearea<span style="color: #000000;">&#40;</span>.t.,,<span style="color: #ff0000;">"C:<span style="color: #000000;">\D</span>eHasta"</span>,<span style="color: #ff0000;">"DeHasta"</span>,.t.<span style="color: #000000;">&#41;</span><br />cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbappend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->de := <span style="color: #000000;">0</span> &nbsp;; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->hasta := <span style="color: #000000;">100</span> &nbsp;; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->tarifa := <span style="color: #000000;">0.1</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbappend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->de := <span style="color: #000000;">101</span> &nbsp;; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->hasta := <span style="color: #000000;">200</span> &nbsp;; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->tarifa := <span style="color: #000000;">0.2</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbappend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->de := <span style="color: #000000;">201</span> &nbsp;; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->hasta := <span style="color: #000000;">300</span> &nbsp;; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->tarifa := <span style="color: #000000;">0.3</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbappend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->de := <span style="color: #000000;">301</span> &nbsp;; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->hasta := <span style="color: #000000;">400</span> &nbsp;; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->tarifa := <span style="color: #000000;">0.4</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbappend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->de := <span style="color: #000000;">401</span> &nbsp;; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->hasta := <span style="color: #000000;">500</span> &nbsp;; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->tarifa := <span style="color: #000000;">0.5</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> nWd,nHt <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"RANGOS DE CONSUMO"</span><br />&nbsp; &nbsp;nWd &nbsp;/= <span style="color: #000000;">2</span><br />&nbsp; &nbsp;nHt &nbsp;/= <span style="color: #000000;">2</span><br /><br />@<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp;COLUMNS <span style="color: #ff0000;">"DE"</span>,<span style="color: #ff0000;">"HASTA"</span>,<span style="color: #ff0000;">"TARIFA"</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ALIAS</span> cAlias<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nTop</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">25</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nLeft</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nBottom</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= :<span style="color: #000000;">nTop</span> + nHt - <span style="color: #000000;">45</span> <br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nRight</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := :<span style="color: #000000;">nLeft</span> + nWd - <span style="color: #000000;">20</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= MARQSTYLE_HIGHLROW &nbsp; <br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lColDividerComplete</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStyle</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := nAnd<span style="color: #000000;">&#40;</span> :<span style="color: #000000;">nStyle</span>, nNot<span style="color: #000000;">&#40;</span> WS_BORDER <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nColDividerStyle</span>:=LINESTYLE_LIGHTGRAY<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nRowDividerStyle</span>:=LINESTYLE_LIGHTGRAY<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeaderHeight</span> &nbsp; &nbsp;:= <span style="color: #000000;">30</span> &nbsp;<span style="color: #B900B9;">//altura del header</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeadStrAligns</span> := AL_CENTER &nbsp;<span style="color: #B900B9;">//texto cabeceras de cols centrado</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;END &nbsp;<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;END &nbsp;<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;END &nbsp;<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ nHt<span style="color: #000000;">-135</span>, <span style="color: #000000;">10</span> &nbsp;<span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Consumo: "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>,<span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br />&nbsp; &nbsp;@ nHt<span style="color: #000000;">-135</span>, <span style="color: #000000;">50</span> &nbsp;<span style="color: #0000ff;">GET</span> oConsumo <span style="color: #0000ff;">VAR</span> nConsumo <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">54</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99,999"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> BuscRango<span style="color: #000000;">&#40;</span>nConsumo,oBrw,cAlias<span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ nHt<span style="color: #000000;">-15</span>, <span style="color: #000000;">124</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Salir'</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">35</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> 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> CANCEL<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> FitSizes<span style="color: #000000;">&#40;</span> oBrw, <span style="color: #000000;">&#41;</span>, oConsumo:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br /><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DBCLOSEAREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Ferase<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"C:<span style="color: #000000;">\"</span>+(cAlias)+"</span>.dbf<span style="color: #ff0000;">")<br />RETURN nil<br /><br />//----------------------------<br />Function BuscRango(nConsumo,oBrw,cAlias)<br />local nTarifa:=0<br /><br />(cAlias)->(dbgotop())<br />While (cAlias)->(!eof())<br />&nbsp; &nbsp;if (cAlias)->hasta >= nConsumo<br />&nbsp; &nbsp; &nbsp; nTarifa:= (cAlias)->Tarifa<br />&nbsp; &nbsp; &nbsp; Exit<br />&nbsp; &nbsp;endif<br />&nbsp; &nbsp;(cAlias)->(dbskip())<br />enddo<br /><br />&nbsp; &nbsp;MsgInfo("</span>Tarifa es: <span style="color: #ff0000;">"+Transform(nTarifa,"</span><span style="color: #000000;">9</span>,<span style="color: #000000;">999.99</span><span style="color: #ff0000;">"))<br />&nbsp; &nbsp;oBrw:Refresh()<br />&nbsp; &nbsp;oBrw:SetFocus()<br />return nTarifa<br /></span></div>[/code:3w1ezuic] Saludos.
gestión de tarifas (de agua) [Solucionado]
Hola compañeros, Muchísimas gracias a todos por la ayuda prestada. Ya prácticamente está. El problema es que las tarifas deben ser acumulativas. Me explico, si tengo 303 m3 de agua: - Los primeros 100 litros van a la primera tarifa, de 0,2/m3 - Los 99 siguientes van a la segunda tarifa, de 0,3/m3 - Los 99 siguientes van a la tercera tarifa, de 0,4/m3 - Los 5 últimos litros van a la cuarta tarifa, de 0,5/m3 Tal que así para 303 m3 de agua: De 0 a 100 m3->: 0,2 x 100 m3 =20 euros De 101 a 200->: 0,3 x 99 m3 =29,7 euros De 201 a 300->: 0,4 x 99 m3 = 39,6 euros De 301 a 303->: 0,5 x 5 m3 = 2,5 euros Total: 91,8 euros Esto de tener que aplicar [b:2vdstg2j]varios tramos a la vez [/b:2vdstg2j]es lo que me estoy volviendo loco. Disculparme el no haberme explicado bien. Muchísimas gracias de verdad. Un saludo,
gestión de tarifas (de agua) [Solucionado]
José Luis: Nada mas para mi cultura, cómo determinas los segundos y terceros 99 m3? No me queda claro <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Mi cerebro me indica que deberían ser así: Si el consumo es de 303 m3 los primeros 100m3 tendrán un costo de ,2 = 20 euros y quedan por costear 203m3 los siguientes 200m2 tendrán un costo de ,3 = 60 euros y quedan por costear 3m3 los restantes 3m3 tendrán un costo de ,5 = 1,5 euros Total: 20+60+1,5 = 81.5 euros Saludos
gestión de tarifas (de agua) [Solucionado]
Me interesó el reto, aqui dejo un algoritmo ( hecho a las apuradas ) que calcula los metros cúbicos. Espero este bien [code=fw:7rbxywke]<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: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">Local</span> i<br />    <span style="color: #00C800;">Local</span> nMin<br />    <span style="color: #00C800;">Local</span> nMax<br />    <span style="color: #00C800;">Local</span> nSubTotal     := <span style="color: #000000;">0</span><br />    <span style="color: #00C800;">Local</span> nTotalPesos := <span style="color: #000000;">0</span><br />    <span style="color: #00C800;">Local</span> aTotalAgua   := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />    <span style="color: #00C800;">Local</span> nTotalAgua   := <span style="color: #000000;">303</span><br />    <span style="color: #00C800;">Local</span> aTarifas      := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'0-100'</span>, <span style="color: #ff0000;">'0.1'</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'101-200'</span>, <span style="color: #ff0000;">'0.3'</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'201-300'</span>, <span style="color: #ff0000;">'0.4'</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'301-400'</span>, <span style="color: #ff0000;">'0.5'</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />    <br />    <span style="color: #00C800;">For</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> Len<span style="color: #000000;">&#40;</span> aTarifas <span style="color: #000000;">&#41;</span><br />        nMin := Val<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> aTarifas<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">1</span>, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'-'</span>, aTarifas<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        nMax := Val<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> aTarifas<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'-'</span>, aTarifas<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nTotalAgua > nMax <span style="color: #000000;">&#41;</span><br />            Aadd<span style="color: #000000;">&#40;</span> aTotalAgua, nMax - nMin <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">Else</span><br />            AEval<span style="color: #000000;">&#40;</span> aTotalAgua, <span style="color: #000000;">&#123;</span> | x | nSubTotal += x <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />            Aadd<span style="color: #000000;">&#40;</span> aTotalAgua, nTotalAgua - nSubTotal <span style="color: #000000;">&#41;</span>       <br />        End<br />    <span style="color: #00C800;">Next</span> i<br />    <span style="color: #00C800;">For</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> Len<span style="color: #000000;">&#40;</span> aTotalAgua <span style="color: #000000;">&#41;</span>                                <br />        ? aTotalAgua<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span><br />    <span style="color: #00C800;">Next</span> i  <br />    <span style="color: #00C800;">Return</span> <span style="color: #000000;">0</span>    <br /> </div>[/code:7rbxywke] De todas maneras tengo una duda, en el intervalo 101-200 serían 100 m3 si consideramos el 101 como el primero, serían 99 si no lo consideramos, en ese caso el 101 quedaría en el limbo. Saludos
gestión de tarifas (de agua) [Solucionado]
[quote="joseluispalma":1n8jnfeq]Hola compañeros, Muchísimas gracias a todos por la ayuda prestada. Ya prácticamente está. El problema es que las tarifas deben ser acumulativas. Me explico, si tengo 303 m3 de agua: - Los primeros 100 litros van a la primera tarifa, de 0,2/m3 - Los 99 siguientes van a la segunda tarifa, de 0,3/m3 - Los 99 siguientes van a la tercera tarifa, de 0,4/m3 - Los 5 últimos litros van a la cuarta tarifa, de 0,5/m3 Tal que así para 303 m3 de agua: De 0 a 100 m3->: 0,2 x 100 m3 =20 euros De 101 a 200->: 0,3 x 99 m3 =29,7 euros De 201 a 300->: 0,4 x 99 m3 = 39,6 euros De 301 a 303->: 0,5 x 5 m3 = 2,5 euros Total: 91,8 euros Esto de tener que aplicar [b:1n8jnfeq]varios tramos a la vez [/b:1n8jnfeq]es lo que me estoy volviendo loco. Disculparme el no haberme explicado bien. Muchísimas gracias de verdad. Un saludo,[/quote:1n8jnfeq] No entiendo porque tanta vuelta y enredo si con lo que dice el colega esta mas claro, el detalles es que no se toma todo el monto leido para buscar a que tarifa pertecene, sino que se va dividiendo y cobrando cada parte en el rango de las tarifas, en su ejemplo esta claro, como son 303, entonces revisa cual es el rango de la primera tarifa, como es de 0-100 y el monto leido es superior, entonces los primero 100 de la lectura de los 303 se cobran al precio de la tarifa 1, ahora quedan 203, pero en la 2da.tarifa no son 100 el rango, sino 99, como el monto faltante por cobrar supera los 99 porque son 203, entonces se toman solo 99 de los 203 para cobrarse a monto de la 2da.tarifa, ahora faltan por cobrar 104, pasamos a la 3ra.tarifa el cual el rango tanbien es de 99, asi que tomamos de nuevo 99 de los 104 que supera el rango y los cobramos al monto de la tarifa 3, ahora, solo nos faltan 5 por cobrar del consumo leido, nos vamos a la tarifa 4 y es donde entra su duda, porque el rango de la tarifa 4 es solo de 2, a menos que sea de 301 hasta nRangoFin, si tomasemos el rango, entonces solo seria de los 5 faltantes 2 del consumo, quedando aun pendiente por cobrar 3, para completar los 303, pero como al parecer no existe mas rango de tarifas, toma los 5 restantes y los cobra al precio de la ultima tarifa, dando asi la tabla de cobranza que el creo. En resumen, si ya las tarifas estan dadas y los rangos, con hacer unos IF anidados o CASE, creo que el problema estaria resuelto, nose, alguien que de alguna opinion al respecto, creo que es un sistema muy sincello y sin complicaciones, solo que el colega no lo aclaro desde el principio, es mi humilde opinion y analisis del sistema, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
gestión de tarifas (de agua) [Solucionado]
[quote="joseluispalma":8ry3hl40] Disculparme el no haberme explicado bien.[/quote:8ry3hl40] Todo está claro ahora. La única observación, es que considero que el intervalo o rango es de 100 y no de 99. (según consumo final en cada item)
gestión de tarifas (de agua) [Solucionado]
[quote="FranciscoA":10dgykjd][quote="joseluispalma":10dgykjd] Disculparme el no haberme explicado bien.[/quote:10dgykjd] Todo está claro ahora. La única observación, es que considero que el intervalo o rango es de 100 y no de 99. (según consumo final en cada item)[/quote:10dgykjd] Tienes toda la razon Francisco, parece el colega solo resta 200-101 que le da 99 y se le olvida el consumo 101 o 201, dependiendo del caso, los consumos son de 100 en 100 y se deberia iniciar en 1 y no es cero(0), asi quedarian los rangos: 1-100 ----> 100 101-200 -> 100 (se debe contar el 101) 201-300-> 100 (se debe contar el 201) 301-n -> ??? Esperemos el colega y tocayo Jose Luis, nos de su opinion, saludos...
gestión de tarifas (de agua) [Solucionado]
[quote:29o70qi8]y se deberia iniciar en 1 y no es cero(0)[/quote:29o70qi8] Lo mismo opino, Luis. Saludos.
gestión de tarifas (de agua) [Solucionado]
Amigos: Como decía el master, para rizar el rizo, yo lo haría así: Crear mi tabla con los campos siguientes nLinea nTramo nCosto Index por nLinea 1 100 ,20 2 99 ,30 3 99 ,40 5 99 ,50 Y el código sería así: [code=fw:37k7rvz6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />nSaldo     := nConsumo <span style="color: #000000;">&#40;</span><span style="color: #000000;">303</span><span style="color: #000000;">&#41;</span><br />nImporte  := <span style="color: #000000;">0.00</span><br /><br />Ir al Pincipio de la tabla<br />DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> ! EOF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> nSaldo >= nTramo<br />          nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nTramo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />          nSaldo := nSaldo - nTramo<br />     <span style="color: #00C800;">ENDIF</span><br />     SKIP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">IF</span> nSaldo > <span style="color: #000000;">0</span><br />     DBGOBOTTOM<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nTramo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:37k7rvz6] Saludos
gestión de tarifas (de agua) [Solucionado]
[quote="Armando":31291k0c]Amigos: Como decía el master, para rizar el rizo, yo lo haría así: Crear mi tabla con los campos siguientes nLinea nTramo nCosto Index por nLinea 1 100 ,20 2 99 ,30 3 99 ,40 5 99 ,50 Y el código sería así: [code=fw:31291k0c]<div class="fw" id="{CB}" style="font-family: monospace;"><br />nSaldo     := nConsumo <span style="color: #000000;">&#40;</span><span style="color: #000000;">303</span><span style="color: #000000;">&#41;</span><br />nImporte  := <span style="color: #000000;">0.00</span><br /><br />Ir al Pincipio de la tabla<br />DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> ! EOF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> nSaldo >= nTramo<br />          nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nTramo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />          nSaldo := nSaldo - nTramo<br />     <span style="color: #00C800;">ENDIF</span><br />     SKIP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">IF</span> nSaldo > <span style="color: #000000;">0</span><br />     DBGOBOTTOM<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nTramo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:31291k0c] Saludos[/quote:31291k0c] Armando, estoy 99% de acuerdo contigo en como lo harias, pero solo no haria el dbgottom, ya que como son varias tarifas y el nConsumo no es mayor igual a nTramo y se acaba en el 2do u otra anterior posicion, entonce el restante se debe calcular en base a ese tramo que hace la ruptura de control del do while, no en el ultimo, bueno, eso lo determine haciendo una corrida en frio a tu manera de hacerlo, a lo mejor estoy equivocado, pero como lo dices, seria una manera sencilla y rapida de resolver el problema del colega y tocayo, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
gestión de tarifas (de agua) [Solucionado]
Aqui otro ejemplo autocontenido y "mas completo". [code=fw:23dwdvxu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//-----------------------------------------</span><br /><span style="color: #00C800;">Function</span> TarifaIncrem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cAlias, oDlg, oBrw, nConsumo:=<span style="color: #000000;">0</span>, oConsumo<br /><span style="color: #00C800;">local</span> nWd := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> *  .<span style="color: #000000;">90</span>  <span style="color: #B900B9;">// .75</span><br /><span style="color: #00C800;">local</span> nHt := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">1.20</span>   <span style="color: #B900B9;">// 2</span><br /><span style="color: #00C800;">local</span> aGradBarSel:= <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">252</span>,<span style="color: #000000;">232</span>,<span style="color: #000000;">171</span><span style="color: #000000;">&#41;</span>   , RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> aGradRowSel:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">108</span>,<span style="color: #000000;">125</span>, <span style="color: #000000;">184</span><span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> nDe,nHasta,nTar<br /><br />dbCreate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"C:<span style="color: #000000;">\T</span>arifa"</span>,<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"DE"</span>,     <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span>,;<br />                      <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"HASTA"</span>,  <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span>,;<br />                      <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TARIFA"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span>,;<br />                      <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"CONSUMO"</span>,<span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span>,;<br />                      <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"VALOR"</span>,  <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />dbusearea<span style="color: #000000;">&#40;</span>.t.,,<span style="color: #ff0000;">"C:<span style="color: #000000;">\T</span>arifa"</span>,<span style="color: #ff0000;">"Tarifa"</span>,.f.<span style="color: #000000;">&#41;</span><br />cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />nDe:=<span style="color: #000000;">1</span><br />nHasta:=<span style="color: #000000;">100</span><br />nTar:=<span style="color: #000000;">0.10</span><br /><span style="color: #00C800;">While</span> nHasta <= <span style="color: #000000;">1500</span><br />  <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbappend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->de := nDe  ;  <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->hasta := nHasta  ; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->tarifa := nTar<br />   nDe:=nHasta<span style="color: #000000;">+1</span><br />   nHasta += <span style="color: #000000;">100</span><br />   nTar += <span style="color: #000000;">0.10</span><br /><span style="color: #00C800;">Enddo</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> nWd,nHt <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"RANGOS DE CONSUMO"</span><br />   nWd  /= <span style="color: #000000;">2</span><br />   nHt  /= <span style="color: #000000;">2</span><br /><br />@<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />     COLUMNS <span style="color: #ff0000;">"DE"</span>,<span style="color: #ff0000;">"HASTA"</span>,<span style="color: #ff0000;">"TARIFA"</span>,<span style="color: #ff0000;">"CONSUMO"</span>,<span style="color: #ff0000;">"VALOR"</span>;<br />     <span style="color: #0000ff;">ALIAS</span> cAlias<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nTop</span>                   := <span style="color: #000000;">10</span>  <br />      :<span style="color: #000000;">nLeft</span>                  := <span style="color: #000000;">10</span><br />      :<span style="color: #000000;">nBottom</span>                := :<span style="color: #000000;">nTop</span> + nHt - <span style="color: #000000;">30</span> <br />      :<span style="color: #000000;">nRight</span>                 := :<span style="color: #000000;">nLeft</span> + nWd - <span style="color: #000000;">20</span><br />      :<span style="color: #000000;">nMarqueeStyle</span>          := MARQSTYLE_HIGHLROW   <br />      :<span style="color: #000000;">lColDividerComplete</span>    := .t.<br />      :<span style="color: #000000;">nStyle</span>                 := nAnd<span style="color: #000000;">&#40;</span> :<span style="color: #000000;">nStyle</span>, nNot<span style="color: #000000;">&#40;</span> WS_BORDER <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">nColDividerStyle</span>:=LINESTYLE_LIGHTGRAY<br />      :<span style="color: #000000;">nRowDividerStyle</span>:=LINESTYLE_LIGHTGRAY<br />      :<span style="color: #000000;">nHeaderHeight</span>    := <span style="color: #000000;">30</span>  <span style="color: #B900B9;">//altura del header</span><br />      :<span style="color: #000000;">nHeadStrAligns</span> := AL_CENTER  <span style="color: #B900B9;">//texto cabeceras de cols centrado</span><br />      :<span style="color: #000000;">bClrSel</span>       := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span>  <span style="color: #000000;">0</span>,  <span style="color: #000000;">0</span>,  <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, aGradRowSel <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>  <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br />      :<span style="color: #000000;">bClrSelFocus</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, aGradBarSel <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>     <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br />      :<span style="color: #000000;">lFooter</span> := .t.<br />   END<br /><br />   WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br />      :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />   END  <br /><br />   WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br />      :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />   END  <br /><br />   WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br />      :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />   END  <br /><br />   WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br />      :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">0</span><br />      :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"99,999,999.99"</span><br />      :<span style="color: #000000;">lTotal</span> := .t.<br />      :<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br />      :<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br />   END  <br /><br />   WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br />      :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">0</span><br />      :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"99,999,999.99"</span><br />      :<span style="color: #000000;">lTotal</span> := .t.<br />      :<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br />      :<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br />   END  <br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   @ nHt<span style="color: #000000;">-15</span>, <span style="color: #000000;">10</span>  <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Consumo: "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>,<span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br />   @ nHt<span style="color: #000000;">-15</span>, <span style="color: #000000;">50</span>  <span style="color: #0000ff;">GET</span> oConsumo <span style="color: #0000ff;">VAR</span> nConsumo <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">54</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99,999,999.99"</span> <span style="color: #0000ff;">RIGHT</span>;<br />         <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> LiqConsumo<span style="color: #000000;">&#40;</span>nConsumo,oBrw,cAlias<span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br />   @ nHt<span style="color: #000000;">-15</span>, <span style="color: #000000;">124</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Salir'</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">35</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg   <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> 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> CANCEL<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />        <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> FitSizes<span style="color: #000000;">&#40;</span> oBrw, <span style="color: #000000;">&#41;</span>, oConsumo:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DBCLOSEAREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   Ferase<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"C:<span style="color: #000000;">\"</span>+(cAlias)+"</span>.dbf<span style="color: #ff0000;">")<br />RETURN nil<br /><br />//----------------------------<br />Function LiqConsumo(nConsumoTot,oBrw,cAlias)<br />local nConsuParc:=0, nSaldo:=nConsumoTot<br /><br />(cAlias)->(dbgotop())  //limpiamos por si calc mas de 1 vez<br />While (cAlias)->(!eof())<br />   (cAlias)->Consumo := 0<br />   (cAlias)->Valor   := 0<br />   (cAlias)->(dbskip())<br />enddo<br /><br />(cAlias)->(dbgotop())<br />While nSaldo > 0   <br />   if nConsumoTot > (cAlias)->Hasta<br />      nConsuParc := ( (cAlias)->Hasta - (cAlias)->De )+1<br />   else<br />      nConsuParc := nSaldo<br />   endif<br /><br />   (cAlias)->Consumo := nConsuParc<br />   (cAlias)->Valor   := Round( nConsuParc * (cAlias)->Tarifa, 2)<br /> <br />   nSaldo -= nConsuParc<br /><br />   (cAlias)->(dbskip())<br />enddo<br /><br />   (cAlias)->(dbSkip(-1))<br />   oBrw:Refresh()<br />   oBrw:SetFocus()<br />return nil<br /></span></div>[/code:23dwdvxu] Por supuesto que el ejemplo esta basado en cifras enteras. Si se utilizaran decimales, lo mejor sería extraer los consumos segun diferencia entre cada registro y de la columna HASTA, en este ejemplo.
gestión de tarifas (de agua) [Solucionado]
Amigos, Muchas gracias por todas vuestras indicaciones. Al final, la función será algo así aproximadamente: do While !eof() if nConsumo >= field->de nLitrosTramo := FIELD->hasta - FIELD->de // Saber los nLitrosaFacturar IF nLitrosPendientes >= nLitrosTramo nLitrosaFacturar := nLitrosTramo nLitrosPendientes := nLitrosPendientes-nLitrosaFacturar ELSE // Último tramo nLitrosaFacturar := nLitrosPendientes nLitrosPendientes := 0 ENDIF nPrecioTramo := nLitrosaFacturar*FIELD->TARIFA nTotal := nTotal + nPrecioTramo if nLitrosPendientes = 0 nTotal2 := nTotal endif endif DbSkip() enddo
gestión de tarifas (de agua) [Solucionado]
Amigos: Una vuelta más al rizo [code=fw:l01ff3cm]<div class="fw" id="{CB}" style="font-family: monospace;">nSaldo     := nConsumo <span style="color: #000000;">&#40;</span><span style="color: #000000;">303</span><span style="color: #000000;">&#41;</span><br />nImporte  := <span style="color: #000000;">0.00</span><br /><br />Ir al Pincipio de la tabla<br />DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> ! EOF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> nSaldo >= nTramo<br />          nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nTramo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />          nSaldo := nSaldo - nTramo<br />     <span style="color: #00C800;">ELSE</span><br />          nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nSaldo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nSaldo := <span style="color: #000000;">0</span><br />     <span style="color: #00C800;">ENDIF</span><br />     SKIP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">IF</span> nSaldo > <span style="color: #000000;">0</span><br />     DBGOBOTTOM<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nTramo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span></div>[/code:l01ff3cm] joseluisysturiz: Me parece que con el ELSE queda solucionado y es un código reducido, desde luego lo estoy haciendo al vuelo no he probado mi código, el código con DBGOBOTTOM() es para cuando se haya recorrido toda la tabla y aún queden metros (nSaldo > 0) por valuar. Saludos a todos los foreros
gestión de tarifas (de agua) [Solucionado]
El mismo ejemplo autocontenido, con algunas mejoras: [code=fw:2rns9gux]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> TarifaIncrem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cAlias, oDlg, oBrw, nConsumo:=<span style="color: #000000;">0</span>, oConsumo<br /><span style="color: #00C800;">local</span> nWd := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> * &nbsp;.<span style="color: #000000;">90</span> &nbsp;<span style="color: #B900B9;">// .75</span><br /><span style="color: #00C800;">local</span> nHt := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">1.20</span> &nbsp; <span style="color: #B900B9;">// 2</span><br /><span style="color: #00C800;">local</span> aGradBarSel:= <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">252</span>,<span style="color: #000000;">232</span>,<span style="color: #000000;">171</span><span style="color: #000000;">&#41;</span> &nbsp; , RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> aGradRowSel:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">108</span>,<span style="color: #000000;">125</span>, <span style="color: #000000;">184</span><span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> nDe,nHasta,nTar<br /><br />dbCreate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"C:<span style="color: #000000;">\T</span>arifa"</span>,<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"DE"</span>, &nbsp; &nbsp; <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">12</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"HASTA"</span>, &nbsp;<span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">12</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TARIFA"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"CONSUMO"</span>,<span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">12</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"VALOR"</span>, &nbsp;<span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">12</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />dbusearea<span style="color: #000000;">&#40;</span>.t.,,<span style="color: #ff0000;">"C:<span style="color: #000000;">\T</span>arifa"</span>,<span style="color: #ff0000;">"Tarifa"</span>,.f.<span style="color: #000000;">&#41;</span><br />cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />nDe:=<span style="color: #000000;">1</span><br />nHasta:=<span style="color: #000000;">100</span><br />nTar:=<span style="color: #000000;">0.10</span><br /><span style="color: #00C800;">While</span> nHasta <= <span style="color: #000000;">1500</span><br />&nbsp; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbappend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->de := nDe &nbsp;; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->hasta := nHasta &nbsp;; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->tarifa := nTar<br />&nbsp; &nbsp;nDe:=nHasta<span style="color: #000000;">+1</span><br />&nbsp; &nbsp;nHasta += <span style="color: #000000;">100</span><br />&nbsp; &nbsp;nTar += <span style="color: #000000;">0.10</span><br /><span style="color: #00C800;">Enddo</span><br />&nbsp; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbappend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// para poder calcular cuando consumo es mayor a 1500 </span><br />&nbsp; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->de := nDe &nbsp;; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->hasta := <span style="color: #000000;">99000000.00</span> &nbsp;; <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->tarifa := nTar<br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> nWd,nHt <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"RANGOS DE CONSUMO"</span><br />&nbsp; &nbsp;nWd &nbsp;/= <span style="color: #000000;">2</span><br />&nbsp; &nbsp;nHt &nbsp;/= <span style="color: #000000;">2</span><br /><br />@<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp;COLUMNS <span style="color: #ff0000;">"DE"</span>,<span style="color: #ff0000;">"HASTA"</span>,<span style="color: #ff0000;">"TARIFA"</span>,<span style="color: #ff0000;">"CONSUMO"</span>,<span style="color: #ff0000;">"VALOR"</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ALIAS</span> cAlias<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nTop</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">10</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nLeft</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nBottom</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= :<span style="color: #000000;">nTop</span> + nHt - <span style="color: #000000;">30</span> <br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nRight</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := :<span style="color: #000000;">nLeft</span> + nWd - <span style="color: #000000;">20</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= MARQSTYLE_HIGHLROW &nbsp; <br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lColDividerComplete</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStyle</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := nAnd<span style="color: #000000;">&#40;</span> :<span style="color: #000000;">nStyle</span>, nNot<span style="color: #000000;">&#40;</span> WS_BORDER <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nColDividerStyle</span>:=LINESTYLE_LIGHTGRAY<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nRowDividerStyle</span>:=LINESTYLE_LIGHTGRAY<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeaderHeight</span> &nbsp; &nbsp;:= <span style="color: #000000;">30</span> &nbsp;<span style="color: #B900B9;">//altura del header</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeadStrAligns</span> := AL_CENTER &nbsp;<span style="color: #B900B9;">//texto cabeceras de cols centrado</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> &nbsp;<span style="color: #000000;">0</span>, &nbsp;<span style="color: #000000;">0</span>, &nbsp;<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, aGradRowSel <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSelFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, aGradBarSel <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> &nbsp; &nbsp; <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->Consumo ><span style="color: #000000;">0</span>, <span style="color: #000000;">&#123;</span>CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">238</span>, <span style="color: #000000;">238</span>, <span style="color: #000000;">238</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span>RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">120</span>, <span style="color: #000000;">120</span>, <span style="color: #000000;">120</span><span style="color: #000000;">&#41;</span>, CLR_WHITE<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lFooter</span> := .t.<br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"99,999,999.99"</span><br />&nbsp; &nbsp;END &nbsp;<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"99,999,999.99"</span><br />&nbsp; &nbsp;END &nbsp;<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"99,999,999.99"</span><br />&nbsp; &nbsp;END &nbsp;<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"99,999,999.99"</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lTotal</span> := .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br />&nbsp; &nbsp;END &nbsp;<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"99,999,999.99"</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lTotal</span> := .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br />&nbsp; &nbsp;END &nbsp;<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ nHt<span style="color: #000000;">-15</span>, <span style="color: #000000;">10</span> &nbsp;<span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Consumo: "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>,<span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br />&nbsp; &nbsp;@ nHt<span style="color: #000000;">-15</span>, <span style="color: #000000;">50</span> &nbsp;<span style="color: #0000ff;">GET</span> oConsumo <span style="color: #0000ff;">VAR</span> nConsumo <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">54</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99,999,999.99"</span> <span style="color: #0000ff;">RIGHT</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>ConsumoOK<span style="color: #000000;">&#40;</span>nConsumo,cAlias<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>LiqConsumo<span style="color: #000000;">&#40;</span>nConsumo,oBrw,cAlias<span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T.<span style="color: #000000;">&#41;</span> ,.f.<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ nHt<span style="color: #000000;">-15</span>, <span style="color: #000000;">124</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Salir'</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">35</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> 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> CANCEL<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> FitSizes<span style="color: #000000;">&#40;</span> oBrw, <span style="color: #000000;">&#41;</span>, oConsumo:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br /><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DBCLOSEAREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Ferase<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"C:<span style="color: #000000;">\"</span>+(cAlias)+"</span>.dbf<span style="color: #ff0000;">")<br />RETURN nil<br /><br />//----------------------------<br />Function ConsumoOK(nConsumo,cAlias)<br />(cAlias)->(dbGoBottom())<br />if nConsumo > (cAlias)->hasta<br />&nbsp; &nbsp;MsgStop("</span>Consumo digitado sobrepasa al maximo de la tabla.<span style="color: #ff0000;">","</span>Alto<span style="color: #ff0000;">")<br />&nbsp; &nbsp;return .f.<br />endif<br />Return .t.<br /><br />//----------------------------<br />Function LiqConsumo(nConsumoTot,oBrw,cAlias)<br />local nConsuParc:=0, nSaldo:=nConsumoTot, nHastaAnt:=0<br /><br />(cAlias)->(DbEval( {|| (cAlias)->Consumo:=0,(cAlias)->Valor:=0} )) &nbsp;//limpiamos por si calc mas de 1 vez<br /><br />(cAlias)->(dbgotop())<br />While nSaldo > 0 &nbsp; <br />&nbsp; &nbsp;if nConsumoTot > (cAlias)->Hasta<br />&nbsp; &nbsp; &nbsp; nConsuParc := (cAlias)->Hasta - nHastaAnt<br />&nbsp; &nbsp;else<br />&nbsp; &nbsp; &nbsp; nConsuParc := nSaldo<br />&nbsp; &nbsp;endif<br /><br />&nbsp; &nbsp;(cAlias)->Consumo := nConsuParc<br />&nbsp; &nbsp;(cAlias)->Valor &nbsp; := Round( nConsuParc * (cAlias)->Tarifa, 2)<br /><br />&nbsp; &nbsp;nHastaAnt:= (cAlias)->Hasta <br />&nbsp; &nbsp;nSaldo -= nConsuParc<br /><br />&nbsp; &nbsp;(cAlias)->(dbskip())<br />enddo<br /><br />&nbsp; &nbsp;(cAlias)->(dbSkip(-1))<br />&nbsp; &nbsp;oBrw:Refresh()<br />&nbsp; &nbsp;oBrw:SetFocus()<br />return nil<br /></span></div>[/code:2rns9gux] Saludos.
gestión de tarifas (de agua) [Solucionado]
[quote="Armando":181fnse4]Amigos: Una vuelta más al rizo [code=fw:181fnse4]<div class="fw" id="{CB}" style="font-family: monospace;">nSaldo     := nConsumo <span style="color: #000000;">&#40;</span><span style="color: #000000;">303</span><span style="color: #000000;">&#41;</span><br />nImporte  := <span style="color: #000000;">0.00</span><br /><br />Ir al Pincipio de la tabla<br />DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> ! EOF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> nSaldo >= nTramo<br />          nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nTramo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />          nSaldo := nSaldo - nTramo<br />     <span style="color: #00C800;">ELSE</span><br />          nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nSaldo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />          nSaldo := <span style="color: #000000;">0</span><br />     <span style="color: #00C800;">ENDIF</span><br />     SKIP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">IF</span> nSaldo > <span style="color: #000000;">0</span><br />     DBGOBOTTOM<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     nImporte := <span style="color: #0000ff;">ROUND</span><span style="color: #000000;">&#40;</span>nImporte + nTramo * nCosto,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span></div>[/code:181fnse4] joseluisysturiz: Me parece que con el ELSE queda solucionado y es un código reducido, desde luego lo estoy haciendo al vuelo no he probado mi código, el código con DBGOBOTTOM() es para cuando se haya recorrido toda la tabla y aún queden metros (nSaldo > 0) por valuar. Saludos a todos los foreros[/quote:181fnse4] Ok, te insisto en lo del DBGOTTOM, ya que el saldo que quede sobrando que no sea mayor igual a nTramo, se debe calcular en base al nCosto de ese tramos que hizo saliera del DO WHILE, bueno, asi lo veo, igual, el colega que lo termine de pulir y lo prueb con data de su cliente y nos comente luego cuando lo tenga listo, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
get a number dragdel changed into ""0"" and lost decimal
Hi, n1:=15.67 redefine get n1 of odlg // mouse lbutton down ---drag from left to right ( select )---delete key --- 0, 15.67 deleted only 0 left, 1 char length, lost decimal. // lbutton down ---drag --del --- "15.67" changed into "0" . Regards! Shuming Wang
get a number dragdel changed into ""0"" and lost decimal
Shuming, We are going to review it asap, but as we are publishing FWH 14.12 today we can not introduce any changes now that may affect the entire FWH apps behavior without enough testing and feedback from users, thanks
get a number dragdel changed into ""0"" and lost decimal
Antonio, TKS! Shuming Wang
get -oSortCbx
I add a get to make e search and it run ok only when I resize the Mdichild the get is not focused [b:3rvo0ax6]before[/b:3rvo0ax6] [img:3rvo0ax6]https&#58;//i&#46;postimg&#46;cc/nhmWPHJ3/before&#46;png[/img:3rvo0ax6] [b:3rvo0ax6]after[/b:3rvo0ax6] ( when resize the mdichild and not move over any mouse or windows) [img:3rvo0ax6]https&#58;//i&#46;postimg&#46;cc/RZwPTX78/after&#46;png[/img:3rvo0ax6] I use the sam esystem of yunus mdichild only I change the measure of buttonbar and I add a combobox and a get on buttonbar [code=fw:3rvo0ax6]<div class="fw" id="{CB}" style="font-family: monospace;">  <span style="color: #00C800;">if</span> oWndEsercizi == <span style="color: #00C800;">nil</span><br />      oEsercizi:= TEsercizi<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: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndEsercizi <span style="color: #0000ff;">MDICHILD</span> <span style="color: #0000ff;">OF</span> oWndMain <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Esercizi"</span><br />...<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWndEsercizi <span style="color: #0000ff;">MAXIMIZED</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oGet:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />         <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oWndEsercizi := <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      oWndEsercizi:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">endif</span></div>[/code:3rvo0ax6] any solution ? I add also a resize but ir not work ok [code=fw:3rvo0ax6]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWndEsercizi <span style="color: #0000ff;">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oGet:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> RESIZE &nbsp;oGet:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oWndEsercizi := <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span></div>[/code:3rvo0ax6]
get -oSortCbx
Dear Silvio, Please try it this way: oGet:PostMsg( WM_SETFOCUS )
get -oSortCbx
[quote="Antonio Linares":142c65td]Dear Silvio, Please try it this way: oGet:PostMsg( WM_SETFOCUS )[/quote:142c65td] I must insert it where ? on init ? not run [b:142c65td]this my source[/b:142c65td] [code=fw:142c65td]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Clienti<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oBrw, cClrBack, cAlias<br />   <span style="color: #00C800;">local</span> oBar, oMsgBar, oMsgDeleted<br />   <span style="color: #00C800;">local</span> oIscritti<br />   <span style="color: #00C800;">local</span> cSeek:=space<span style="color: #000000;">&#40;</span><span style="color: #000000;">100</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span>  oGet<br />   <span style="color: #00C800;">if</span> oWndIscritti == <span style="color: #00C800;">nil</span><br />      oIscritti:=TClienti<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 /><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndIscritti <span style="color: #0000ff;">MDICHILD</span> <span style="color: #0000ff;">OF</span> oWndMain <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Tabella Iscritti"</span><br /><br />      @ <span style="color: #000000;">10</span>, <span style="color: #000000;">585</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cSeek <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">280</span>,<span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oBar<br /><br />     @ <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWndIscritti ;<br />      DATASOURCE oIscritti ;<br />      COLUMNS  <span style="color: #ff0000;">"CliCognome"</span>,<span style="color: #ff0000;">"CliNome"</span>,<span style="color: #ff0000;">"CliFiscale"</span>,;<br />               <span style="color: #ff0000;">"CliPartiva"</span>,<span style="color: #ff0000;">"CliIndiriz"</span>,<span style="color: #ff0000;">"CliPaese"</span>,;<br />               <span style="color: #ff0000;">"CliCap"</span>,<span style="color: #ff0000;">"CliProv"</span>, <span style="color: #ff0000;">"CliRegione"</span>,<span style="color: #ff0000;">"CliTelef1"</span>,;<br />               <span style="color: #ff0000;">"CliTelef2"</span>,<span style="color: #ff0000;">"CliEmail"</span>,<span style="color: #ff0000;">"CliSitoWeb"</span>,<span style="color: #ff0000;">"CliAppunti"</span>;<br />      HEADERS  <span style="color: #ff0000;">"Cognome"</span>,<span style="color: #ff0000;">"Nome"</span>,<span style="color: #ff0000;">"Codice Fiscale"</span>,<span style="color: #ff0000;">"Partita Iva"</span>,;<br />               <span style="color: #ff0000;">"Indirizzo"</span>,<span style="color: #ff0000;">"Località"</span>,<span style="color: #ff0000;">"Cap"</span>, <span style="color: #ff0000;">"Provincia"</span>,<span style="color: #ff0000;">"Regione"</span>,;<br />               <span style="color: #ff0000;">"Cellulare"</span>,<span style="color: #ff0000;">"Telefono"</span>,<span style="color: #ff0000;">"Email"</span>,<span style="color: #ff0000;">"Sito Web"</span>,<span style="color: #ff0000;">"Appunti"</span>;<br />      AUTOSORT ;<br />      NOBORDER LINES<br /><br />      oBar  := BrwBtnBar<span style="color: #000000;">&#40;</span> @oBrw, oWndIscritti<span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"ricerca"</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"view"</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Print"</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"report"</span> ;<br />         <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Iscritti report"</span>,, .F.<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">LEFT</span><br /><br /><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">460</span> <span style="color: #0000ff;">COMBOBOX</span> oBrw:<span style="color: #000000;">oSortCbx</span> <span style="color: #0000ff;">VAR</span> oBrw:<span style="color: #000000;">cSortOrder</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">400</span>;<br />      <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oBar<br /><br /><br />  *    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"exit"</span> ;<br />      *  <span style="color: #0000ff;">ACTION</span> oWndIscritti:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">LEFT</span><br /><br />      cAlias = <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      BrwColors<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br />      BrwRecSel<span style="color: #000000;">&#40;</span> oBrw, <span style="color: #ff0000;">"RECNO"</span> <span style="color: #000000;">&#41;</span><br /><br /><br />      WITH OBJECT oBrw<br />         :<span style="color: #000000;">l2007</span>:=.f.<br />         :<span style="color: #000000;">nRecSelColor</span>     :=   nRgb<span style="color: #000000;">&#40;</span> <span style="color: #000000;">245</span>,<span style="color: #000000;">244</span>,<span style="color: #000000;">234</span><span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">bClrStd</span>          := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, 0x88EDFB, CLR_WHITE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">oSeek</span> := oGet<br />      :<span style="color: #000000;">lIncrFilter</span>   := .t.<br />      :<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">lDrawBorder</span> := .t.<br />           :<span style="color: #000000;">l2015</span>               := .T.<br />     <span style="color: #B900B9;">// :bEdit  := { |oRec| EditEsercizi( oRec,oEsercizi ) }</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />      oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #B900B9;">//  oBrw:bLDblClick = { || oBrw:EditSource(,, .T.) }</span><br /><br />      oWndIscritti:<span style="color: #000000;">oClient</span> = oBrw<br />      oWndIscritti:<span style="color: #000000;">oControl</span> = oBrw<br /><br />      <span style="color: #0000ff;">DEFINE</span> MSGBAR oMsgBar <span style="color: #0000ff;">OF</span> oWndIscritti <span style="color: #000000;">2007</span><br /><br />      <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWndIscritti  ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oGet:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ON</span> RESIZE  oGet:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />         <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oWndIscritti := <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      oWndIscritti:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:142c65td]
get -oSortCbx
// \samples\tutor04.prg modificado. [code=fw:2i0xzq27]<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: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><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> oIco, oBar, oBmp<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cSeek := <span style="color: #000000;">&#91;</span>FOCUS EN EL <span style="color: #0000ff;">GET</span> DE SILVIO FALCONI... <span style="color: #0000ff;">TAN</span> SIMPLES... &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oGet<br /><br />&nbsp; &nbsp;SkinButtons<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;SetGetColorFocus<span style="color: #000000;">&#40;</span> CLR_GREEN <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIco FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\i</span>cons<span style="color: #000000;">\f</span>ax.ico"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">22</span>, <span style="color: #000000;">75</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveWin sample"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span> &nbsp;BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"B/W"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ICON</span> oIco<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">26</span>, <span style="color: #000000;">27</span> <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp; &nbsp;Set( 29, ! Set( 29 ) )</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">05</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cSeek <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">280</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oBar<br /><br />&nbsp; &nbsp;oGet:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\n</span>ew.bmp"</span> FLAT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"New"</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; TOOLTIP <span style="color: #ff0000;">"Creates a new document"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\o</span>pen.bmp"</span> FLAT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"*.*"</span>, <span style="color: #ff0000;">"Select a document to open"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; TOOLTIP <span style="color: #ff0000;">"Opens a document"</span> <span style="color: #0000ff;">WHEN</span> .f.<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>loppy.bmp"</span> FLAT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Saves this document"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\p</span>rinter.bmp"</span> FLAT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Prints this document"</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Print this document"</span> GROUP<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\p</span>rop.bmp"</span> FLAT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> PrinterSetup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Setup the printer"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\H</span>elpInd.bmp"</span> FLAT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Version<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"A multiple lines"</span> + ;<br />&nbsp; &nbsp; &nbsp; Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"tooltip!"</span> GROUP<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\H</span>elp.bmp"</span> FLAT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"fivewin power!"</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"fivewin power!"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\E</span>xit.bmp"</span> FLAT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Exit this app"</span> GROUP<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp;DEFINE MESSAGE OF oWnd ;<br />&nbsp; &nbsp; &nbsp; PROMPT " Skype: <!-- e --><a href="mailto:joao@pleno.com.br">joao@pleno.com.br</a><!-- e --> " + FWVERSION + " " + FWCOPYRIGHT + ;<br />&nbsp; &nbsp; &nbsp; NOINSET CENTERED KEYBOARD DATE CLOCK<br />&nbsp; &nbsp;*/</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> BITMAP oBmp FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\f</span>iveback.bmp"</span><br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">bPainted</span> = <span style="color: #000000;">&#123;</span> | hDC | BmpTiled<span style="color: #000000;">&#40;</span> hDC, oWnd, oBmp <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Do you want to quit ?"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp; &nbsp;Set( 29, ! Set( 29 ) )</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <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 /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMenu<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Information"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&About..."</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> FWDESCRIPTION <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\i</span>nfo.bmp"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&End..."</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\e</span>xit.bmp"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Clients"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&New..."</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"New Clients"</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWnd:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span>, <span style="color: #ff0000;">"New Clients..."</span>, <span style="color: #ff0000;">"GR+/G"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>aces.bmp"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Modify..."</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Modif. Clients"</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\e</span>dit.bmp"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Delete..."</span> &nbsp;<span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Del Clients"</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\d</span>elete.bmp"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Browse..."</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Browse Clients"</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\b</span>rowse.bmp"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Utilities"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Calculator..."</span> <span style="color: #0000ff;">ACTION</span> WinExec<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Calc"</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\c</span>alc.bmp"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Internet..."</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> WinExec<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"start iexplore <!-- w --><a class="postlink" href="http://www.fivetech.com">www.fivetech.com</a><!-- w -->"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\e</span>xplorer.bmp"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> BmpTiled<span style="color: #000000;">&#40;</span> hDC, oWnd, oBmp <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nWidth := oWnd:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nHeight := oWnd:<span style="color: #000000;">nHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRow := <span style="color: #000000;">0</span>, nCol := <span style="color: #000000;">0</span>, n<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBmpWidth &nbsp;:= oBmp:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, &nbsp;nBmpHeight := oBmp:<span style="color: #000000;">nHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBmp:<span style="color: #000000;">hBitmap</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">while</span> nRow < nHeight<br />&nbsp; &nbsp; &nbsp; nCol = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">while</span> nCol < nWidth<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PalBmpDraw<span style="color: #000000;">&#40;</span> hDC, nRow, nCol, oBmp:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCol += nBmpWidth<br />&nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; &nbsp; nRow += nBmpHeight<br />&nbsp; &nbsp;end<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:2i0xzq27]
get -oSortCbx
[quote="karinha":wz20tpqg]// \samples\tutor04.prg modificado. [code=fw:wz20tpqg]<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: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> oIco, oBar, oBmp<br />   <span style="color: #00C800;">LOCAL</span> cSeek := <span style="color: #000000;">&#91;</span>FOCUS EN EL <span style="color: #0000ff;">GET</span> DE SILVIO FALCONI... <span style="color: #0000ff;">TAN</span> SIMPLES...       <span style="color: #000000;">&#93;</span><br />   <span style="color: #00C800;">LOCAL</span> oGet<br /><br />   SkinButtons<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   SetGetColorFocus<span style="color: #000000;">&#40;</span> CLR_GREEN <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIco FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\i</span>cons<span style="color: #000000;">\f</span>ax.ico"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">22</span>, <span style="color: #000000;">75</span> ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveWin sample"</span> ;<br />      <span style="color: #0000ff;">MENU</span>  BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"B/W"</span> ;<br />      <span style="color: #0000ff;">ICON</span> oIco<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">26</span>, <span style="color: #000000;">27</span> <span style="color: #0000ff;">OF</span> oWnd<br /><br />   <span style="color: #B900B9;">//    Set( 29, ! Set( 29 ) )</span><br />   <span style="color: #00C800;">IF</span> Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br />   @ <span style="color: #000000;">10</span>, <span style="color: #000000;">05</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cSeek <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">280</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oBar<br /><br />   oGet:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\n</span>ew.bmp"</span> FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"New"</span> <span style="color: #000000;">&#41;</span> ;<br />      TOOLTIP <span style="color: #ff0000;">"Creates a new document"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\o</span>pen.bmp"</span> FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"*.*"</span>, <span style="color: #ff0000;">"Select a document to open"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />      TOOLTIP <span style="color: #ff0000;">"Opens a document"</span> <span style="color: #0000ff;">WHEN</span> .f.<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>loppy.bmp"</span> FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Saves this document"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\p</span>rinter.bmp"</span> FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Prints this document"</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Print this document"</span> GROUP<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\p</span>rop.bmp"</span> FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> PrinterSetup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Setup the printer"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\H</span>elpInd.bmp"</span> FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Version<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"A multiple lines"</span> + ;<br />      Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"tooltip!"</span> GROUP<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\H</span>elp.bmp"</span> FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"fivewin power!"</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"fivewin power!"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\E</span>xit.bmp"</span> FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Exit this app"</span> GROUP<br /><br />   <span style="color: #B900B9;">/*<br />   DEFINE MESSAGE OF oWnd ;<br />      PROMPT " Skype: <!-- e --><a href="mailto:joao@pleno.com.br">joao@pleno.com.br</a><!-- e --> " + FWVERSION + " " + FWCOPYRIGHT + ;<br />      NOINSET CENTERED KEYBOARD DATE CLOCK<br />   */</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\f</span>iveback.bmp"</span><br /><br />   oWnd:<span style="color: #000000;">bPainted</span> = <span style="color: #000000;">&#123;</span> | hDC | BmpTiled<span style="color: #000000;">&#40;</span> hDC, oWnd, oBmp <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />      <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Do you want to quit ?"</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">//    Set( 29, ! Set( 29 ) )</span><br />   <span style="color: #00C800;">IF</span> Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oMenu<br /><br />   <span style="color: #0000ff;">MENU</span> oMenu<br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Information"</span><br />      <span style="color: #0000ff;">MENU</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&About..."</span> ;<br />            <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> FWDESCRIPTION <span style="color: #000000;">&#41;</span> ;<br />            FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\i</span>nfo.bmp"</span><br />         <span style="color: #0000ff;">SEPARATOR</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&End..."</span>  ;<br />            <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\e</span>xit.bmp"</span><br /><br />      <span style="color: #0000ff;">ENDMENU</span><br /><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Clients"</span><br />      <span style="color: #0000ff;">MENU</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&New..."</span> ;<br />            <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"New Clients"</span> <span style="color: #000000;">&#41;</span>,;<br />                     oWnd:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span>, <span style="color: #ff0000;">"New Clients..."</span>, <span style="color: #ff0000;">"GR+/G"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />            FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>aces.bmp"</span><br /><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Modify..."</span>  <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Modif. Clients"</span> <span style="color: #000000;">&#41;</span> ;<br />            FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\e</span>dit.bmp"</span><br /><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Delete..."</span>  <span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Del Clients"</span> <span style="color: #000000;">&#41;</span> ;<br />            FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\d</span>elete.bmp"</span><br /><br />         <span style="color: #0000ff;">SEPARATOR</span><br /><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Browse..."</span>  <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Browse Clients"</span> <span style="color: #000000;">&#41;</span> ;<br />            FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\b</span>rowse.bmp"</span><br /><br />      <span style="color: #0000ff;">ENDMENU</span><br /><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Utilities"</span><br />      <span style="color: #0000ff;">MENU</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Calculator..."</span> <span style="color: #0000ff;">ACTION</span> WinExec<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Calc"</span> <span style="color: #000000;">&#41;</span> ;<br />            FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\c</span>alc.bmp"</span><br /><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Internet..."</span> ;<br />            <span style="color: #0000ff;">ACTION</span> WinExec<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"start iexplore <!-- m --><a class="postlink" href="http://www.fivetech.com">http://www.fivetech.com</a><!-- m -->"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> ;<br />            FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\e</span>xplorer.bmp"</span><br />      <span style="color: #0000ff;">ENDMENU</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> BmpTiled<span style="color: #000000;">&#40;</span> hDC, oWnd, oBmp <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nWidth := oWnd:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nHeight := oWnd:<span style="color: #000000;">nHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nRow := <span style="color: #000000;">0</span>, nCol := <span style="color: #000000;">0</span>, n<br />   <span style="color: #00C800;">local</span> nBmpWidth  := oBmp:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,  nBmpHeight := oBmp:<span style="color: #000000;">nHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> oBmp:<span style="color: #000000;">hBitmap</span> == <span style="color: #000000;">0</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">while</span> nRow < nHeight<br />      nCol = <span style="color: #000000;">0</span><br />      <span style="color: #00C800;">while</span> nCol < nWidth<br />         PalBmpDraw<span style="color: #000000;">&#40;</span> hDC, nRow, nCol, oBmp:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />         nCol += nBmpWidth<br />      end<br />      nRow += nBmpHeight<br />   end<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:wz20tpqg][/quote:wz20tpqg] Sorry, I not understood but U saw my question?
get -oSortCbx
Silvio, Instead of: ON RESIZE oGet:setfocus() use: ON RESIZE oGet:PostMsg( WM_SETFOCUS )
get -oSortCbx
[quote="Antonio Linares":rxx61xxh]Silvio, Instead of: ON RESIZE oGet:setfocus() use: ON RESIZE oGet:PostMsg( WM_SETFOCUS )[/quote:rxx61xxh] I allready tested all two commands and not run ok when I move the mdichild I not see the get control, then if I move the mouse over or another windows I see the get control [img:rxx61xxh]https&#58;//i&#46;postimg&#46;cc/xT8Yhyn0/test&#46;gif[/img:rxx61xxh]
get : Valid clausule not executed
Hello,Using fwh8.10 , i have problems with next :[code:3kbyvd00] &#46;&#46;&#46;&#46; REDEFINE GET oGet&#91;1&#93; cVal1 VALID &#46;F&#46; REDEFINE GET oGet&#91;2&#93; cVal2 ACTION msginfo&#40;"ok"&#41; &#46;&#46;&#46;&#46; [/code:3kbyvd00]When oGet[1] has focus we can use the mouse and click on the baction bitmap from oget[2] WITHOUT the valid clausule is executed.Enter , tab or trying to move to the inputfield from oGet[2] with the mouse worksFrank
get : Valid clausule not executed
Frank,Please try this:[code:36fcyue7] &#46;&#46;&#46;&#46; REDEFINE GET oGet&#91;1&#93; cVal1 VALID &#46;F&#46; REDEFINE GET oGet&#91;2&#93; cVal2 ACTION msginfo&#40;"ok"&#41; oGet&#91;2&#93;&#58;oBtn&#58;lCancel &#58;= &#46;F&#46; &#46;&#46;&#46;&#46; [/code:36fcyue7]
get PASSWORD
Hola Antonio: ¿Por qué no está disponible REDEFINE GET ... PASSWORD pero sí en un Get via cordenadas?. Muchas gracias. Salu2
get PASSWORD
Generalmente en los generadores de recursos ya le puedes aplicar ese atributo, y no hace falta hacerlo desde el código.
get PASSWORD
Hola Me refiero para obtener el look de windows xp, que es lo que busco, incluyendo la autodetección de las mayúsculas. Gracias. Salu2
get PASSWORD
Moises, en las propiedades del recurso hay que activarle para que sea password, y utiliza font tahoma en el dialogo para que tome el estilo de winxp saludos
get PASSWORD
Hola: Los gets tipo password me funcionan correctamente desde siempre. Sin embargo, he visto que soportan el LOOK XP, que es lo que busco, pero sólo cuando los defines via coordenadas, no desde un dialog, que es lo que bsuco. Muchas gracias. Salu2
get WINDOW xp themed ?
Antonio, eu uso XP e tenho um get em uma WINDOW, ao executar esta window ele vem sem XP THEMED, porém ao passar o mouse por cima do get ele assume XP THEMED. Como resolver isso? Grato Aoki
get WINDOW xp themed ?
Aoki, Has incluido esta línea en tu RC ? 1 24 "WindowsXP.Manifest" El fichero WindowsXP.Manifest está en samples\winxp
get WINDOW xp themed ?
Sim Antonio, eu adicionei o XPLOOK.RC ao meu projeto, tanto que o resto da minha aplicação o XP THEMED esta OK! XPLOOK.RC: // Add this to your resources RC file #ifdef __FLAT__ 1 24 "c:\fwh71\include\WindowsXP.Manifest" #endif #ifdef __64__ 1 24 "WinXP/WindowsXP.Manifest64" #endif Aoki
get WINDOW xp themed ?
Aoki, Puedes capturar una imagen de como se ve tu ventana y mostrarla aqui ? gracias
get WINDOW xp themed ?
Antonio: Antes de passar o mouse: <!-- m --><a class="postlink" href="http://img236.imageshack.us/img236/9161/imagem1mw1.jpg">http://img236.imageshack.us/img236/9161/imagem1mw1.jpg</a><!-- m --> Depois de passar o mouse: <!-- m --><a class="postlink" href="http://img236.imageshack.us/img236/2209/imagem2yk0.jpg">http://img236.imageshack.us/img236/2209/imagem2yk0.jpg</a><!-- m --> FONTE: Define Font fonte_ME Name 'Times New Roman' Size -0,24 BOLD define window oWndc from 0, 0 TO 25, 70 ; title "Controle de Mesas" MDICHILD OF oWnd vscroll icon oico COLOR EMP_MCOR,EMP_MCOR NOICONIZE oWndc:maximize() oGr:=TGroup():New( 00.7, 01, 04.8, nugro, "Consulta e Manutenção de Mesas:", oWndc, NIL, NIL, .F. , .F. , NIL ) @ 00.9,02 trsay "Mesa:" OF oWndc COLOR CLR_BLACK FONT fonte_ME SIZE 60,24 @ 02.3,11 get obtm VAR nmesa OF oWndc picture "999999" font fonte_ME RIGHT SIZE 90,28 SPINNER MIN 0 MAX nMaxMesa ACTIVATE WINDOW oWndc MAXIMIZED Grato Antonio Aoki
get WINDOW xp themed ?
Aoki, Lo que quieres es que se vea SIN tema ? ó CON tema ?
get WINDOW xp themed ?
Antonio, assim como toda a minha aplicação se for XP = COM TEMA! OU SEJA: COM TEMA E o get só assume o TEMA se passar o mouse por cima do get! Gracias Aoki
get WINDOW xp themed ?
Aoki, Quieres decir que el get pierde el tema al pasar el ratón por encima de él ?
get WINDOW xp themed ?
Antonio, Quieres decir que el get pierde el tema al pasar el ratón por encima de él ? Não!!! Na verdade ele ganha el tema al pasar el ratón por encima do get
get action
[code:3lssy4oj] @ 110, 055 GET oPve_Prod VAR nPve_Prod PIXEL OF oFldProd&#58;aDialogs&#91; 1 &#93; COLOR CLR_GET1,CLR_GET2 SIZE 35, 10 BITMAP "" PICTURE "@E 999,999&#46;99" ACTION CalcPrcVe&#40; oPve_Prod, nPcu_Prod, nPve_Prod, lAppend &#41; [/code:3lssy4oj] [b:3lssy4oj]SEM RIGHT[/b:3lssy4oj] [img:3lssy4oj]http&#58;//www&#46;johnson&#46;oi&#46;com&#46;br/get1&#46;jpg[/img:3lssy4oj] [code:3lssy4oj] @ 110, 055 GET oPve_Prod VAR nPve_Prod PIXEL RIGHT OF oFldProd&#58;aDialogs&#91; 1 &#93; COLOR CLR_GET1,CLR_GET2 SIZE 35, 10 BITMAP "" PICTURE "@E 999,999&#46;99" ACTION CalcPrcVe&#40; oPve_Prod, nPcu_Prod, nPve_Prod, lAppend &#41; [/code:3lssy4oj][b:3lssy4oj]COM RIGHT[/b:3lssy4oj][img:3lssy4oj]http&#58;//www&#46;johnson&#46;oi&#46;com&#46;br/get2&#46;jpg[/img:3lssy4oj][b:3lssy4oj]NORMAL?[/b:3lssy4oj]
get action
puedes hacer estos 2 cambien el la clasemetodo paint busca estas lineas[code:4oqudw4e] case lAnd&#40; GetWindowLong&#40; &#58;&#58;hWnd, GWL_STYLE &#41;, ES_RIGHT &#41; SetTextAlign&#40; &#58;&#58;hDC, TA_RIGHT &#41; if &#58;&#58;lSpinner ExtTextOut&#40; &#58;&#58;hDC, 1, &#58;&#58;nWidth&#40;&#41; - 7 - GetSysMetrics&#40; SM_CYHSCROLL &#41;,; &#123; 0, 0, &#58;&#58;nHeight&#40;&#41;, &#58;&#58;nWidth&#40;&#41; &#125;, GetWindowText&#40; &#58;&#58;hWnd &#41; &#41; else ExtTextOut&#40; &#58;&#58;hDC, 1, &#58;&#58;nWidth&#40;&#41; - 7 ,; &#123; 0, 0, &#58;&#58;nHeight&#40;&#41;, &#58;&#58;nWidth&#40;&#41; &#125;, GetWindowText&#40; &#58;&#58;hWnd &#41; &#41; endif [/code:4oqudw4e] agregale este IF [code:4oqudw4e] case lAnd&#40; GetWindowLong&#40; &#58;&#58;hWnd, GWL_STYLE &#41;, ES_RIGHT &#41; SetTextAlign&#40; &#58;&#58;hDC, TA_RIGHT &#41; if &#58;&#58;lSpinner ExtTextOut&#40; &#58;&#58;hDC, 1, &#58;&#58;nWidth&#40;&#41; - 7 - GetSysMetrics&#40; SM_CYHSCROLL &#41;,; &#123; 0, 0, &#58;&#58;nHeight&#40;&#41;, &#58;&#58;nWidth&#40;&#41; &#125;, GetWindowText&#40; &#58;&#58;hWnd &#41; &#41; else if ValType&#40; &#58;&#58;bAction &#41; == "B" // Agregar ExtTextOut&#40; &#58;&#58;hDC, 1, &#58;&#58;nWidth&#40;&#41; - 7 - &#58;&#58;nHeight,; //agregar &#123; 0, 0, &#58;&#58;nHeight&#40;&#41;, &#58;&#58;nWidth&#40;&#41; &#125;, GetWindowText&#40; &#58;&#58;hWnd &#41; &#41; //agregar else //agregar ExtTextOut&#40; &#58;&#58;hDC, 1, &#58;&#58;nWidth&#40;&#41; - 7 ,; &#123; 0, 0, &#58;&#58;nHeight&#40;&#41;, &#58;&#58;nWidth&#40;&#41; &#125;, GetWindowText&#40; &#58;&#58;hWnd &#41; &#41; endif //agregar endif [/code:4oqudw4e] por ultimo en el metodo initiate busca esta linea [code:4oqudw4e] &#58;&#58;SetMargins&#40; 1, 1 &#41; [/code:4oqudw4e] y le agregas este IF [code:4oqudw4e] if ValType&#40; &#58;&#58;bAction &#41; == "B" //agregar &#58;&#58;SetMargins&#40; 1, &#58;&#58;nHeight&#41; //agregar else //agregar &#58;&#58;SetMargins&#40; 1, 1 &#41; endif //agregar [/code:4oqudw4e]con eso creo que seria suficiente, si falto algo o no esta bien hecho que alguien me corrija...
get action
obrigadothanks
get an error FWH 16.01 and xharbour.com
I get an error v.16.01 and xharbour.com Type: C >>>xlink.exe -NOEXPOBJ -MAP -FORCE:MULTIPLE -NOIMPLIB -subsystem:windows -UNMANGLE -LIBPATH:"S:\lib" -LIBPATH:"R:\lib" -LIBPATH:"R:\c_lib" -LIBPATH:"R:\c_lib\win" "t.obj" "S:\lib\png.lib" "S:\lib\send32.lib" "S:\lib\mem32.lib" "r:\c_lib\win\gdi32.lib" "r:\c_lib\win\gdiplus.lib" "xhbzip.lib" "xhbzipdll.lib" "FiveHCM.lib" "FiveHMX.lib" "OptG.lib" "xhb.lib" "dbf.lib" "nsx.lib" "ntx.lib" "cdx.lib" "rmdbfcdx.lib" "ct3comm.lib" crt.lib kernel32.lib user32.lib winspool.lib ole32.lib oleaut32.lib odbc32.lib odbccp32.lib uuid.lib wsock32.lib ws2_32.lib wininet.lib advapi32.lib shlwapi.lib msimg32.lib mpr.lib OleDlg.lib version.lib comctl32.lib comdlg32.lib gdi32.lib shell32.lib winmm.lib lz32.lib Netapi32.lib -out:"t.exe"<<< xLINK: warning: Symbol 'R:\lib\OptG.lib(hvm.obj)->_hb_vmPushSize previously defined at S:\lib\Fivehmx.lib(harbour.obj)' is multiply defined. Creating object: t.EXP Creating library: t.LIB xLINK: error: Unresolved external symbol '_HB_FUN_WNDREADPALBMPEX referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_WNDSAYTEXT referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_WNDSAYPALBMP referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_FW_DRAWSHAPES referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_CALCTEXTWH referenced from Fivehmx.lib(buttonb.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_MEMORYBUFFERTYPE referenced from Fivehmx.lib(xbrowse.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_FW_CREATEBITMAP referenced from Fivehmx.lib(xbrowse.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_TSWITCH referenced from Fivehmx.lib(datarow.obj)'. xLINK: error: Unresolved external symbol '_GetComboBoxInfo referenced from FiveHCM.lib(NONCLIENT.obj)'. xLINK: error: Unresolved external symbol '_GetListBoxInfo referenced from FiveHCM.lib(NONCLIENT.obj)'. xLINK: error: Unresolved external symbol '_GetMenuInfo referenced from FiveHCM.lib(MENUDRAW.obj)'. xLINK: error: Unresolved external symbol '_GetWindowLongPtr referenced from FiveHCM.lib(MENUDRAW.obj)'. xLINK: error: Unresolved external symbol '_SetMenuInfo referenced from FiveHCM.lib(MENUDRAW.obj)'. xLINK: error: Unresolved external symbol '_GetMenuBarInfo referenced from FiveHCM.lib(MENUDRAW.obj)'. xLINK: fatal error: 14 unresolved external(s). Type: C >>>Couldn't build: t.exe<<< Type: C >>>TMAKEPROJECT<<< Type: C >>>TMAKEPROJECT:REFRESH<<< Type: N >>> 1406<<<
get an error FWH 16.01 and xharbour.com
Kajot, There is already a FWH 16.01 build 2 Please download it and try it again Here it is working fine: [img:2xg2wdgr]https&#58;//bitbucket&#46;org/fivetech/screenshots/downloads/xharbour_builder&#46;JPG[/img:2xg2wdgr] libraries to link: [C:\xhb\c_lib\win\psapi.lib] [C:\xhb\c_lib\win\gdiplus.lib] [c:\xhb\lib\xhbzip.lib] [c:\xhb\lib\xhbzipdll.lib] [xfw.lib] [mem32.lib] [send32.lib]
get an error FWH 16.01 and xharbour.com
I have version FWH 16.01 v2 I add [S:\lib\send32.lib] [S:\lib\mem32.lib] [S:\lib\png.lib] [xfw.lib] [r:\c_lib\win\gdi32.lib] [r:\c_lib\win\gdiplus.lib] [xhbzip.lib] [xhbzipdll.lib] [xfw.lib] [psapi.lib] now I got error Type: C >>>xlink.exe -NOEXPOBJ -MAP -FORCE:MULTIPLE -NOIMPLIB -subsystem:windows -UNMANGLE -LIBPATH:"S:\lib" -LIBPATH:"R:\lib" -LIBPATH:"R:\c_lib" -LIBPATH:"R:\c_lib\win" "t.obj" "S:\lib\send32.lib" "S:\lib\mem32.lib" "S:\lib\png.lib" "xfw.lib" "r:\c_lib\win\gdi32.lib" "r:\c_lib\win\gdiplus.lib" "xhbzip.lib" "xhbzipdll.lib" "psapi.lib" "FiveHCM.lib" "FiveHMX.lib" "OptG.lib" "xhb.lib" "dbf.lib" "nsx.lib" "ntx.lib" "cdx.lib" "rmdbfcdx.lib" "ct3comm.lib" crt.lib kernel32.lib user32.lib winspool.lib ole32.lib oleaut32.lib odbc32.lib odbccp32.lib uuid.lib wsock32.lib ws2_32.lib wininet.lib advapi32.lib shlwapi.lib msimg32.lib mpr.lib OleDlg.lib version.lib comctl32.lib comdlg32.lib gdi32.lib shell32.lib winmm.lib lz32.lib Netapi32.lib -out:"t.exe"<<< xLINK: warning: Symbol 'R:\lib\OptG.lib(hvm.obj)->_hb_vmPushSize previously defined at S:\lib\Fivehmx.lib(harbour.obj)' is multiply defined. Creating object: t.EXP Creating library: t.LIB xLINK: error: Unresolved external symbol '_HB_FUN_MEMORYBUFFERTYPE referenced from Fivehmx.lib(xbrowse.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_CALCTEXTWH referenced from Fivehmx.lib(xbrowse.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_FW_CREATEBITMAP referenced from Fivehmx.lib(xbrowse.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_WNDREADPALBMPEX referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_WNDSAYTEXT referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_WNDSAYPALBMP referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_FW_DRAWSHAPES referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_GetComboBoxInfo referenced from FiveHCM.lib(NONCLIENT.obj)'. xLINK: error: Unresolved external symbol '_GetListBoxInfo referenced from FiveHCM.lib(NONCLIENT.obj)'. xLINK: fatal error: 9 unresolved external(s). Type: C >>>Couldn't build: t.exe<<< Type: C >>>TMAKEPROJECT<<< Type: C >>>TMAKEPROJECT:REFRESH<<< Type: N >>> 1406<<<
get an error FWH 16.01 and xharbour.com
Please download xfw.lib again from here: [url:2fieva3w]https&#58;//bitbucket&#46;org/fivetech/fivewin-contributions/downloads/xfw&#46;lib[/url:2fieva3w] and try it again
get an error FWH 16.01 and xharbour.com
still error Type: C >>>xlink.exe -NOEXPOBJ -MAP -FORCE:MULTIPLE -NOIMPLIB -subsystem:windows -UNMANGLE -LIBPATH:"S:\lib" -LIBPATH:"R:\lib" -LIBPATH:"R:\c_lib" -LIBPATH:"R:\c_lib\win" "t.obj" "send32.lib" "mem32.lib" "png.lib" "xfw.lib" "r:\c_lib\win\gdi32.lib" "r:\c_lib\win\gdiplus.lib" "xhbzip.lib" "xhbzipdll.lib" "r:\c_lib\win\psapi.lib" "FiveHCM.lib" "FiveHMX.lib" "OptG.lib" "xhb.lib" "dbf.lib" "nsx.lib" "ntx.lib" "cdx.lib" "rmdbfcdx.lib" "ct3comm.lib" crt.lib kernel32.lib user32.lib winspool.lib ole32.lib oleaut32.lib odbc32.lib odbccp32.lib uuid.lib wsock32.lib ws2_32.lib wininet.lib advapi32.lib shlwapi.lib msimg32.lib mpr.lib OleDlg.lib version.lib comctl32.lib comdlg32.lib gdi32.lib shell32.lib winmm.lib lz32.lib Netapi32.lib -out:"t.exe"<<< xLINK: warning: Symbol 'R:\lib\OptG.lib(hvm.obj)->_hb_vmPushSize previously defined at S:\lib\Fivehmx.lib(harbour.obj)' is multiply defined. Creating object: t.EXP Creating library: t.LIB xLINK: error: Unresolved external symbol '_HB_FUN_MEMORYBUFFERTYPE referenced from Fivehmx.lib(xbrowse.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_CALCTEXTWH referenced from Fivehmx.lib(xbrowse.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_FW_CREATEBITMAP referenced from Fivehmx.lib(xbrowse.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_WNDREADPALBMPEX referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_WNDSAYTEXT referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_WNDSAYPALBMP referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_HB_FUN_FW_DRAWSHAPES referenced from Fivehmx.lib(window.obj)'. xLINK: error: Unresolved external symbol '_GetComboBoxInfo referenced from FiveHCM.lib(NONCLIENT.obj)'. xLINK: error: Unresolved external symbol '_GetListBoxInfo referenced from FiveHCM.lib(NONCLIENT.obj)'. xLINK: fatal error: 9 unresolved external(s). Type: C >>>Couldn't build: t.exe<<< Type: C >>>TMAKEPROJECT<<< Type: C >>>TMAKEPROJECT:REFRESH<<< Type: N >>> 1406<<<
get an error FWH 16.01 and xharbour.com
Kajot, I have just emailed you the libraries that I am using here Please try it with them again
get an error FWH 16.01 and xharbour.com
thanks yet error Type: C >>>xlink.exe -NOEXPOBJ -MAP -FORCE:MULTIPLE -NOIMPLIB -subsystem:windows -UNMANGLE -LIBPATH:"S:\lib" -LIBPATH:"R:\lib" -LIBPATH:"R:\c_lib" -LIBPATH:"R:\c_lib\win" "t.obj" "S:\lib\send32.lib" "S:\lib\mem32.lib" "S:\lib\png.lib" "xfw.lib" "r:\c_lib\win\gdi32.lib" "r:\c_lib\win\gdiplus.lib" "xhbzip.lib" "xhbzipdll.lib" "R:\c_lib\win\psapi.lib" "FiveHCM.lib" "FiveHMX.lib" "OptG.lib" "xhb.lib" "dbf.lib" "nsx.lib" "ntx.lib" "cdx.lib" "rmdbfcdx.lib" "ct3comm.lib" crt.lib kernel32.lib user32.lib winspool.lib ole32.lib oleaut32.lib odbc32.lib odbccp32.lib uuid.lib wsock32.lib ws2_32.lib wininet.lib advapi32.lib shlwapi.lib msimg32.lib mpr.lib OleDlg.lib version.lib comctl32.lib comdlg32.lib gdi32.lib shell32.lib winmm.lib lz32.lib Netapi32.lib -out:"t.exe"<<< Creating object: t.EXP Creating library: t.LIB xLINK: error: Unresolved external symbol '_GetComboBoxInfo referenced from FiveHCM.lib(NONCLIENT.obj)'. xLINK: error: Unresolved external symbol '_GetListBoxInfo referenced from FiveHCM.lib(NONCLIENT.obj)'. xLINK: fatal error: 2 unresolved external(s). Type: C >>>Couldn't build: t.exe<<< Type: C >>>TMAKEPROJECT<<< Type: C >>>TMAKEPROJECT:REFRESH<<< Type: N >>> 1406<<<
get an error FWH 16.01 and xharbour.com
Kajot, It seems as you are not using the right xfw.lib as we already included those symbols there: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=185413#p185413">viewtopic.php?p=185413#p185413</a><!-- l --> Please download it again from here and check that you use it: [url:2neyypnv]https&#58;//bitbucket&#46;org/fivetech/fivewin-contributions/downloads/xfw_20151229&#46;zip[/url:2neyypnv]
get an error FWH 16.01 and xharbour.com
it's right, thanks for help !
get an error FWH 16.01 and xharbour.com
very good <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
get bitmap action or button
can a get ...bitmap...action ... or a button call a menu popup ? do you have a simply test please ?
get bitmap action or button
Silvio, [code=fw:1t11r23y]<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: #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> oDlg, cTest := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">GET</span> cTest <span style="color: #0000ff;">ACTION</span> ShowPopup<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> ShowPopup<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMenu<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu <span style="color: #0000ff;">POPUP</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"One"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Two"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Three"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <br />&nbsp; &nbsp;&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">POPUP</span> oMenu <span style="color: #0000ff;">OF</span> oDlg <span style="color: #00C800;">AT</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1t11r23y]
get bitmap action or button
Sorry Antonio, But I saw I was "Pirla" (italian Language) "Idiot" on English..... Perhaps i am very Old!! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
get btn as combobox btn
[img:13d0veiu]https&#58;//i&#46;postimg&#46;cc/htwj7KmW/get-btn&#46;png[/img:13d0veiu] How I can make to have the same btn on get as the combobox ? I'd like have as this [img:13d0veiu]https&#58;//i&#46;postimg&#46;cc/8zK2pbYt/mmm&#46;jpg[/img:13d0veiu] any solution please ?
get btn as combobox btn
GET .... ACTION ...BITMAP FwDArrow()
get btn as combobox btn
thanks but is to large (btnbmp) I tried to set aGet[2]:oBtn:nWidth:= 20 it can run ok but it is moved
get btn as combobox btn
Resolved !!!!! [img:17f5xopt]https&#58;//i&#46;postimg&#46;cc/QxbtfD3N/yes&#46;png[/img:17f5xopt] @ 06,50 GET aGet[2] VAR nNumberElemento SIZE 50,32 PIXEL of oFld:aDialogs[1] FONT oLarge ; bitmap FwDArrow() ; ACTION .... ACTIVATE DIALOG oDlgPre CENTERED ; ON INIT..... aGet[2]:oBtn:nWidth:= 20 ,; aGet[2]:oBtn:nLeft:=aget[2]:nLeft-20 ,;
get combobox
The get object in combobox does not jump to next control when len get full. What to do?
get combobox
Try this: oCombo:bChange = { || If( oCombo:oGet:TypeOut, oCombo:oWnd:GoNextCtrl( oCombo:hWnd ),) }
get combobox
[quote="Antonio Linares":ekn5xs2w]Try this: oCombo:bChange = { || If( oCombo:oGet:TypeOut, oCombo:oWnd:GoNextCtrl( oCombo:hWnd ),) }[/quote:ekn5xs2w] Not Solved... little change in code: "oGet:TypeOut" for "oGet:oGet:TypeOut", but, not go next control. text in oGet is full select and do not go next. see in image: [img:ekn5xs2w]http&#58;//www&#46;acessosoft&#46;com&#46;br/img/getcombo&#46;png[/img:ekn5xs2w]
get combobox
Please check if you ear the beep: oCombo:bChange = { || If( oCombo:oGet:oGet:TypeOut, ( MsgBeep(), oCombo:oWnd:GoNextCtrl( oCombo:hWnd ) ),) }