topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
descargar Borland 5.82 | Distinguido Antonio
En éstas funciones me da error de advertencia
[code=fw:2h4v98aw]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><span style="color: #00D7D7;">#include</span> <Windows.h><br /><span style="color: #00D7D7;">#include</span> <mapiwin.h><br /><span style="color: #00D7D7;">#include</span> <hbApi.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> RESTFILE <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HRSRC res=FindResource<span style="color: #000000;">(</span><span style="color: #00C800;">NULL</span>,<span style="color: #ff0000;">"FREEIMAGE"</span>,RT_RCDATA<span style="color: #000000;">)</span>;<br /> DWORD bytesWritten;<br /> INT <span style="color: #0000ff;">size</span>=SizeofResource<span style="color: #000000;">(</span><span style="color: #00C800;">NULL</span>,res<span style="color: #000000;">)</span>;<br /> HGLOBAL hRes=LoadResource<span style="color: #000000;">(</span><span style="color: #00C800;">NULL</span>,res<span style="color: #000000;">)</span>;<br /> unsigned char *pRes=<span style="color: #000000;">(</span>unsigned char *<span style="color: #000000;">)</span>LockResource<span style="color: #000000;">(</span>hRes<span style="color: #000000;">)</span>;<br /> const char * <span style="color: #0000ff;">name</span> = hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> HANDLE hFile=CreateFile<span style="color: #000000;">(</span> <span style="color: #0000ff;">name</span>, GENERIC_WRITE,<span style="color: #000000;">0</span>,<span style="color: #00C800;">NULL</span>,CREATE_ALWAYS,<span style="color: #000000;">0</span>,<span style="color: #00C800;">NULL</span><span style="color: #000000;">)</span>; <br /> WriteFile<span style="color: #000000;">(</span>hFile, pRes,<span style="color: #0000ff;">size</span>,&bytesWritten,<span style="color: #00C800;">NULL</span><span style="color: #000000;">)</span>;<br /> CloseHandle<span style="color: #000000;">(</span>hFile<span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <shlobj.h><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapiitm.h"</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> C_GETSPECIALFOLDER <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> char *lpBuffer = <span style="color: #000000;">(</span>char*<span style="color: #000000;">)</span> hb_xgrab<span style="color: #000000;">(</span> MAX_PATH<span style="color: #000000;">+1</span><span style="color: #000000;">)</span>;<br /> LPITEMIDLIST pidlBrowse; <br /> SHGetSpecialFolderLocation<span style="color: #000000;">(</span>GetActiveWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span>, &pidlBrowse<span style="color: #000000;">)</span> <br />;<br /> SHGetPathFromIDList<span style="color: #000000;">(</span>pidlBrowse, lpBuffer<span style="color: #000000;">)</span>;<br /> hb_retc<span style="color: #000000;">(</span>lpBuffer<span style="color: #000000;">)</span>;<br /> hb_xfree<span style="color: #000000;">(</span> lpBuffer<span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:2h4v98aw]
El error es:
Warning W8019 D:\COMPILER\BCC63\include\windows\winnt.h 14966: Code has no effect in function TpDestroyCallbackEnviron
Gracias por la ayuda
Saludos,
Adhemar |
descargar Borland 5.82 | Explorando FWH ...
Buenos Dias Sr. Antonio:
Apreciaría mucho que usted pueda definir aquí las diferencias, ventajas o desventajas de aplicar cada version de compiladores C (Microsoft, Borland, PellesC, o el mismo Blinker) para resultados 100% compatibles con vuestra librería. Personalmente, explorando la forma de migrar de Clipper a Fivewin encuentro muy exitoso el resultado de simples EXEs, pero no se que diantres podría estar pasando a la interna y/o qué consecuencias podría traer un compilado no adecuado en determinados y conflictivos entornos de ejecución. Desde ya muchas Gracias por su Docencia.
Atte
Julio César Gómez Cortéz
Godryc Experiencias
Lima Perú
Consultor |
descargar Borland 5.82 | Julio,
Puedes usar Borland 5.82, ó Visual Studio ó MinGW gcc, y todos te funcionarán bien con Harbour y FWH <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
El más popular es Borland. Y cada vez más usuarios estan empezando a usar Visual Studio ahora que es gratis (eso parece de momento).
Hay pocos usuarios con MinGW gcc (GNU) por lo que estarás más solo usándolo.
Mi consejo: empieza con Borland que es bastante amigable y más adelante si te animas prueba Visual Studio <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
descargar Borland 5.82 | Gracias Sr. Antonio.
Ahora entiendo que entre los compiladores de Borland y VisualC está la mayor eficacia en la
interna respecto a exactos cálculos matemáticos y la complejidad del entorno visual. Me ha
sucedido algunas veces midiendo lo mostrado en el monitor (con regla), que los tamaños de
ventanas mostrados en una compilación hola mundo con FWH XHarbour borland C55 y Recur
sos PellesC han sufrido vaciaciones, tanto en su posicionamiento como en su tamaño de
caja. Deduzco que Recursos PellesC puede no ser fiable respecto a mostrar dialogos, aunque
en realidad no veo mucha diferencia entre lo que se lee en un archivo RC de PellesC y otro
de Workshop. También me ha sucedido en un xbrowse de database con 100 registros y 15
lineas en pantalla, que, cuando se abre por primera vez y posicionado en la primera linea,
si me muevo con flecha abajo hasta la ultime linea 15, y luego sigo pulsando flecha abajo
para que me muestra los tres registros siguientes, las posiciones son normales, y
cuando regreso pulsando PgUp y flechas arriba, el xbrowse se trunca en su visual, hacien
do distorsion de registro (nunca puedo alcanzar la primera linea). Esto pasó explorando
su producto FWH demo.
Agradecido por su atención!!!
Julio César Gómez Cortez
Godryc Experiencias
Lima Perú |
descargar Borland 5.82 | Julio,
La versión demo es muy antigua. Prueba a descargar FiveDBU y comprueba que tal se comportan los browses.
Se incluye todo el código fuente para que lo puedas usar para tus propias aplicaciones:
[url:3cnb1iow]https://bitbucket.org/fivetech/fivewin-contributions/downloads/fivedbu_20140730.zip[/url:3cnb1iow] |
descargar fichero desde un servidor Https | Amigo a mi me funciona al 100% esto con xHarbour :
cHttp:='https://www.myserver.com/dato.txt'
if !URLDownLoad(cHttp, 'c:\MisDescargas\Respuesta.txt')
mensaje('Error : '+cHttp)
else
? memoread('c:\MisDescargas\Respuesta.txt')
endif
*----------------------------*
func URLDownLoad(cUrl, cSaveAs)
hLib = LOADLIBRARY( "urlmon.dll")
if !URLDownloadToFile( 0, cUrl, cSaveAs, 0, 0 ) == 0
retu.f.
endif
FREELIBRARY( hLib )
retu.t.
DLL32 FUNCTION URLDownloadToFile(pCaller AS LONG,szURL AS STRING, szFileName AS STRING, dwReserved AS LONG, lpfnCB AS LONG);
AS LONG PASCAL;
FROM "URLDownloadToFileA";
LIB hlib |
descargar fichero desde un servidor Https | Amigos,
¿Alguien lo ha conseguido descargar desde <!-- m --><a class="postlink" href="https://www.myserver.com/dato.txt?">https://www.myserver.com/dato.txt?</a><!-- m -->.
Muchas gracias. |
descargar fichero desde un servidor Https | oUrl := tURL():New(http+cDirSer+"/zerusbas.rar" )
oClient := tIPClientHTTP():New( oUrl )
oClient:nConnTimeout := nSegEsp
IF oClient:Open( oUrl )
oClient:ReadToFile( cRutDes+"zerusbas.rar",nil,nil,"no borra chr(13)")
oClient:Close()
ELSE
MYMEN("Error. No fue posible conectarse al servidor "+cNomSer)
meter(9)
return
ENDIF |
descargar fichero desde un servidor Https | Hola,
Muchas gracias.
URLDownloadToFile es lo que utilizaba, pero en Windows 8 falla bastante sin motivo aparente.
Y tIPClientHTTP():New( oUrl ) no funciona con HTTPS. |
descargar fichero desde un servidor Https | [quote="lucasdebeltran":mgranf6e]Hola,
Muchas gracias.
URLDownloadToFile es lo que utilizaba, pero en Windows 8 falla bastante sin motivo aparente.
Y tIPClientHTTP():New( oUrl ) no funciona con HTTPS.[/quote:mgranf6e]
Sabes cual es la funcion que reemplaza al TIPCLIENTHTTP() para lo https |
descargar fichero desde un servidor Https | Otra alternativa es 'wget.exe', yo lo uso desde hace tiempo por un consejo de alguien de este foro y funciona muy bien, probado en XP, W7 y W8.1 tanto con HTTP como con HTTPS
[code=fw:yot3uk2b]<div class="fw" id="{CB}" style="font-family: monospace;">waitRun<span style="color: #000000;">(</span> <span style="color: #ff0000;">"wget.exe -q -r -t6 --no-check-certificate miurl<span style="color: #000000;">\m</span>iarchivo.txt -O c:<span style="color: #000000;">\m</span>iarchivo.txt"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span></div>[/code:yot3uk2b]
Saludos <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
descargar fichero desde un servidor Https | QUE VERSION DE WGET USAS ? |
descargar fichero desde un servidor Https | Hola
wGet v.1.15
Saludos <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
descargo la Contribucion Harbour y Xharbour desde svn | Saludos al Forum
Desde donde descargo la Contribucion Harbour y Xharbour desde svn. |
descargo la Contribucion Harbour y Xharbour desde svn | [url:2np712n5]http://www.pctoledo.com.br/forum/viewtopic.php?f=43&t=6701&p=93104&hilit=svn#p93104[/url:2np712n5]
[url:2np712n5]http://www.pctoledo.com.br/forum/viewtopic.php?f=4&t=13920&p=90698&hilit=svn#p90698[/url:2np712n5]
Saludos. |
descargo la Contribucion Harbour y Xharbour desde svn | [quote="karinha":34a3gzc0][url:34a3gzc0]http://www.pctoledo.com.br/forum/viewtopic.php?f=43&t=6701&p=93104&hilit=svn#p93104[/url:34a3gzc0]
[url:34a3gzc0]http://www.pctoledo.com.br/forum/viewtopic.php?f=4&t=13920&p=90698&hilit=svn#p90698[/url:34a3gzc0]
Saludos.[/quote:34a3gzc0]
Gracias karinha |
desciption classy TXBROWSE() | where I may found description classy: TXBrowse() and AddCol()
regards
kajot |
desciption classy TXBROWSE() | Kajot,
In FWH docs |
descomprimir archivo zip | Hola compañeros, hace años que tengo una función para comprimir los dbf y ftp para tener un backup. Nunca hice que el programa los descomprimiera, ahora necesito hacerlo pero no puedo hacerlo funcionar. Uso los ejemplos del blog de xBielsys.
probé primeramente con
[code=fw:14ouce3d]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">FUNCTION</span> descomprime<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <br /> <span style="color: #00C800;">if</span> hb_UnZipFile<span style="color: #000000;">(</span><span style="color: #ff0000;">"k:<span style="color: #000000;">\f</span>ivehme<span style="color: #000000;">\p</span>rueba<span style="color: #000000;">\a</span>rchivo.zip"</span><span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"exito "</span><br /> <span style="color: #00C800;">else</span><br /> ? <span style="color: #ff0000;">"no"</span><br /> <span style="color: #00C800;">endif</span> <br /><br /><span style="color: #000000;">[</span>code<span style="color: #000000;">]</span><br /><br />el resultado es no<br /><br />y luego<br /><br /><span style="color: #000000;">[</span>code<span style="color: #000000;">]</span> <span style="color: #00C800;">FUNCTION</span> descomprime<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg,nFiles,oText, cMsg, oMeter,nActual:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> cFile := cGetfile<span style="color: #000000;">(</span><span style="color: #ff0000;">"archivo(*.zip) |*.zip|"</span>,<span style="color: #ff0000;">"Seleccionar archivo"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> lval := .t.<br /> <span style="color: #00C800;">LOCAL</span> cDestino := cgetdir<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <br /> nFiles:=Len<span style="color: #000000;">(</span>hb_GetFilesInZip<span style="color: #000000;">(</span>cFile<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /><br /><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <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;">10</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Espere ejecutando recuperación de datos..."</span><br /><br /> @ <span style="color: #000000;">0.5</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> oText <span style="color: #0000ff;">VAR</span> cMsg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">180</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> METER oMeter <span style="color: #0000ff;">VAR</span> nActual TOTAL <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">20</span><br /><br /> oDlg:<span style="color: #000000;">bStart</span>:=<span style="color: #000000;">{</span>||lval:= hb_UnZipFile<span style="color: #000000;">(</span>cFile,<span style="color: #000000;">{</span>|cFile,nPos|oText:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span><span style="color: #ff0000;">'Descomprimiendo'</span>+CRLF+cFile<span style="color: #000000;">)</span>,;<br /> nActual:=nPos/nFiles*<span style="color: #000000;">100</span>,oMeter:<span style="color: #000000;">Set</span><span style="color: #000000;">(</span>nActual<span style="color: #000000;">)</span><span style="color: #000000;">}</span>,,,cDestino <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>lval,<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">'Restauracion completada con éxito'</span>+CRLF+CRLF,<span style="color: #ff0000;">'Bielsys 2009'</span><span style="color: #000000;">)</span>,;<br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">'No se han podido restaurar los datos'</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,;<br /> oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span> <br /><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:14ouce3d]
el resultado también es negativo
El archivo que quiero descomprimir es el creado con la función hb_zipfile. Si uso el winrar los muestra perfectamente
utilizo xharbour 1.21 y bcc582
Gracias por su atención |
descomprimir archivo zip | Surgom:
Yo utilizo este código con xHarbour y FW0810 y va bien.
[code=fw:1sxrmrzj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*<br />* -------------------------------------------------------------------------*<br />* -------------------------------------------------------------------------*<br />*/</span><br /><span style="color: #00C800;">FUNCTION</span> Importar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> aFiles<br /><span style="color: #00C800;">LOCAL</span> aExtra := <span style="color: #000000;">{</span><span style="color: #ff0000;">""</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">LOCAL</span> lStatus<br /><span style="color: #00C800;">LOCAL</span> nVez := <span style="color: #000000;">0</span><br /><br />CursorWait<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />aFiles := hb_GetFilesInZip<span style="color: #000000;">(</span>cZipFile<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">FOR</span> nVez := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">(</span>aFiles<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> ALLTRIM<span style="color: #000000;">(</span>cFileExt<span style="color: #000000;">(</span>aFiles<span style="color: #000000;">[</span>nVez<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"ETI"</span><br /> AADD<span style="color: #000000;">(</span>aExtra,aFiles<span style="color: #000000;">[</span>nVez<span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br /><br />lStatus := hb_UnZipFile<span style="color: #000000;">(</span>cZipFile,,<span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span>,,cDirDest,aExtra,<span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">IF</span> lStatus<br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"El archivo se importó exitosamente !"</span>,oApp:<span style="color: #000000;">cAplicacion</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> </div>[/code:1sxrmrzj]
Saludos |
descomprimir archivo zip | Hola
revisa aqui <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
[url:2fzfsn7c]http://forums.fivetechsupport.com/viewtopic.php?f=6&t=26367[/url:2fzfsn7c]
Saluditos <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> |
descomprimir archivo zip | Aida
Yo también pase por lo mismo, y en el foro encontré respuestas, hice una pequeña variación que muestro y quedó así:
Descomprime(cFileZip,cPathDesempaque)
FUNCTION Descomprime(cFile,cPathDescarga)
LOCAL oDlg,nFiles,aFiles,oText, cMsg, oMeter,nActual:=0
DEFAULT cPathDescarga:="E:\"
IF FILE(cFIle)
aFiles:=hb_GetFilesInZip(cFile)
// aFiles:=hb_GetFilesInZip(cFile,.t.)
nFiles:=Len(hb_GetFilesInZip(cFile)) // [color=#FF0000:4ocmnqhi]yo hice esta variacion que quite el .t. y desempaca en cPathDescarga[/color:4ocmnqhi]
DEFINE DIALOG oDlg FROM 1, 1 TO 10, 60 TITLE "Espere ejecutando recuperación de datos..."
@ 0.5, 2 SAY oText VAR cMsg SIZE 180, 20 OF oDlg
@ 2, 2 METER oMeter VAR nActual TOTAL 100 OF oDlg SIZE 200, 20
oDlg:bStart:={||lVal:=Hb_UnZipFile(cFile,{|cFile,nPos|oText:SetText("Descomprimiendo"+CRLF+cFile),;
nActual:=nPos/nFiles*100,oMeter:Set(nActual)},.T.,,cPathDescarga,aFiles,NIL ),;
IF(lVal,MsgInfo("Restauracion completada con éxito"+CRLF+CRLF,cVersion),;
MsgStop("No se han podido restaurar los datos")),;
oDlg:END()}
ACTIVATE DIALOG oDlg CENTERED
ENDIF
RETURN NIL
Ojo: en tu fichero de enlace agrega : hbzip.lib y zlib.lib |
descomprimir archivo zip | Gracias a todos funciona bien, hoy iba a probar con poner el array de los archivos comprimidos, me pareció que por ahí iba el problema y Uds me los confirmaron.
Otra vez muchas gracias
Luis |
descomprimir directorios vacios | Hola.
TEngo un test.zip que contiene archivos y directorios, busque en el foro y vi este ejemplo:
[code=fw:309oe305]<div class="fw" id="{CB}" style="font-family: monospace;"> aFiles := hb_GetFilesInZip<span style="color: #000000;">(</span><span style="color: #ff0000;">"datos.zip"</span><span style="color: #000000;">)</span><br /> hb_unzipfile<span style="color: #000000;">(</span><span style="color: #ff0000;">"datos.zip"</span>,,.T.,,<span style="color: #ff0000;">"d:<span style="color: #000000;">\t</span>emporal"</span>,aFiles,<span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span></div>[/code:309oe305]
pero no me descomprime las carpetas vacias...
que hago mal?
gracias. |
descomprimir directorios vacios | <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=18033">viewtopic.php?f=3&t=18033</a><!-- l -->
<!-- m --><a class="postlink" href="http://www.44342.com/xharbour-f1105-t3089-p1.htm">http://www.44342.com/xharbour-f1105-t3089-p1.htm</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.pctoledo.com.br/forum/viewtopic.php?f=4&t=13030">http://www.pctoledo.com.br/forum/viewto ... =4&t=13030</a><!-- m -->
<!-- m --><a class="postlink" href="https://groups.google.com/forum/#!topic/comp.lang.xharbour/IYSDxx5PmaA">https://groups.google.com/forum/#!topic ... YSDxx5PmaA</a><!-- m -->
Saludos. |
descomprimir directorios vacios | la verdad que lei esos post pero no me solucionan el problema.
Descomprimo, pero no me descomprime las carpetas vacias.
gracias. |
descomprimir directorios vacios | Carpetas Vacias? No comprendo.
Pide a Carlos Vargas de Nicarágua el XBACKUPLITE de su autoria, excelente para Backups.
[code=fw:3vhqw3x9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*Procedimiento principal*/</span><br /><span style="color: #00C800;">FUNCTION</span> XBLITE<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//->MAIN()</span><br /><br /> MEMVAR cPRGPATH, cFILEPATH<br /><br /> cPRGPATH := cFILEPATH<span style="color: #000000;">(</span>GETMODULEFILENAME<span style="color: #000000;">(</span>GETINSTANCE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cPRGPATH := cShortName<span style="color: #000000;">(</span>cPRGPATH<span style="color: #000000;">)</span><br /><br /> XBACKUPLITE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> lCHDIR<span style="color: #000000;">(</span>cPRGPATH<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3vhqw3x9]
Saludos. |
descomprimir directorios vacios | [quote:leg5twzy]d:\
|
+- carpeta 2
| archiivo1
| archivo2
|
+ carpeta 3
+----- carpeta 4
|
|
[/quote:leg5twzy]
cuando se descomprime debe tener la estructura de arriba, carpeta 4 no contiene archivos pero igual debe de aparecer,
cuando uso ese ejemplo que puse mas arriba carpeta 4 no se crea, o sea, en el .zip existe esa carpeta pero no la descomprime |
descomprimir directorios vacios | Intenta asi:
[code=fw:3t6m1z1v]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> hb_unzipfile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"datos.zip"</span>,,.T.,,<span style="color: #ff0000;">"d:<span style="color: #000000;">\t</span>emporal"</span>, aFiles + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span> )<br /></span></div>[/code:3t6m1z1v]
Saludos. |
desconectarse de la red | Buen dia Foro.
tengo una duda y quiera saber si alguien tiene la solucion.
Estoy trabajando con un sistema que se conecta a un servidor , hasta aqui todo bien , las bases son del tipo mdb, y el motor
ADOBD El tema es que realizo conexion con cada maquina que trabaja en total son 250 y esto se pone muy lento.
La pregunta concreta es si no hay algo que cierre la cenxion, cuando uso oCone:Close() la conexion sigue abierta.
en algunos lenguajes existe una instruccion disconnect. si alguien sabe como hacerlo desde ya muchas gracias.
[code=fw:2pg0pbwe]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> oCone := CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ADODB.Connection"</span> <span style="color: #000000;">)</span><br /> oCone:<span style="color: #000000;">ConnectionString</span> := <span style="color: #ff0000;">"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=Data<span style="color: #000000;">\S</span>undmastert.mdb;Pwd="</span> + cPass<br /> oCone:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><br /> </div>[/code:2pg0pbwe] |
desconectarse de la red | juan
Ms Access connects very nicely using Ms Jet rather than ODBC. Ms Jet is the OleDb provider native to all Windows machines.
My suggestion is to create your initial connection like this :
[code=fw:3mhwd7r8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Local</span> xProvider,xSource,xPassword,xString,oConnect<br /><span style="color: #00C800;">Local</span> oRsStaff,oErr,cSql<br /><span style="color: #00C800;">Local</span> cDefa<br /><br /><span style="color: #00C800;">Public</span> oConnection<br /><br />cDefa := <span style="color: #ff0000;">"<span style="color: #000000;">\\</span>server<span style="color: #000000;">\v</span>olume<span style="color: #000000;">\s</span>hare"</span> <span style="color: #B900B9;">// just using a unc if you are not connecting to a local database</span><br /><br />xPROVIDER := <span style="color: #ff0000;">"Microsoft.Jet.OLEDB.4.0"</span> <span style="color: #B900B9;">// oledb provider for access</span><br />xSOURCE := cDEFA+<span style="color: #ff0000;">"<span style="color: #000000;">\Y</span>our.mdb"</span> <span style="color: #B900B9;">// path to access database including the database name </span><br />xPASSWORD := <span style="color: #ff0000;">"xxxxxxxx"</span> <span style="color: #B900B9;">// optional database password </span><br /><br />xSTRING := <span style="color: #ff0000;">'Provider='</span>+xPROVIDER+<span style="color: #ff0000;">';Data Source='</span>+xSOURCE+<span style="color: #ff0000;">';Jet OLEDB:Database Password='</span>+xPASSWORD <span style="color: #B900B9;">// connection string</span><br /><br /><br /><span style="color: #B900B9;">// create your global connection</span><br /><br />oConnect := CREATEOBJECT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ADODB.Connection"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">TRY</span><br /> oConnect:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> xString <span style="color: #000000;">)</span><br />CATCH oErr<br /> Saying := <span style="color: #ff0000;">"Could not open a Global Connection to Database "</span>+xSource<br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> Saying <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span><br />END <span style="color: #00C800;">TRY</span><br /><br /><span style="color: #B900B9;">// then use these parameters to open your record sets with the public connection object</span><br /><br />oRsStaff := TOleAuto<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">)</span><br />oRsStaff:<span style="color: #000000;">CursorType</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">// opendkeyset</span><br />oRsStaff:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// local cache</span><br />oRsStaff:<span style="color: #000000;">LockType</span> := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// lockoportunistic</span><br /><br />cSql := <span style="color: #ff0000;">"Select [StaffEid],[Lname],[Fname],[FullName],[Active] From [Staff] "</span><br />cSql += <span style="color: #ff0000;">"where [Active] = 'Y' Order by Fname,Lname"</span><br /><br /><span style="color: #00C800;">TRY</span><br /> oRsStaff:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> cSQL,oCONNECT <span style="color: #000000;">)</span><br />CATCH oErr<br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Error in Opening Staff table"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span><br />END <span style="color: #00C800;">TRY</span><br /><br /><span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">(</span> oRsStaff <span style="color: #000000;">)</span><br />oRsStaff:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:3mhwd7r8]
Now that you have your global connection you can open and close as many recordsets as you like throughout your program and the database will only see one connection.
Tip .. always use the local cache option for best performance.
Rick Lipkin |
descuentos en la adquisión de FiveWin para asistentes curso | Hola amigos.
[b:2t0dq0qj]Geroa Informatica, SL y Fivetech Software[/b:2t0dq0qj] en su afan de seguir promocionando el Fivewin y su formación en la comunidad han llegado a un acuerdo.
El presente acuerdo contempla que todo alumno que asista a los cursos de Formación de Fivewin que vamos a impartir el proximo mes de Mayo en San Sebastian gozaran de [b:2t0dq0qj]un descuento del 15%[/b:2t0dq0qj] en la compra de la libreria Fivewin (en cualquiera de sus versiones y actualizaciones).
La información de los cursos la teneis en esta URL
<!-- m --><a class="postlink" href="http://www.geroa-informatica.com/fivewin/cursos-fivewin-Mayo-2006.htm">http://www.geroa-informatica.com/fivewi ... o-2006.htm</a><!-- m --> |
desde archivo de recursos | Es un primer acercamiento que no tiene utilidad alguna pero seguro que podemos ir avanzando entre todos ...
Saludos.
[img:3mxq2ngo]http://img444.imageshack.us/img444/2594/screencaptureof.png[/img:3mxq2ngo] |
desde archivo de recursos | Manuel,
Lo has creado desde un NIB ? Eso es formidable! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Quedamos ansiosos por que nos muestres algo de código <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Aclaración para quienes lean esto:
Los ficheros NIB (Next Interface Builder) son equivalentes a los ficheros RC pero almacenan muchísima más información. Se contruyen con el programa "Interface Builder" que proporciona Apple.
La palabra "Next" y NS ("Next Step") provienen de los ordenadores que creó Steve Jobs cuando le "echaron" de Apple. Posteriormente Apple le compró su tecnología y se mantuvieron las siglas "NS" de "Next Step". Todo el API del Mac usa el prefijo "NS" de dichos ordenadores "Next Step" (siguiente paso). |
desde archivo de recursos | Efectivamente el panel esta construido con Interface builder y llamado desde codigo para mostrarse . El problema es que no consiguo cambiar las propiedades despues desde codigo ni llamar a los botones y sus acciones ( por lo menos de momento ) . Aunque si consiguo mostrarlo me parece que por donde he ido no es el camino .... Seguiré con ello .
La manera de hacerlo es crear un nib con una ventana yllamarla MainMenu .Colocarlo dentro de Contens-> resources->English.lproj.
Para llamarlo con esta simple funcion vale :
HB_FUNC( WINDOWCONTROLCREATE ) // hWnd
{
NSWindowController * mynibWindow = [[NSWindowController alloc]
initWithWindowNibName:@"MainMenu"];
// hb_retnl( ( LONG ) mynibwindow);
[mynibWindow showWindow: nil];
} |
desde archivo de recursos | Manuel,
Eso está super bien!!! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
El que no reaccione es normal porque hay que construir una clase controladora derivada que haremos que rute a FiveMac <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Tambien podemos hacer que el nombre del nib se reciba como parámetro.
Voy a probarlo! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
desde archivo de recursos | Manuel,
De momento las pruebas van muy bien, aunque aun no he conseguido acceder a los controles (y deberia haber podido).
Te muestro el codigo que estoy probando:
nibs.m
[code=fw:cr4sppe2]<div class="fw" id="{CB}" style="font-family: monospace;">#import <Cocoa/Cocoa.h><br /><span style="color: #00D7D7;">#define</span> HB_DONT_DEFINE_BOOL<br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br />@<span style="color: #00C800;">interface</span> WindowController : <span style="color: #000000;">NSWindowController</span><br /><span style="color: #000000;">{</span><br /><span style="color: #000000;">}</span><br />- <span style="color: #000000;">(</span> void <span style="color: #000000;">)</span> windowDidLoad;<br />@end<br /><br />@implementation WindowController<br /><br />- <span style="color: #000000;">(</span> void <span style="color: #000000;">)</span> windowDidLoad<br /><span style="color: #000000;">{</span><br /> NSArray * controls = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #00C800;">self</span> <span style="color: #0000ff;">window</span> <span style="color: #000000;">]</span> contentView <span style="color: #000000;">]</span> subviews <span style="color: #000000;">]</span>;<br /> int i;<br /> <br /> NSRunAlertPanel<span style="color: #000000;">(</span> @<span style="color: #ff0000;">"windowDidLoad"</span>, @<span style="color: #ff0000;">""</span>, @<span style="color: #ff0000;">"OK"</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> controls <span style="color: #0000ff;">count</span> <span style="color: #000000;">]</span> == <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> NSRunAlertPanel<span style="color: #000000;">(</span> @<span style="color: #ff0000;">"no hay controles"</span>, @<span style="color: #ff0000;">""</span>, @<span style="color: #ff0000;">"OK"</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>; <br /> <br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i = <span style="color: #000000;">0</span>; i < <span style="color: #000000;">[</span> controls <span style="color: #0000ff;">count</span> <span style="color: #000000;">]</span>; i++ <span style="color: #000000;">)</span><br /> NSRunAlertPanel<span style="color: #000000;">(</span> @<span style="color: #ff0000;">"control"</span>, @<span style="color: #ff0000;">""</span>, @<span style="color: #ff0000;">"OK"</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>; <br /> <br /><span style="color: #000000;">}</span><br /><br />@end<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WINDOWCONTROLLERCREATE <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * string = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSString alloc <span style="color: #000000;">]</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ? hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">]</span> autorelease <span style="color: #000000;">]</span>;<br /> WindowController * wndController = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> WindowController alloc <span style="color: #000000;">]</span> initWithWindowNibName : <span style="color: #000000;">string</span> <span style="color: #000000;">]</span>; <br /><br /> <span style="color: #000000;">[</span> wndController showWindow : <span style="color: #00C800;">nil</span> <span style="color: #000000;">]</span>;<br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> wndController <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /> </div>[/code:cr4sppe2]
En principio, deberiamos poder acceder a los controles con [ [ [ self window ] contentView ] subviews ], pero ese array esta vacio... |
desde archivo de recursos | El problema es que el dato window es nil... |
desde archivo de recursos | Este post soluciona el problema <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[url:1puil7j6]http://osdir.com/ml/cocoa-dev/2010-07/msg00252.html[/url:1puil7j6]
[quote:1puil7j6]Did you remember to hook up the window in the nib to File's Owner's
window outlet? Did you remember to change the class identity of File's
Owner to your NSWindowController subclass?[/quote:1puil7j6]
Explico aqui los pasos a hacer desde el Interface Builder:
1. Hacemos click en "File's owner":
[img:1puil7j6]http://img831.imageshack.us/img831/5503/screenshot20100718at110.png[/img:1puil7j6]
2. Le cambiamos su clase a "WindowController", que es la clase que tenemos definida en FiveMac:
[img:1puil7j6]http://img831.imageshack.us/img831/5892/screenshot20100718at110u.png[/img:1puil7j6]
3. Pulsamos sobre el circulo gris con la flechita a la derecha del nombre de la clase y nos lleva al inspector de classes. Desde alli establecemos su clase padre como NSWindowController:
[img:1puil7j6]http://img825.imageshack.us/img825/5503/screenshot20100718at110.png[/img:1puil7j6]
4. Como el "File's Owner" es ahora un objeto WindowController, derivado de NSWindowController, ya tiene el "outlet" window y es asignable! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
5. Pulsamos "control" en el teclado y con el boton izquierdo del ratón sacamos una línea de conexión desde el "File's Owner" a nuestra ventana:
[img:1puil7j6]http://img841.imageshack.us/img841/5551/conexion.png[/img:1puil7j6]
[img:1puil7j6]http://img825.imageshack.us/img825/4273/screenshot20100718at111.png[/img:1puil7j6]
Eso hará que el dato window de nuestro WindowController se asigne! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
desde archivo de recursos | ------ editado ----------
Llego tarde .... olvidar lo de abajo .
Antonio me he encotrado esto en cocoabuilders :
Cocoabuilder
cocoa xcode
NSWindowController window always nil?
*
Luc Vandal NSWindowController window always nil? Apr 25 2005, 16:41
Hi,
I can't figure out why [self window] always return nil, even if the
window has already been displayed. Am I missing something?
Thanks!
Luc
*
j o a r Re: NSWindowController window always nil? Apr 25 2005, 16:52
On 2005-04-25, at 16.41, Luc Vandal wrote:
> I can't figure out why [self window] always return nil, even if the
> window has already been displayed. Am I missing something?
Have you dragged the connection from the window controller (files
owner) and the window in the nib file?
j o a r
*
Luc Vandal Re: NSWindowController window always nil? SOLVED Apr 25 2005, 17:30
Yeah that was the problem... thanks! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
On 25-Apr-05, at 10:52 AM, j o a r wrote:
>
> On 2005-04-25, at 16.41, Luc Vandal wrote:
>
>> I can't figure out why [self window] always return nil, even if the
>> window has already been displayed. Am I missing something?
>
> Have you dragged the connection from the window controller (files
> owner) and the window in the nib file?
>
> j o a r
>
> show quoted text |
desde archivo de recursos | Manuel,
Si, es eso. Lo que pasa es que saber hacerlo paso a paso desde el Interface Builder tiene su truco, y lo más importante hay que cambiar la clase de "File's Owner" para que sea un NSWindowController y asi poder acceder al dato window desde Interface Builder <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Y aún podemos hacerlo mas simple! No necesitamos usar windowDidLoad pues la ventana se hace visible tan pronto como se accede al dato window de NSWindowController.
Asi que eliminamos nuestra clase derivada y usamos la estandard sin derivar! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[code=fw:12vbx5cf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WINDOWCONTROLLERCREATE <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * string = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSString alloc <span style="color: #000000;">]</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ? hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">]</span> autorelease <span style="color: #000000;">]</span>;<br /> NSWindowController * wndController = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSWindowController alloc <span style="color: #000000;">]</span> initWithWindowNibName : <span style="color: #000000;">string</span> <span style="color: #000000;">]</span>; <br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> wndController <span style="color: #0000ff;">window</span> <span style="color: #000000;">]</span> != <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span><br /> NSRunAlertPanel<span style="color: #000000;">(</span> @<span style="color: #ff0000;">"ventana accesible"</span>, @<span style="color: #ff0000;">""</span>, @<span style="color: #ff0000;">"OK"</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> wndController <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /> </div>[/code:12vbx5cf]
El siguiente paso es ver la forma de conectar los controles <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
desde archivo de recursos | Esta version ya muestra los nombres de las clases de los controles hijos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[code=fw:2jhn70t4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WINDOWCONTROLLERCREATE <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * string = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSString alloc <span style="color: #000000;">]</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ? hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">]</span> autorelease <span style="color: #000000;">]</span>;<br /> NSWindowController * wndController = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSWindowController alloc <span style="color: #000000;">]</span> initWithWindowNibName : <span style="color: #000000;">string</span> <span style="color: #000000;">]</span>; <br /> NSArray * controls = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> wndController <span style="color: #0000ff;">window</span> <span style="color: #000000;">]</span> contentView <span style="color: #000000;">]</span> subviews <span style="color: #000000;">]</span>;<br /> int i;<br /> <br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i = <span style="color: #000000;">0</span>; i < <span style="color: #000000;">[</span> controls <span style="color: #0000ff;">count</span> <span style="color: #000000;">]</span>; i++ <span style="color: #000000;">)</span><br /> NSRunAlertPanel<span style="color: #000000;">(</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> controls objectAtIndex : <span style="color: #000000;">i</span> <span style="color: #000000;">]</span> className <span style="color: #000000;">]</span>, @<span style="color: #ff0000;">""</span>, @<span style="color: #ff0000;">"OK"</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>; <br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> wndController <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /> </div>[/code:2jhn70t4]
[img:2jhn70t4]http://img836.imageshack.us/img836/1892/screenshot20100718at114.png[/img:2jhn70t4]
[img:2jhn70t4]http://img840.imageshack.us/img840/3334/screenshot20100718at115.png[/img:2jhn70t4] |
desde archivo de recursos | [img:1b1fu65a]http://img829.imageshack.us/img829/6917/screenshot20100718at120x.png[/img:1b1fu65a] |
desde archivo de recursos | Esto funciona sin problemas, ya cambia el titulo de la ventana :
[code=fw:2g3x9bkl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />NSWindowController * mynibWindow = <span style="color: #000000;">[</span><span style="color: #000000;">[</span>NSWindowController alloc<span style="color: #000000;">]</span> initWithWindowNibName:@<span style="color: #ff0000;">"MainMenu"</span><span style="color: #000000;">]</span>; <br /> <span style="color: #000000;">[</span>mynibWindow showWindow: <span style="color: #00C800;">nil</span><span style="color: #000000;">]</span>;<br /> NSWindow * ventana = <span style="color: #000000;">[</span>mynibWindow <span style="color: #0000ff;">window</span><span style="color: #000000;">]</span> ; <br /> <span style="color: #000000;">[</span> ventana setTitle: @<span style="color: #ff0000;">"Hola"</span> <span style="color: #000000;">]</span> ; <br /><br /> </div>[/code:2g3x9bkl] |
desde archivo de recursos | Bueno, a falta de que replanteemos como se van a rutar los eventos, aqui tenemos una primera versión que ya procesa el "click" del botón <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[code=fw:29va15xc]<div class="fw" id="{CB}" style="font-family: monospace;">#import <Cocoa/Cocoa.h><br /><span style="color: #00D7D7;">#define</span> HB_DONT_DEFINE_BOOL<br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #B900B9;">// NSView * GetView( NSWindow * window );</span><br /><br />@<span style="color: #00C800;">interface</span> WindowController : <span style="color: #000000;">NSWindowController</span><br /><span style="color: #000000;">{</span><br /><span style="color: #000000;">}</span><br />- <span style="color: #000000;">(</span> void <span style="color: #000000;">)</span> BtnClick : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br />@end<br /><br />@implementation WindowController<br /><br />- <span style="color: #000000;">(</span> void <span style="color: #000000;">)</span> BtnClick : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br /><span style="color: #000000;">{</span><br /> NSRunAlertPanel<span style="color: #000000;">(</span> @<span style="color: #ff0000;">"click"</span>, @<span style="color: #ff0000;">""</span>, @<span style="color: #ff0000;">"OK"</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /><br />@end<br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WINDOWCONTROLLERCREATE <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * string = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSString alloc <span style="color: #000000;">]</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ? hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">]</span> autorelease <span style="color: #000000;">]</span>;<br /> WindowController * wndController = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> WindowController alloc <span style="color: #000000;">]</span> initWithWindowNibName : <span style="color: #000000;">string</span> <span style="color: #000000;">]</span>; <br /> NSArray * controls = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> wndController <span style="color: #0000ff;">window</span> <span style="color: #000000;">]</span> contentView <span style="color: #000000;">]</span> subviews <span style="color: #000000;">]</span>;<br /> int i;<br /> <br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i = <span style="color: #000000;">0</span>; i < <span style="color: #000000;">[</span> controls <span style="color: #0000ff;">count</span> <span style="color: #000000;">]</span>; i++ <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSControl * control = <span style="color: #000000;">[</span> controls objectAtIndex : <span style="color: #000000;">i</span> <span style="color: #000000;">]</span>;<br /> NSString * className = <span style="color: #000000;">[</span> control className <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> className isEqual : @<span style="color: #ff0000;">"NSButton"</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSButton * <span style="color: #0000ff;">button</span> = <span style="color: #000000;">(</span> NSButton * <span style="color: #000000;">)</span> control;<br /> <br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">button</span> setAction : @selector<span style="color: #000000;">(</span> BtnClick: <span style="color: #000000;">)</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span> <br /> <span style="color: #000000;">}</span> <br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> wndController <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /> </div>[/code:29va15xc]
[img:29va15xc]http://img31.imageshack.us/img31/2562/screenshot20100718at123.png[/img:29va15xc] |
desde archivo de recursos | La manera de distinguir los distintos objetos del view es mediante sus tags :
[code=fw:37k46xcu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <br /> NSView * myview = <span style="color: #000000;">[</span>ventana contentView <span style="color: #000000;">]</span> ;<br /> <br /> <span style="color: #000000;">[</span><span style="color: #000000;">[</span>myview viewWithTag :<span style="color: #000000;">255</span> <span style="color: #000000;">]</span> setTitle: @<span style="color: #ff0000;">"Hola"</span> <span style="color: #000000;">]</span> ; <br /><br /> </div>[/code:37k46xcu]
Al boton le he puesto el tag 255 y le he cambiado el titulo . FUNCIONA .Ya tenemos como acceder al estilo RC. |
desde archivo de recursos | FUNCIONA :
[code=fw:1672z8to]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <br /> NSView * myview = <span style="color: #000000;">[</span>ventana contentView <span style="color: #000000;">]</span> ;<br /> <br /> <span style="color: #000000;">[</span><span style="color: #000000;">[</span>myview viewWithTag :<span style="color: #000000;">255</span> <span style="color: #000000;">]</span> setTitle: @<span style="color: #ff0000;">"Hola"</span> <span style="color: #000000;">]</span> ; <br /> <br /> NSButton * boton = <span style="color: #000000;">(</span> NSButton * <span style="color: #000000;">)</span> <span style="color: #000000;">[</span>myview viewWithTag :<span style="color: #000000;">255</span> <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #000000;">[</span> boton setAction : @selector<span style="color: #000000;">(</span> BtnClick: <span style="color: #000000;">)</span> <span style="color: #000000;">]</span>; <br /> </div>[/code:1672z8to]
[img:1672z8to]http://img27.imageshack.us/img27/3958/screencapturekf.png[/img:1672z8to] |
desde archivo de recursos | Manuel,
Super bien! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
El tag lo podemos usar como el equivalente del nId de los controles de FiveWin <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Ando pensando ahora como hacer todo esto genérico, e implementar el REDEFINE de FiveWin |
desde archivo de recursos | en dos funciones:
[code=fw:s3o97hk7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WINDOWCONTROLCREATE <span style="color: #000000;">)</span> <span style="color: #B900B9;">// hWnd</span><br /><span style="color: #000000;">{</span><br /> WindowController * mynibWindow = <span style="color: #000000;">[</span><span style="color: #000000;">[</span>WindowController alloc<span style="color: #000000;">]</span> <br /> initWithWindowNibName:@<span style="color: #ff0000;">"MainMenu"</span><span style="color: #000000;">]</span>; <br /> <br /> <br /> <span style="color: #000000;">[</span>mynibWindow showWindow: <span style="color: #00C800;">nil</span><span style="color: #000000;">]</span>; <br /> <br /> NSWindow * ventana = <span style="color: #000000;">[</span>mynibWindow <span style="color: #0000ff;">window</span><span style="color: #000000;">]</span> ; <br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> ventana <span style="color: #000000;">)</span>; <br /> <br /><span style="color: #000000;">}</span> <br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> LLAMABOTON <span style="color: #000000;">)</span> <span style="color: #B900B9;">// hWnd</span><br /><span style="color: #000000;">{</span><br /> <br /> NSWindow * ventana = <span style="color: #000000;">(</span> NSWindow * <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> NSView * myview = <span style="color: #000000;">[</span>ventana contentView <span style="color: #000000;">]</span> ;<br /> <br /> NSButton * boton = <span style="color: #000000;">(</span> NSButton * <span style="color: #000000;">)</span> <span style="color: #000000;">[</span>myview viewWithTag : <span style="color: #000000;">hb_parnl</span><span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">]</span>; <br /> <br /> <span style="color: #000000;">[</span>boton setTitle : @<span style="color: #ff0000;">"LA monda"</span> <span style="color: #000000;">]</span>; <br /> <br /> <br /><span style="color: #000000;">}</span> <br /><br /><br /> </div>[/code:s3o97hk7] |
desde archivo de recursos | Manuel,
Vamos acercándonos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Mira este código que ya está funcionando. Ahora creamos un objeto TWindow real! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Aún faltan cosas, pero poquito a poco. Voy a subir este build para que podamos trabajar sobre lo mismo.
samples/testnib.prg
[code=fw:2pko6161]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> <br /> @ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Another"</span> <span style="color: #0000ff;">ACTION</span> Another<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Another<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd<br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HudWindow"</span><br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /> </div>[/code:2pko6161] |
desde archivo de recursos | Manuel,
Voy a salir ahora con la familia, pero te cuento la que estoy liando <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
He cogido el prototipo de la Clase View en windows.m y lo he copiado a nibs.m y ahora le asigno un View de los "nuestros" a la ventana del recurso.
Esta funcionando bien, lo único es que ahora pierdo lo controles al cambiar el View. Deberiamos ver si hay una forma de portar los controles de un NSView a otro como hacemos en Windows con SetParent() <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Luego seguimos... |
desde archivo de recursos | Esto funciona ya, pero como te digo hay que buscar la forma de pasar los controles de un view a otro:
Fijate que uso automaticamente el evento ON CLICK y accedo al titulo con oWnd:SetText(). Es un objeto TWindow real <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[code=fw:ucyn5l09]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> <br /> @ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Another"</span> <span style="color: #0000ff;">ACTION</span> Another<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Another<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd<br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HudWindow"</span><br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> oWnd:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> Time<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// MsgInfo( "click" )</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /> </div>[/code:ucyn5l09] |
desde archivo de recursos | Copio aqui el código y me voy ya <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
nibs.m
[code=fw:3u31u5k2]<div class="fw" id="{CB}" style="font-family: monospace;">#import <Cocoa/Cocoa.h><br /><span style="color: #00D7D7;">#define</span> HB_DONT_DEFINE_BOOL<br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #B900B9;">// NSView * GetView( NSWindow * window );</span><br /><br />@<span style="color: #00C800;">interface</span> View : <span style="color: #000000;">NSView</span><br /><span style="color: #000000;">{</span><br /> @<span style="color: #00C800;">public</span> NSWindow * hWnd; <br /><span style="color: #000000;">}</span><br />- <span style="color: #000000;">(</span>BOOL<span style="color: #000000;">)</span> windowShouldClose : <span style="color: #000000;"><span style="color: #000000;">(</span></span> NSNotification * <span style="color: #000000;">)</span> notification;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> windowWillClose: <span style="color: #000000;"><span style="color: #000000;">(</span></span> NSNotification * <span style="color: #000000;">)</span> notification;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> mouseDown : <span style="color: #000000;"><span style="color: #000000;">(</span></span> NSEvent * <span style="color: #000000;">)</span> theEvent;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> mouseMoved : <span style="color: #000000;"><span style="color: #000000;">(</span></span> NSEvent * <span style="color: #000000;">)</span> theEvent;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> keyDown : <span style="color: #000000;"><span style="color: #000000;">(</span></span> NSEvent * <span style="color: #000000;">)</span> theEvent;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> <span style="color: #0000ff;">MenuItem</span> : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> BtnClick : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> CbxChange : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> ChkClick : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> RadClick : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> TbrClick : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> OnTimerEvent : <span style="color: #000000;"><span style="color: #000000;">(</span></span> NSTimer * <span style="color: #000000;">)</span> <span style="color: #0000ff;">timer</span>;<br />- <span style="color: #000000;">(</span>void<span style="color: #000000;">)</span> SliderChanged : <span style="color: #000000;"><span style="color: #000000;">(</span></span><span style="color: #0000ff;">id</span><span style="color: #000000;">)</span> sender;<br />@end<br /><br />@<span style="color: #00C800;">interface</span> WindowController : <span style="color: #000000;">NSWindowController</span><br /><span style="color: #000000;">{</span><br /><span style="color: #000000;">}</span><br />- <span style="color: #000000;">(</span> void <span style="color: #000000;">)</span> BtnClick : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br />@end<br /><br />@implementation WindowController<br /><br />- <span style="color: #000000;">(</span> void <span style="color: #000000;">)</span> BtnClick : <span style="color: #000000;"><span style="color: #000000;">(</span></span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">)</span> sender;<br /><span style="color: #000000;">{</span><br /> NSRunAlertPanel<span style="color: #000000;">(</span> @<span style="color: #ff0000;">"click"</span>, @<span style="color: #ff0000;">""</span>, @<span style="color: #ff0000;">"OK"</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /><br />@end<br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WNDFROMNIB <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * string = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSString alloc <span style="color: #000000;">]</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ? hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">]</span> autorelease <span style="color: #000000;">]</span>;<br /> WindowController * wndController = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> WindowController alloc <span style="color: #000000;">]</span> initWithWindowNibName : <span style="color: #000000;">string</span> <span style="color: #000000;">]</span>; <br /> NSWindow * <span style="color: #0000ff;">window</span> = <span style="color: #000000;">[</span> wndController <span style="color: #0000ff;">window</span> <span style="color: #000000;">]</span>;<br /> NSArray * controls = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> contentView <span style="color: #000000;">]</span> subviews <span style="color: #000000;">]</span>;<br /> int i;<br /> View * view = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> View alloc <span style="color: #000000;">]</span> <span style="color: #0000ff;">init</span> <span style="color: #000000;">]</span>;<br /><br /> view->hWnd = <span style="color: #0000ff;">window</span>;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> setContentView : <span style="color: #000000;">view</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> setDelegate : <span style="color: #000000;">view</span> <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i = <span style="color: #000000;">0</span>; i < <span style="color: #000000;">[</span> controls <span style="color: #0000ff;">count</span> <span style="color: #000000;">]</span>; i++ <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSControl * control = <span style="color: #000000;">[</span> controls objectAtIndex : <span style="color: #000000;">i</span> <span style="color: #000000;">]</span>;<br /> NSString * className = <span style="color: #000000;">[</span> control className <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> className isEqual : @<span style="color: #ff0000;">"NSButton"</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSButton * <span style="color: #0000ff;">button</span> = <span style="color: #000000;">(</span> NSButton * <span style="color: #000000;">)</span> control;<br /> <br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">button</span> setAction : @selector<span style="color: #000000;">(</span> BtnClick: <span style="color: #000000;">)</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span> <br /> <span style="color: #000000;">}</span> <br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> <span style="color: #0000ff;">window</span> <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /> </div>[/code:3u31u5k2] |
desde archivo de recursos | A lo mejor es tan facil como pasar de un View a otro:
[code=fw:3f64ayjc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WNDFROMNIB <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * string = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSString alloc <span style="color: #000000;">]</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ? hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">]</span> autorelease <span style="color: #000000;">]</span>;<br /> NSWindowController * wndController = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSWindowController alloc <span style="color: #000000;">]</span> initWithWindowNibName : <span style="color: #000000;">string</span> <span style="color: #000000;">]</span>; <br /> NSWindow * <span style="color: #0000ff;">window</span> = <span style="color: #000000;">[</span> wndController <span style="color: #0000ff;">window</span> <span style="color: #000000;">]</span>;<br /> NSArray * controls = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> contentView <span style="color: #000000;">]</span> subviews <span style="color: #000000;">]</span>;<br /> int i;<br /> View * view = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> View alloc <span style="color: #000000;">]</span> <span style="color: #0000ff;">init</span> <span style="color: #000000;">]</span>;<br /><br /> view->hWnd = <span style="color: #0000ff;">window</span>;<br /> <br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i = <span style="color: #000000;">0</span>; i < <span style="color: #000000;">[</span> controls <span style="color: #0000ff;">count</span> <span style="color: #000000;">]</span>; i++ <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSControl * control = <span style="color: #000000;">[</span> controls objectAtIndex : <span style="color: #000000;">i</span> <span style="color: #000000;">]</span>;<br /> NSString * className = <span style="color: #000000;">[</span> control className <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> className isEqual : @<span style="color: #ff0000;">"NSButton"</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSButton * <span style="color: #0000ff;">button</span> = <span style="color: #000000;">(</span> NSButton * <span style="color: #000000;">)</span> control;<br /> <br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">button</span> setAction : @selector<span style="color: #000000;">(</span> BtnClick: <span style="color: #000000;">)</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span> <br /> <br /> <span style="color: #000000;">[</span> control retain <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span> view addSubview : <span style="color: #000000;">control</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span> control removeFromSuperview <span style="color: #000000;">]</span>; <br /> <span style="color: #000000;">}</span> <br /> <br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> setContentView : <span style="color: #000000;">view</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> setDelegate : <span style="color: #000000;">view</span> <span style="color: #000000;">]</span>; <br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> <span style="color: #0000ff;">window</span> <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /> </div>[/code:3f64ayjc]
Segun esta documentación, se podría hacer:
[url:3f64ayjc]http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/occ/instm/NSView/removeFromSuperview[/url:3f64ayjc]
pero algo debo estar haciendo mal, y tengo que volver a irme otra vez <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
desde archivo de recursos | Si no entiendo mal el codigo lo que intentas es quedarte con la ventana y una vez la tienes crear nuestro propio view de codigo y ir insertandole los controles copiados del view del nib . ¿No ?
¿ Puede ser que al remover los objetos si estas procesando el nsview "primario" se carge los demas objetos ? . |
desde archivo de recursos | Manuel,
Si, esa es la idea. La cuestion es comprobar si falla por eso y ver una forma de solucionarlo.
Tal vez exista un método para clonar un objeto... |
desde archivo de recursos | Tras un montón de pruebas, asi si deja hacerlo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[code=fw:1yh6s7rw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WNDFROMNIB <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * string = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSString alloc <span style="color: #000000;">]</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ? hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">]</span> autorelease <span style="color: #000000;">]</span>;<br /> NSWindowController * wndController = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSWindowController alloc <span style="color: #000000;">]</span> initWithWindowNibName : <span style="color: #000000;">string</span> <span style="color: #000000;">]</span>; <br /> NSWindow * <span style="color: #0000ff;">window</span> = <span style="color: #000000;">[</span> wndController <span style="color: #0000ff;">window</span> <span style="color: #000000;">]</span>;<br /> NSArray * controls = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> contentView <span style="color: #000000;">]</span> subviews <span style="color: #000000;">]</span>;<br /> View * view = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> View alloc <span style="color: #000000;">]</span> <span style="color: #0000ff;">init</span> <span style="color: #000000;">]</span>;<br /><br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> setContentView : <span style="color: #000000;">view</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> setDelegate : <span style="color: #000000;">view</span> <span style="color: #000000;">]</span>;<br /> view->hWnd = <span style="color: #0000ff;">window</span>;<br /> <br /> <span style="color: #00C800;">while</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> controls <span style="color: #0000ff;">count</span> <span style="color: #000000;">]</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSControl * control = <span style="color: #000000;">[</span> controls objectAtIndex : <span style="color: #000000;">0</span> <span style="color: #000000;">]</span>;<br /> NSString * className = <span style="color: #000000;">[</span> control className <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #000000;">[</span> view addSubview : <span style="color: #000000;">control</span> <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> className isEqual : @<span style="color: #ff0000;">"NSButton"</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSButton * <span style="color: #0000ff;">button</span> = <span style="color: #000000;">(</span> NSButton * <span style="color: #000000;">)</span> control;<br /> <br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">button</span> setAction : @selector<span style="color: #000000;">(</span> BtnClick: <span style="color: #000000;">)</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span> <br /> <span style="color: #000000;">}</span> <br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> <span style="color: #0000ff;">window</span> <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /> </div>[/code:1yh6s7rw]
Ahora hay que comprobar que el mensaje llegue bien... |
desde archivo de recursos | Los mensajes llegan bien <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Ahora hay que implementar los REDEFINEs...
[img:gore3n8m]http://img443.imageshack.us/img443/2408/screenshot20100718at104.png[/img:gore3n8m] |
desde archivo de recursos | Otra opcion que me funcionaba era :
[code=fw:2076wgbt]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> WNDFROMNIB <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * string = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSString alloc <span style="color: #000000;">]</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ? hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">]</span> autorelease <span style="color: #000000;">]</span>;<br /> NSWindowController * wndController = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> NSWindowController alloc <span style="color: #000000;">]</span> initWithWindowNibName : <span style="color: #000000;">string</span> <span style="color: #000000;">]</span>;<br /> NSWindow * <span style="color: #0000ff;">window</span> = <span style="color: #000000;">[</span> wndController <span style="color: #0000ff;">window</span> <span style="color: #000000;">]</span>;<br /> NSView * myview = <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> contentView <span style="color: #000000;">]</span> ;<br /> NSArray * controls = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> contentView <span style="color: #000000;">]</span> subviews <span style="color: #000000;">]</span>;<br /> View * view = <span style="color: #000000;">[</span> <span style="color: #000000;">[</span> View alloc <span style="color: #000000;">]</span> <span style="color: #0000ff;">init</span> <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> setContentView : <span style="color: #000000;">view</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">window</span> setDelegate : <span style="color: #000000;">view</span> <span style="color: #000000;">]</span>;<br /> view->hWnd = <span style="color: #0000ff;">window</span>;<br /> <br /> <span style="color: #000000;">[</span> view addSubview : <span style="color: #000000;">myview</span> <span style="color: #000000;">]</span>;<br /><br /> <span style="color: #00C800;">while</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> controls <span style="color: #0000ff;">count</span> <span style="color: #000000;">]</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSControl * control = <span style="color: #000000;">[</span> controls objectAtIndex : <span style="color: #000000;">0</span> <span style="color: #000000;">]</span>;<br /> NSString * className = <span style="color: #000000;">[</span> control className <span style="color: #000000;">]</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">[</span> className isEqual : @<span style="color: #ff0000;">"NSButton"</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> NSButton * <span style="color: #0000ff;">button</span> = <span style="color: #000000;">(</span> NSButton * <span style="color: #000000;">)</span> control;<br /> <br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">button</span> setAction : @selector<span style="color: #000000;">(</span> BtnClick: <span style="color: #000000;">)</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span> <br /> <span style="color: #000000;">}</span> <br /> <br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> <span style="color: #0000ff;">window</span> <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /> </div>[/code:2076wgbt] |
desde archivo de recursos | Ya está funcionando el REDEFINE BUTTON ... y ya está publicado el nuevo build <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Este código ya funciona:
[code=fw:3qfa8gwz]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">ID</span> <span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Button click!"</span> <span style="color: #000000;">)</span><br /> </div>[/code:3qfa8gwz]
[img:3qfa8gwz]http://img837.imageshack.us/img837/6361/screenshot20100719at147.png[/img:3qfa8gwz] |
desde archivo de recursos | Hombre, dificil seguirlos
Aun asi me da gusto que se este avanzando pronto.
Saludos
Osvaldo Ramirez |
desde archivo de recursos | REDEFINE GET ... ya está funcionando. Nuevo build disponible. El ejemplo TestNib.prg lo usa <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
La única observación es que una vez puesto un NSTextField en la ventana del NIB, hay que cambiarle el nombre de su Clase a Get para que use la de FiveMac que intercepta los eventos que necesitamos (modificación y perdida foco).
[img:bd56vv04]http://img62.imageshack.us/img62/1218/screenshot20100719at656.png[/img:bd56vv04] |
desde archivo de recursos | la magia de fivewin con la magia de Interface builder juntos .....
[url:2v3mlnw9]http://rapidshare.com/files/407756804/testnibweb.zip[/url:2v3mlnw9]
Ni una linea de codigo de mas .....
[code=fw:2v3mlnw9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oWnd<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> @ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Another"</span> <span style="color: #0000ff;">ACTION</span> Another<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Another<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oWnd, oGet, cText := <span style="color: #ff0000;">"Hello world"</span>, oBtn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"MainMenu"</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /> </div>[/code:2v3mlnw9]
[img:2v3mlnw9]http://img841.imageshack.us/img841/6687/screencaptured.png[/img:2v3mlnw9] |
desde archivo de recursos | Manuel,
Muy bueno! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Las acciones de los botones las estas definiendo directamente desde el NIB (supongo, no lo he mirado aun) <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
desde archivo de recursos | REDEFINE CHECKBOX ... ya está funcionando. Nuevo build disponible <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
desde archivo de recursos | [quote="Antonio Linares":3ivv9229]Manuel,
Muy bueno! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Las acciones de los botones las estas definiendo directamente desde el NIB (supongo, no lo he mirado aun) <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:3ivv9229]
Si efectivamente , a lo Mac arrastrar y soltar ,ni una sola linea de codigo escrito y toda la operatividad funcionando . |
design clausole | When I use design clausole for a controls sample: Tsay
the dots not are showed normally but the are moved to up or to down od object
For me they must be show over the object for a sample :
[img:1ya9ul85]http://www.iispascalcomiforti.it/wp-content/uploads/2016/12/io.jpg[/img:1ya9ul85]
I saw on ER run ok perhaps ER use a differents control class ? also the dots are different ..how create the controls dots as ER ? |
design clausole | Silvio,
Are you using a MDI child window ? Or is it a dialog or a window ?
In FWH 16.11 there has been a fix for MDI childs about this |
design clausole | Sorry on Dialog and on tpanel |
design clausole | Silvio,
Could you provide a small and self contained PRG example of how you are doing it ? thanks |
design clausole | see here
[code=fw:22u9jvpl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">680</span>,<span style="color: #000000;">520</span> ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"test"</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> paintdata<span style="color: #000000;">(</span>oDlg<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Function</span> Paint_data<span style="color: #000000;">(</span>oWnd <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> cfoto := <span style="color: #ff0000;">"dip.bmp"</span><br /> <span style="color: #00C800;">Local</span> oImg<br /><br />@ <span style="color: #000000;">13</span>, <span style="color: #000000;">12</span> BITMAP oImg FILENAME cFoto <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">96</span>,<span style="color: #000000;">115</span> NOBORDER DESIGN<br /><br /> oImg:<span style="color: #000000;">lTransparent</span>:=.t.<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:22u9jvpl] |
design clausole | Silvio,
I have modified samples\design.prg to add support for bitmaps and it is working fine:
[url:1wxx01ut]https://bitbucket.org/fivetech/fivewin-contributions/downloads/design.zip[/url:1wxx01ut] |
design clausole | why there are that two dlls ? |
design clausole | i tried to make a dialog
the bitmaps dots run ok
when I compile the test dialog ...
the dialog is not also as I design it
perhaps the ccordinates of controls are bad builded |
design clausole | Silvio,
> why there are that two dlls ?
because design.prg uses function SourceEdit() that uses Scintilla.
Right click on the dialog and select "PRG code..." |
design clausole | [quote="Silvio.Falconi":1krygrvz]i tried to make a dialog
the bitmaps dots run ok
when I compile the test dialog ...
the dialog is not also as I design it
perhaps the ccordinates of controls are bad builded[/quote:1krygrvz]
Please provide an example to test.
You may modify design.prg |
design clausole | Antonio,
[b:1p1s6hi9]Designed[/b:1p1s6hi9]
[img:1p1s6hi9]http://www.iispascalcomiforti.it/wp-content/uploads/2016/12/designed.jpg[/img:1p1s6hi9]
[b:1p1s6hi9]scintilla[/b:1p1s6hi9]
[img:1p1s6hi9]http://www.iispascalcomiforti.it/wp-content/uploads/2016/12/prg_source.jpg[/img:1p1s6hi9]
[b:1p1s6hi9]the code saved[/b:1p1s6hi9]
[code=fw:1p1s6hi9]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><br /><span style="color: #00C800;">function</span> BuildWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBtn1, oBtn2, oSay, oSay, oGet, cGet := Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span>, oGet, cGet := Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span>, oSay, oGet, cGet := Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oBrush<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">(</span> <span style="color: #000000;">240</span>, <span style="color: #000000;">240</span>, <span style="color: #000000;">240</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dialog designer"</span> ;<br /> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">21</span>, <span style="color: #000000;">103</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">41</span>, <span style="color: #000000;">167</span> ;<br /> <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br /> @ <span style="color: #000000;">120</span>, <span style="color: #000000;">152</span> <span style="color: #0000ff;">BUTTON</span> oBtn1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Ok"</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Not defined yet!"</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">120</span>, <span style="color: #000000;">196</span> <span style="color: #0000ff;">BUTTON</span> oBtn2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Cancel"</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Not defined yet!"</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">40</span>, <span style="color: #000000;">48</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"First : "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">64</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">72</span>, <span style="color: #000000;">48</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Last : "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">64</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">32</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cGet <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">136</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">64</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cGet <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">136</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">104</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Address : "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">64</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">96</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cGet <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">352</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">4</span>, <span style="color: #000000;">4</span> GROUP oGrp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Customer "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">240</span>, <span style="color: #000000;">64</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /><span style="color: #00C800;">return</span> oDlg</div>[/code:1p1s6hi9]
[b:1p1s6hi9]compiled[/b:1p1s6hi9]
[img:1p1s6hi9]http://www.iispascalcomiforti.it/wp-content/uploads/2016/12/compiled.jpg[/img:1p1s6hi9]
I ask and notice this error allready last year |
design clausole | Silvio,
Fixed in FWH 16.12
many thanks
Please download design.zip again:
[url:2fc36n4c]https://bitbucket.org/fivetech/fivewin-contributions/downloads/design.zip[/url:2fc36n4c] |
design clausole | Now it seem ok it can be a valid help for our work
[b:2g4x1344]THE CODE[/b:2g4x1344]
[code=fw:2g4x1344]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><br /><span style="color: #00C800;">function</span> BuildWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBtn1, oBtn2, oSay1, oSay2, oGet1, cGet1 := Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span>,;<br /> oGet2, cGet2 := Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span>, ;<br /> oGet3, cGet3 := Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span>, ;<br /> oSay3<br /> <span style="color: #00C800;">local</span> oBrush<br /><br /> * <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">(</span> <span style="color: #000000;">240</span>, <span style="color: #000000;">240</span>, <span style="color: #000000;">240</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Customer"</span> ;<br /> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">24</span>, <span style="color: #000000;">88</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">44</span>, <span style="color: #000000;">152</span> ;<br /> <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br /> @ <span style="color: #000000;">120</span>, <span style="color: #000000;">152</span> <span style="color: #0000ff;">BUTTON</span> oBtn1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Ok"</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Not defined yet!"</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">120</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">BUTTON</span> oBtn2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Cancel"</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Not defined yet!"</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">16</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">SAY</span> oSay1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Cognome :"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">32</span>, <span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">28</span>, <span style="color: #000000;">28</span> <span style="color: #0000ff;">SAY</span> oSay2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Nome :"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">32</span>, <span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">12</span>, <span style="color: #000000;">64</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">VAR</span> cGet1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">68</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">28</span>, <span style="color: #000000;">64</span> <span style="color: #0000ff;">GET</span> oGet2 <span style="color: #0000ff;">VAR</span> cGet2 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">68</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">44</span>, <span style="color: #000000;">64</span> <span style="color: #0000ff;">GET</span> oGet3 <span style="color: #0000ff;">VAR</span> cGet3 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">164</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">48</span>, <span style="color: #000000;">28</span> <span style="color: #0000ff;">SAY</span> oSay3 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"indirizzo : "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">32</span>, <span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">4</span>, <span style="color: #000000;">4</span> GROUP oGrp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Group"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">240</span>, <span style="color: #000000;">68</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg TRANSPARENT<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /><span style="color: #00C800;">return</span> oDlg<br /> </div>[/code:2g4x1344]
Only there are something to correct :
1. if the command Group is at last then I not see any control perhaps need the clausole transparent
i TRIED WITH @ 4, 4 GROUP oGrp PROMPT "Group" SIZE 240, 68 PIXEL OF oDlg TRANSPARENT
2. whe n I insert a new control of Say then the design save a list of oSay ( oSay,oSay,oSay) and this is made also with cGet and oGet . On source I correct the variables..I made a modify on design.prg ( can send you at private emails?)
I use : @ nRow, nCol SAY oSay PROMPT GetNewPrompt( "TSay" ) OF oDlgIde SIZE 70, 20 PIXEL DESIGN
3. On design when I nove a control to put near a get control is too hard - or up or down - with mouse is too hard to move the control perhaps you can found a solution the final user can work good for a sample I tried to size a get at init 24 then 16 I cannot put the size 20 - perhaps you can insert this possibility to set the size as ribbon design ( do you remember?) where I can use the cursor key to size the control.
4. the grid can be modify ? or create a zoom of form to see goo all control
5. if I click "Bring on the front" then I cannot modify it
6. you can insert the possibility to set fonts,colors
7. you can insert the type of Tget ( normal get , get spinner get Memo )
8. then need the other class tFolder,Tfolderex, btnbmp,datepick,getspinner,getmemo,xbrowse
[code=fw:2g4x1344]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00C800;">function</span> CreateFolder<span style="color: #000000;">(</span> oDlgIde, nRow, nCol <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oFld<br /> @ <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span>, <span style="color: #ff0000;">"three"</span> <span style="color: #0000ff;">OF</span> oDlgIde <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">220</span>, <span style="color: #000000;">136</span> DESIGN<br /> oFld:<span style="color: #000000;">bRClicked</span> = <span style="color: #000000;">{</span> | nRow, nCol | EditFolder<span style="color: #000000;">(</span> nRow, nCol,oFld <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oFld:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /> <span style="color: #00C800;">function</span> CreateFolderEX<span style="color: #000000;">(</span> oDlgIde, nRow, nCol <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oFld<br /> @ <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span> FOLDEREX oFld <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span>, <span style="color: #ff0000;">"three"</span> <span style="color: #0000ff;">OF</span> oDlgIde <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">136</span>, <span style="color: #000000;">120</span> DESIGN<br /> oFld:<span style="color: #000000;">bRClicked</span> = <span style="color: #000000;">{</span> | nRow, nCol | EditControl<span style="color: #000000;">(</span> oFld, nRow, nCol,<span style="color: #ff0000;">"FOLDEREX"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oFld:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #00C800;">Function</span> CreateButtonBmp<span style="color: #000000;">(</span> oDlgIde, nRow, nCol <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oBtnBmp<br /> @ nRow, nCol <span style="color: #0000ff;">BTNBMP</span> oBtnBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Button"</span> <span style="color: #0000ff;">OF</span> oDlgIde <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">PIXEL</span> DESIGN<br /> oBtnBmp:<span style="color: #000000;">bRClicked</span> = <span style="color: #000000;">{</span> | nRow, nCol | EditControl<span style="color: #000000;">(</span> oBtnBmp, nRow, nCol,<span style="color: #ff0000;">"BTNBMP"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> * oBtnP:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> <span style="color: #00C800;">Function</span> CreateDatePick<span style="color: #000000;">(</span>oDlgIde, nRow, nCol <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oDatePick<br /> <span style="color: #00C800;">Local</span> cDate:=date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span> DTPICKER oDatePick <span style="color: #0000ff;">var</span> cDate <span style="color: #0000ff;">OF</span> oDlgIde <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">22</span> <span style="color: #0000ff;">PIXEL</span> DESIGN<br /> oDatePick:<span style="color: #000000;">bRClicked</span> = <span style="color: #000000;">{</span> | nRow, nCol | EditControl<span style="color: #000000;">(</span>oDatePick, nRow, nCol,<span style="color: #ff0000;">"DATEPICK"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oDatePick:<span style="color: #000000;">setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> CreateGetSpinner<span style="color: #000000;">(</span>oDlgIde <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oGet, cVar := Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">OF</span> oDlgIde SPINNER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">136</span>, <span style="color: #000000;">25</span> DESIGN<br /> oGet:<span style="color: #000000;">bRClicked</span> = <span style="color: #000000;">{</span> | nRow, nCol | EditControl<span style="color: #000000;">(</span> oGet, nRow, nCol,<span style="color: #ff0000;">"GET"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oGet:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oGet:<span style="color: #000000;">nheight</span>:=<span style="color: #000000;">21.4</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------------//</span><br /> <span style="color: #00C800;">function</span> CreateGetMEmo<span style="color: #000000;">(</span> oDlgIde <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oGet, cVar := Space<span style="color: #000000;">(</span> <span style="color: #000000;">20</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">OF</span> oDlgIde MULTILINE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">136</span>, <span style="color: #000000;">80</span> DESIGN<br /> oGet:<span style="color: #000000;">bRClicked</span> = <span style="color: #000000;">{</span> | nRow, nCol | EditControl<span style="color: #000000;">(</span> oGet, nRow, nCol,<span style="color: #ff0000;">"GET"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oGet:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Function</span> CreateXbrowse<span style="color: #000000;">(</span>oDlgIde<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oBrw<br /> @ <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlgIde <span style="color: #0000ff;">size</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">100</span> DESIGN<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">bRClicked</span> = <span style="color: #000000;">{</span> | nRow, nCol | EditControl<span style="color: #000000;">(</span>oBrw, nRow, nCol,<span style="color: #ff0000;">"XBROWSE"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /> </div>[/code:2g4x1344]
I had made also the possibilty to insert controls on tfolder
[img:2g4x1344]http://www.iispascalcomiforti.it/wp-content/uploads/2016/12/gg.jpg[/img:2g4x1344]
the possibility to insert items on listbox
[img:2g4x1344]http://www.iispascalcomiforti.it/wp-content/uploads/2016/12/li.jpg[/img:2g4x1344]
change position and size ( visual)
[img:2g4x1344]http://www.iispascalcomiforti.it/wp-content/uploads/2016/12/position-and-size.jpg[/img:2g4x1344] |
design reports with WORD | Hello Friends,
Here you see the printout of HTML Report / i zi pi zi / from a WORD-designed report.
Documentation
[url:2hqi6x3i]https://winhotel.space/htmlreport/htmlreport.html[/url:2hqi6x3i]
[img:2hqi6x3i]https://winhotel.space/htmlreport/data/doc_23_bild_44492.99.png[/img:2hqi6x3i]
Best regards,
Otto |
design reports with WORD | Hello Friends,
Here you see the printout of HTML Report / i zi pi zi / from a WORD-designed report.
Documentation
[url:368hv79d]https://winhotel.space/htmlreport/htmlreport.html[/url:368hv79d]
[img:368hv79d]https://winhotel.space/htmlreport/data/doc_23_bild_44492.99.png[/img:368hv79d]
Best regards,
Otto |
design reports with WORD | Dear Otto,
Good job.
It's support FWH? |
design reports with WORD | Hello Richard,
Yes, sure. It is FIVEWIN and Fivewin-ActiceX class.
I am doing right now some test reopening the report files with Microsoft WORD.
As we use WORD daily it would be best for me to use WORD as a designer.
I noticed that I must be carefully not to have space character inside the placeholder.
Best regards,
Otto |
design reports with WORD | [quote="Otto":3svzfo7w]Hello Richard,
Yes, sure. It is FIVEWIN and Fivewin-ActiceX class.
I am doing right now some test reopening the report files with Microsoft WORD.
As we use WORD daily it would be best for me to use WORD as a designer.
I noticed that I must be carefully not to have space character inside the placeholder.
Best regards,
Otto[/quote:3svzfo7w]
Sounds good.
Maybe you can design it for Excel. |
design reports with WORD | Hello Richard,
can you please post a sketch of what you want to do? Maybe it is possible.
Best regards,
Otto |
design reports with WORD | Video showing how I use WORD for report design.
[url:5yj3jg3n]https://mybergland.com/fwforum/wordreport.mp4[/url:5yj3jg3n] |
design reports with WORD | Video showing how I use WORD for report design.
[url:2r7ibc1m]https://mybergland.com/fwforum/wordreport.mp4[/url:2r7ibc1m] |
design reports with WORD | [quote="Otto":h5jjvi7i]Hello Richard,
can you please post a sketch of what you want to do? Maybe it is possible.
Best regards,
Otto[/quote:h5jjvi7i]
Ex. Quotation form.
Customer data
Product data
Count price and total price
remark data |
design reports with WORD | Hello Richard,
I tried to find a solution to programmatically insert, or edit, a pie chart in a Word document from EXCEL?
But I can't fine out how OLE works.
In my case, the chart is converted in an image and if I change the EXCEL file the image is not updated.
Do you have a solution for this?
Maybe as a workaround we can open WORD programmatically after the values in EXCEL are changed and confirm somehow the question if the OLE object should be updated.
Please see the gif.
[img:1yf10yo5]https://mybergland.com/fwforum/wordupdate.gif[/img:1yf10yo5]
Best regards,
Otto |
design reports with WORD | Richard, I've thought again now.
But I think it is best to use the FIVEWIN class for now. I think otherwise you get lost in the detail.
Best regards,
Otto |
design reports with WORD | [quote="Otto":3bkbe5vm]Richard, I've thought again now.
But I think it is best to use the FIVEWIN class for now. I think otherwise you get lost in the detail.
Best regards,
Otto[/quote:3bkbe5vm]
Yes, I think so. |
design.prg from FW samples | Hello Antonio,
do you think it is possible to make design.prg from the Fivewin samples transparent.
This way we could place design.exe over an existing WINDOW/DIALOG like a layer in AUTOCAD and could use it to position new controls.
Then the source code provided from design.exe could be inserted into the own prg.
This way much time would be saved.
Best regards,
Otto |
design.prg from FW samples | Otto,
In design.prg please make this change:
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( [b:2nkv39zu]oDlg:nOpacity := 150[/b:2nkv39zu], PlaceControl( oDlg ) ) ;
ON PAINT If( lDesign, DrawGrid( oDlg:hWnd, hDC, cPS, 8, 8 ),) ;
ON RIGHT CLICK EditDialog( nRow, nCol, oDlg ) |
design.prg from FW samples | Dear Antonio,
this is working fine.
Now I drag the transparent designer over my program. Then I insert the controls
I want.
With AUTOCODE I do the fine tuning.
Antonio, how can I get the same coordinates independent it I use in my program dialogs or windows.
Can I use TRUEPIXEL setup in desgner.exe for that.
Thank you and best regards,
Otto
[img:3v4xgnpx]http://www.atzwanger-software.com/fw/autocodedesignClip1.jpg[/img:3v4xgnpx]
[img:3v4xgnpx]http://www.atzwanger-software.com/fw/autocodedesignClip2.jpg[/img:3v4xgnpx]
[img:3v4xgnpx]http://www.atzwanger-software.com/fw/autocodedesignClip3.jpg[/img:3v4xgnpx]
[img:3v4xgnpx]http://www.atzwanger-software.com/fw/autocodedesignClip4.jpg[/img:3v4xgnpx] |
design.prg from FW samples | Otto,
I have to check if METHODs cGenPrg() are respecting the TRUEPIXEL status |
design.prg from FW samples | [quote="Otto":4tnzghr4]Dear Antonio,
this is working fine.
Now I drag the transparent designer over my program. Then I insert the controls
I want.
[/quote:4tnzghr4]
Otto,
Could you please post the code that is working for a dialog, Folderex ?? It would indeed help for position controls.
The grid like Silvio's sample would be great ))
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=41532">viewtopic.php?f=3&t=41532</a><!-- l -->
Thanks |
design.prg from FW samples | [quote="Marc Venken":3dho79i1][quote="Otto":3dho79i1]Dear Antonio,
this is working fine.
Now I drag the transparent designer over my program. Then I insert the controls
I want.
[/quote:3dho79i1]
Otto,
Could you please post the code that is working for a dialog, Folderex ?? It would indeed help for position controls.
The grid like Silvio's sample would be great ))
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=41532">viewtopic.php?f=3&t=41532</a><!-- l -->
Thanks[/quote:3dho79i1]
I started from [b:3dho79i1]testprn2.prg[/b:3dho79i1] and it draw a grid into[b:3dho79i1] printer not screen[/b:3dho79i1]
perhaps for the screen you can use this ( I coied it from forum many year ago )
It is as DrawGrid( oDlg:hWnd, hDC, cPS, 8, 8 )
[code=fw:3dho79i1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><span style="color: #00D7D7;">#include</span> <Windows.h><br /><span style="color: #00D7D7;">#include</span> <HbApi.h><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> DRAWGRID <span style="color: #000000;">)</span> <span style="color: #B900B9;">// hWnd, hDC, @cPS, wGridX, wGridY</span><br /><span style="color: #000000;">{</span><br /> WORD wRow, wCol;<br /> HDC hDC = <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> PAINTSTRUCT * ps = <span style="color: #000000;">(</span> PAINTSTRUCT * <span style="color: #000000;">)</span> hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>;<br /> WORD wGridX = hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>;<br /> WORD wGridY = hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span>;<br /> RECT rc;<br /> WORD wWidth, wHeight;<br /><br /> HPEN hOldPen;<br /> HPEN hGray = CreatePen<span style="color: #000000;">(</span> PS_SOLID, <span style="color: #000000;">0</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">210</span>, <span style="color: #000000;">210</span>, <span style="color: #000000;">210</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> HPEN hGray2 = CreatePen<span style="color: #000000;">(</span> PS_SOLID, <span style="color: #000000;">0</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">230</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">230</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><br /> hOldPen = <span style="color: #000000;">(</span> HPEN <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> hDC, hGray <span style="color: #000000;">)</span>;<br /><br /> GetWindowRect<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HWND <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, &rc <span style="color: #000000;">)</span>;<br /> wWidth = rc.<span style="color: #0000ff;">right</span> - rc.<span style="color: #0000ff;">left</span> + <span style="color: #000000;">1</span>;<br /> wHeight = rc.bottom - rc.top + <span style="color: #000000;">1</span>;<br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> wRow = <span style="color: #000000;">0</span>; wRow <= wHeight; wRow += wGridX <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> MoveTo<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">0</span>, wRow <span style="color: #000000;">)</span>;<br /> LineTo<span style="color: #000000;">(</span> hDC, wWidth, wRow <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> wCol = <span style="color: #000000;">0</span>; wCol <= wWidth; wCol += wGridY <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> MoveTo<span style="color: #000000;">(</span> hDC, wCol, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /> LineTo<span style="color: #000000;">(</span> hDC, wCol, wHeight <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">}</span><br /><br /> SelectObject<span style="color: #000000;">(</span> hDC, hGray2 <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> wRow = wGridX/<span style="color: #000000;">2</span>; wRow <= wHeight; wRow += wGridX <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> MoveTo<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">0</span>, wRow <span style="color: #000000;">)</span>;<br /> LineTo<span style="color: #000000;">(</span> hDC, wWidth, wRow <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> wCol = wGridY/<span style="color: #000000;">2</span>; wCol <= wWidth; wCol += wGridY <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> MoveTo<span style="color: #000000;">(</span> hDC, wCol, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /> LineTo<span style="color: #000000;">(</span> hDC, wCol, wHeight <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">}</span><br /><br /> SelectObject<span style="color: #000000;">(</span> hDC, hOldPen <span style="color: #000000;">)</span>;<br /> DeleteObject<span style="color: #000000;">(</span> hGray <span style="color: #000000;">)</span>;<br /> DeleteObject<span style="color: #000000;">(</span> hGray2<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//SetPixel( hDC, wCol, wRow, 0 );</span><br /><span style="color: #000000;">}</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:3dho79i1] |
design.prg from FW samples | @Marc Venken
There is a free and very useful screen ruler you might try at [url:1sdkij5m]https://www.heise.de/download/product/jr-screen-ruler-7558[/url:1sdkij5m] |
design.prg from FW samples | or there is a class ...
you can create a new dialog class ( from Tdialog) or a easy class and insert two data
DATA oHRule
DATA oVRule
[b:1ru9r7wf]SAMPLE[/b:1ru9r7wf]
DEFINE oWnd.....
oClient := TPanelEx():New( oBar:nHeight()-1, oPanel:nWidth+5 , 100, 230, oWnd, rgb(173,197,229) )
oMyDialog := TMyObject():New( 35,31, 550, 784, oClient )
oMyDialog:oHRule := TC5Rule():New( 4, 30, 2000, 30, oClient, CLR_BLACK, rgb(173,197,229), .f.,oMyDialog )
oMyDialog:oVRule := TC5Rule():New( 34, 0, 30, 2000, oClient, CLR_BLACK, rgb(173,197,229), .t., oMyDialog )
oClient:bResized := {|| oMyDialog:SetSize( oClient:nWidth-35,oClient:nHeight-35,.t.),;
oMyDialog:oHRule:SetSize( oClient:nWidth-35,oMyDialog:oHRule:nHeight,.t. ),;
oMyDialog:oVRule:SetSize( oMyDialog:oVRule:nWidth,oClient:nHeight-35,.t. ) }
[b:1ru9r7wf]the class[/b:1ru9r7wf]
[code=fw:1ru9r7wf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><br /><span style="color: #00D7D7;">#define</span> HORZSIZE <span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> VERTSIZE <span style="color: #000000;">6</span><br /><span style="color: #00D7D7;">#define</span> HORZRES <span style="color: #000000;">8</span><br /><span style="color: #00D7D7;">#define</span> VERTRES <span style="color: #000000;">10</span><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSX <span style="color: #000000;">88</span><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSY <span style="color: #000000;">90</span><br /><br /><br /><br /><span style="color: #00C800;">CLASS</span> TC5Rule <span style="color: #0000ff;">FROM</span> TControl<br /><br /> <span style="color: #00C800;">DATA</span> oLinked<br /> <span style="color: #00C800;">DATA</span> nOffset AS NUMERIC <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> lVertical AS LOGICAL <span style="color: #0000ff;">INIT</span> .F.<br /> <span style="color: #00C800;">DATA</span> nGuia AS NUMERIC <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> hBmpMem<br /> <span style="color: #00C800;">DATA</span> nInit AS NUMERIC <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> aGuias AS ARRAY <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> CLASSDATA lRegistered AS LOGICAL<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> nTop, nLeft, nWidth, nHeight, oWnd, nClrText, nClrPane, lVertical, oLinked <span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> DeleteObject<span style="color: #000000;">(</span>::<span style="color: #000000;">hBmpMem</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">super</span>:<span style="color: #000000;">Destroy</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">Display</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">BeginPaint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,::<span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,::<span style="color: #000000;">EndPaint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> MakeRule<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> LButtonDown <span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> MouseMove<span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetCoords<span style="color: #000000;">(</span> nGuia <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Resize<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">MakeRule</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br />******************************************************************************************************************<br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> nTop, nLeft, nWidth, nHeight, oWnd, nClrText, nClrPane, lVertical, oLinked <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TC5Rule<br />******************************************************************************************************************<br /><br /> <span style="color: #00C800;">if</span> nClrText == <span style="color: #00C800;">nil</span> ; nClrText := CLR_BLACK ; <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> nClrPane == <span style="color: #00C800;">nil</span> ; nClrpane := CLR_WHITE ; <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> lVertical == <span style="color: #00C800;">nil</span> ; lVertical := .t. ; <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oWnd</span> := oWnd<br /> ::<span style="color: #000000;">nTop</span> := nTop<br /> ::<span style="color: #000000;">nLeft</span> := nLeft<br /> ::<span style="color: #000000;">nBottom</span> := ::<span style="color: #000000;">nTop</span> + nHeight<br /> ::<span style="color: #000000;">nRight</span> := ::<span style="color: #000000;">nLeft</span> + nWidth<br /> ::<span style="color: #000000;">nClrText</span> := nClrText<br /> ::<span style="color: #000000;">nClrPane</span> := nClrPane<br /> ::<span style="color: #000000;">oLinked</span> := oLinked<br /> ::<span style="color: #000000;">lVertical</span> := lVertical<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lVertical</span><br /> ::<span style="color: #000000;">nInit</span> := ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">nInit</span> := ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">nStyle</span> := nOR<span style="color: #000000;">(</span> WS_CHILD, WS_VISIBLE, WS_TABSTOP <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">nId</span> := ::<span style="color: #000000;">GetNewId</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">Register</span><span style="color: #000000;">(</span> nOr<span style="color: #000000;">(</span> CS_VREDRAW, CS_HREDRAW <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">Create</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">lVisible</span> = .t.<br /> oWnd:<span style="color: #000000;">AddControl</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> oWnd:<span style="color: #000000;">DefControl</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">lVisible</span> = .f.<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">self</span><br /><br /><br />******************************************************************************************************************<br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TC5Rule<br />******************************************************************************************************************<br /><span style="color: #00C800;">local</span> rc := GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> n, nLen<br /><span style="color: #00C800;">local</span> oFont, hOldFont<br /><span style="color: #00C800;">local</span> nT,nL<br /><br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">hBmpMem</span> == <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">MakeRule</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><br />DrawBitmap<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">hBmpMem</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">lVertical</span><br /><br /> Moveto<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, rc<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, ::<span style="color: #000000;">nGuia</span>+::<span style="color: #000000;">nOffset</span> <span style="color: #000000;">)</span><br /> Lineto<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, rc<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>, ::<span style="color: #000000;">nGuia</span>+::<span style="color: #000000;">nOffset</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">else</span><br /><br /> Moveto<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">nGuia</span>+::<span style="color: #000000;">nOffset</span> , rc<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> Lineto<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">nGuia</span>+::<span style="color: #000000;">nOffset</span> , rc<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">endif</span><br /><br />nLen := len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aGuias</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> nLen > <span style="color: #000000;">0</span><br /> oFont := TFont<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Marlett"</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">-18</span>, .f., .f.,<span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, .f., .f.,.f., <span style="color: #000000;">1</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>, ,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> hOldFont := SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, oFont:<span style="color: #000000;">hFont</span> <span style="color: #000000;">)</span><br /> SetBkMode<span style="color: #000000;">(</span>::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> SetTextColor<span style="color: #000000;">(</span>::<span style="color: #000000;">hDC</span>, CLR_HBLUE <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lVertical</span><br /> <span style="color: #00C800;">For</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br /> nT := <span style="color: #000000;">(</span>::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>+vMM2Pix<span style="color: #000000;">(</span>::<span style="color: #000000;">aGuias</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>*::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><br /> nL := <span style="color: #000000;">18</span><br /> TextOut<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nT<span style="color: #000000;">-8</span> , nL, chr<span style="color: #000000;">(</span>0x34<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">For</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br /> nT := <span style="color: #000000;">18</span><br /> nL := <span style="color: #000000;">(</span>::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>+hMM2Pix<span style="color: #000000;">(</span>::<span style="color: #000000;">aGuias</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>*::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><br /> TextOut<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nT, nL<span style="color: #000000;">-8</span>, chr<span style="color: #000000;">(</span>0x36<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> <span style="color: #00C800;">endif</span><br /> SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hOldFont <span style="color: #000000;">)</span><br /> oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br />***********************************************************************************************************************************<br /> <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TC5Rule<br />***********************************************************************************************************************************<br /><br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br /> <span style="color: #00C800;">case</span> nMsg == <span style="color: #000000;">20</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">1</span><br /><span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">super</span>:<span style="color: #000000;">HandleEvent</span><span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><br /><br />***********************************************************************************************************************************<br /> <span style="color: #00C800;">METHOD</span> MakeRule<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TC5Rule<br />***********************************************************************************************************************************<br /><span style="color: #00C800;">local</span> hDC := CreateDC<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DISPLAY"</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> hDCMem<br /><span style="color: #00C800;">local</span> hOldBmp<br /><span style="color: #00C800;">local</span> rc := GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> n<br /><span style="color: #00C800;">local</span> nCount := <span style="color: #000000;">-1</span><br /><span style="color: #00C800;">local</span> nCount2 := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> nCount3 := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> hres := GetDeviceCaps<span style="color: #000000;">(</span>hdc,HORZRES<span style="color: #000000;">)</span> <span style="color: #B900B9;">// {display width in pixels}</span><br /><span style="color: #00C800;">local</span> vres := GetDeviceCaps<span style="color: #000000;">(</span>hdc,VERTRES<span style="color: #000000;">)</span> <span style="color: #B900B9;">// {display height in pixels}</span><br /><span style="color: #00C800;">local</span> hsiz := GetDeviceCaps<span style="color: #000000;">(</span>hdc,HORZSIZE<span style="color: #000000;">)</span> <span style="color: #B900B9;">// {display width in mm}</span><br /><span style="color: #00C800;">local</span> vsiz := GetDeviceCaps<span style="color: #000000;">(</span>hdc,VERTSIZE<span style="color: #000000;">)</span> <span style="color: #B900B9;">// {display height in mm}</span><br /><span style="color: #00C800;">local</span> HPixByMM := <span style="color: #000000;">(</span>hres/hsiz <span style="color: #000000;">)</span> * ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span> <span style="color: #B900B9;">// pixels hay en un mm horizontal</span><br /><span style="color: #00C800;">local</span> VPixByMM := <span style="color: #000000;">(</span>vres/vsiz <span style="color: #000000;">)</span> * ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span> <span style="color: #B900B9;">// pixels hay en un mm vertical</span><br /><span style="color: #00C800;">local</span> oFont, hOldFont<br /><span style="color: #00C800;">local</span> nW := rc<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>-rc<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /><span style="color: #00C800;">local</span> nH := rc<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>-rc<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /><span style="color: #00C800;">local</span> nVIni := - ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> * ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><br /><span style="color: #00C800;">local</span> nHIni := - ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> * ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><br /><span style="color: #00C800;">local</span> nT, nL<br /><span style="color: #00C800;">local</span> nMM<br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">hBmpMem</span> != <span style="color: #00C800;">nil</span><br /> DeleteObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBmpMem</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><br />hDCMem := CreateCompatibleDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br />::<span style="color: #000000;">hBmpMem</span> := CreateCompatibleBitmap<span style="color: #000000;">(</span> hDC, nW, nH <span style="color: #000000;">)</span><br />hOldBmp := SelectObject<span style="color: #000000;">(</span> hDCMem, ::<span style="color: #000000;">hBmpMem</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">lVertical</span><br /> HorizontalGradient<span style="color: #000000;">(</span> hDCMem, rc, ::<span style="color: #000000;">nClrPane</span> , CLR_WHITE <span style="color: #000000;">)</span><br /><span style="color: #00C800;">else</span><br /> VerticalGradient <span style="color: #000000;">(</span> hDCMem, rc , CLR_WHITE, ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">nGuia</span> < <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nGuia</span> := <span style="color: #000000;">3</span><br /><span style="color: #00C800;">endif</span><br /><br />SetBkMode<span style="color: #000000;">(</span> hDCMem, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Tahoma"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-10</span> <span style="color: #B900B9;">//NESCAPEMENT 900</span><br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">lVertical</span><br /><br /> nMM := nVIni/VPixByMM<br /> nCount := <span style="color: #000000;">-1</span><br /> nCount2 := <span style="color: #000000;">(</span><span style="color: #000000;">(</span><span style="color: #000000;">(</span>::<span style="color: #000000;">nInit</span>-::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>* ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><span style="color: #000000;">)</span>/VPixByMM<span style="color: #000000;">)</span>%<span style="color: #000000;">10</span> <span style="color: #000000;">-1</span><br /> nCount3 := <span style="color: #000000;">(</span><span style="color: #000000;">(</span><span style="color: #000000;">(</span>::<span style="color: #000000;">nInit</span>-::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>* ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><span style="color: #000000;">)</span>/VPixByMM<span style="color: #000000;">)</span>%<span style="color: #000000;">5</span> <span style="color: #000000;">-1</span><br /><br /> <span style="color: #00C800;">for</span> n := nVIni <span style="color: #0000ff;">to</span> nH + nVIni step VPixByMM<br /><br /> nCount ++<br /> nCount2 ++<br /> nCount3 ++<br /> nMM++<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span> >= <span style="color: #000000;">60</span> .or. <span style="color: #000000;">(</span> nCount2 >= <span style="color: #000000;">10</span> <span style="color: #000000;">)</span><br /> Moveto<span style="color: #000000;">(</span> hDCMem, <span style="color: #000000;">0</span> , nCount * VPixByMM <span style="color: #000000;">)</span><br /> Lineto<span style="color: #000000;">(</span> hDCMem, <span style="color: #000000;">10</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nCount3 >= <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nCount * VPixByMM <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> nCount3 >= <span style="color: #000000;">5</span>; nCount3 := <span style="color: #000000;">0</span>; <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> nCount2 >= <span style="color: #000000;">10</span><br /> nCount2 := <span style="color: #000000;">0</span><br /> hOldFont := SelectObject<span style="color: #000000;">(</span> hDCMem, oFont:<span style="color: #000000;">hFont</span> <span style="color: #000000;">)</span><br /> TextOut<span style="color: #000000;">(</span> hDCMem, nCount * VPixByMM, <span style="color: #000000;">15</span>, alltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>nMM/<span style="color: #000000;">10</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> hDCMem, hOldFont <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">next</span><br /> Moveto<span style="color: #000000;">(</span> hDCMem, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Lineto<span style="color: #000000;">(</span> hDCMem, <span style="color: #000000;">0</span>, rc<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> Moveto<span style="color: #000000;">(</span> hDCMem, rc<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><span style="color: #000000;">-1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Lineto<span style="color: #000000;">(</span> hDCMem, rc<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><span style="color: #000000;">-1</span>, rc<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">else</span><br /><br /> nMM := nHIni/HPixByMM<br /> nCount := <span style="color: #000000;">-1</span><br /> nCount2 := <span style="color: #000000;">(</span><span style="color: #000000;">(</span><span style="color: #000000;">(</span>::<span style="color: #000000;">nInit</span>-::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>* ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><span style="color: #000000;">)</span>/HPixByMM<span style="color: #000000;">)</span>%<span style="color: #000000;">10</span><br /> nCount3 := <span style="color: #000000;">(</span><span style="color: #000000;">(</span><span style="color: #000000;">(</span>::<span style="color: #000000;">nInit</span>-::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>* ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><span style="color: #000000;">)</span>/HPixByMM<span style="color: #000000;">)</span>%<span style="color: #000000;">5</span><br /><br /> <span style="color: #00C800;">for</span> n := nHIni <span style="color: #0000ff;">to</span> nW+nHIni step HPixByMM<br /><br /> nCount ++<br /> nCount2 ++<br /> nCount3 ++<br /> nMM++<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span> >= <span style="color: #000000;">60</span> .or. <span style="color: #000000;">(</span> nCount2 >= <span style="color: #000000;">10</span> <span style="color: #000000;">)</span><br /> Moveto<span style="color: #000000;">(</span> hDCMem, nCount * HPixByMM, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Lineto<span style="color: #000000;">(</span> hDCMem, nCount * HPixByMM, <span style="color: #000000;">10</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nCount3 >= <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> nCount3 >= <span style="color: #000000;">5</span>; nCount3 := <span style="color: #000000;">0</span>; <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> nCount2 >= <span style="color: #000000;">10</span><br /> nCount2 := <span style="color: #000000;">0</span><br /> hOldFont := SelectObject<span style="color: #000000;">(</span> hDCMem, oFont:<span style="color: #000000;">hFont</span> <span style="color: #000000;">)</span><br /> TextOut<span style="color: #000000;">(</span> hDCMem, <span style="color: #000000;">15</span>, nCount * HPixByMM, alltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>nMM/<span style="color: #000000;">10</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> hDCMem, hOldFont <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">next</span><br /> Moveto<span style="color: #000000;">(</span> hDCMem, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Lineto<span style="color: #000000;">(</span> hDCMem, rc<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Moveto<span style="color: #000000;">(</span> hDCMem, <span style="color: #000000;">0</span>, rc<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><span style="color: #000000;">-1</span> <span style="color: #000000;">)</span><br /> Lineto<span style="color: #000000;">(</span> hDCMem, rc<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>, rc<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><span style="color: #000000;">-1</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><br />SelectObject<span style="color: #000000;">(</span> hDCMem, hOldBmp <span style="color: #000000;">)</span><br />DeleteDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br />DeleteDC<span style="color: #000000;">(</span> hDCMem <span style="color: #000000;">)</span><br /><br /><br />oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br />***********************************************************************************************************************************<br /> <span style="color: #00C800;">METHOD</span> LButtonDown <span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TC5Rule<br />***********************************************************************************************************************************<br /><span style="color: #00C800;">local</span> nMM<br /><span style="color: #00C800;">local</span> n<br /><span style="color: #00C800;">local</span> nLen := len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aGuias</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//nRow := nRow * 100 / ::oLinked:nZoom</span><br /><span style="color: #B900B9;">//nCol := nCol * 100 / ::oLinked:nZoom</span><br /><br /><span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br /> <span style="color: #00C800;">if</span> PtInRect<span style="color: #000000;">(</span> nRow, nCol, ::<span style="color: #000000;">GetCoords</span><span style="color: #000000;">(</span>n<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> adel<span style="color: #000000;">(</span> ::<span style="color: #000000;">aGuias</span>, n <span style="color: #000000;">)</span><br /> asize<span style="color: #000000;">(</span> ::<span style="color: #000000;">aGuias</span>, nLen<span style="color: #000000;">-1</span><span style="color: #000000;">)</span><br /> ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oLinked</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span><br /><br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">lVertical</span><br /> nMM := vPix2MM<span style="color: #000000;">(</span>nRow*::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nInvRatio</span><span style="color: #000000;">)</span> - vPix2MM<span style="color: #000000;">(</span>::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">else</span><br /> nMM := hPix2MM<span style="color: #000000;">(</span>nCol*::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nInvRatio</span><span style="color: #000000;">)</span> - hPix2MM<span style="color: #000000;">(</span>::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><br /><br />aadd<span style="color: #000000;">(</span> ::<span style="color: #000000;">aGuias</span>, nMM <span style="color: #000000;">)</span><br /><br />::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />::<span style="color: #000000;">oLinked</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">0</span><br /><br />***********************************************************************************************************************************<br /> <span style="color: #00C800;">METHOD</span> MouseMove<span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TC5Rule<br />***********************************************************************************************************************************<br /><span style="color: #00C800;">local</span> n<br /><span style="color: #00C800;">local</span> nLen := len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aGuias</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> nFind := <span style="color: #000000;">0</span><br /><br /><span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br /> <span style="color: #00C800;">if</span> PtInRect<span style="color: #000000;">(</span> nRow, nCol, ::<span style="color: #000000;">GetCoords</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nFind := n<br /> exit<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">if</span> nFind == <span style="color: #000000;">0</span><br /> CursorArrow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">else</span><br /> CursorHand<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br />***********************************************************************************************************************************<br /> <span style="color: #00C800;">METHOD</span> GetCoords<span style="color: #000000;">(</span> nGuia <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TC5Rule<br />***********************************************************************************************************************************<br /><span style="color: #00C800;">local</span> n<br /><span style="color: #00C800;">local</span> nT, nL<br /><br /><span style="color: #00C800;">if</span> nGuia > len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aGuias</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">{</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">lVertical</span><br /> nT := <span style="color: #000000;">(</span>::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>+vMM2Pix<span style="color: #000000;">(</span>::<span style="color: #000000;">aGuias</span><span style="color: #000000;">[</span>nGuia<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>*::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><br /> nL := <span style="color: #000000;">18</span><br /><span style="color: #00C800;">else</span><br /> nT := <span style="color: #000000;">18</span><br /> nL := <span style="color: #000000;">(</span>::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">aCoords</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>+hMM2Pix<span style="color: #000000;">(</span>::<span style="color: #000000;">aGuias</span><span style="color: #000000;">[</span>nGuia<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>*::<span style="color: #000000;">oLinked</span>:<span style="color: #000000;">nZoom</span>/<span style="color: #000000;">100</span><br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">{</span>nT,nL,nT<span style="color: #000000;">+10</span>,nL<span style="color: #000000;">+10</span><span style="color: #000000;">}</span></div>[/code:1ru9r7wf] |
design.prg from FW samples | Thanks.. The ruler works..
The class : I have to explore... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.