topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
que lib tiene la funcion isEmpty? | [quote="goosfancito":13ffhget]Eso.
Gracias.[/quote:13ffhget]Goos,de xharbour,hb_isnull()hb_isnil() |
que motor puedo usar de datos? | Hola.
Estoy desarrollando una aplicacion basica y necesitaría utilizar una base de datos, la aplicacion esta creada en windows y va a utilizar WINE para correr en mac-
Que motor (base de datos) puedo usar?
gracias. |
que no se vea el cursor | Hola Amigos: quiero que no se vea el cursor del teclado dentro de un get. Alguien sabe con que instruccion desaparece el cursor del teclado. Gracias. Saludos
Leonor |
que no se vea el cursor | Leonor,
HideCaret( <oGet>:hWnd ) |
que parametro uso para que me muestre la linea con el error? | hola.
Antes de usar el script me mostraba donde se producia el error, peo ahora no:
[code=fw:1324aj8g]<div class="fw" id="{CB}" style="font-family: monospace;"> Args:<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">1</span><span style="color: #000000;">]</span> = C _2<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span> = N <span style="color: #000000;">999</span><br /><br />Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Z</span>:\32_bits\vete\veterinaria\Source\productos\TFacturacion.PRG => TFACTURACION:<span style="color: #000000;">GUARDARFACTURA</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span></div>[/code:1324aj8g]
que parametro se le da al compilador para que me muestre en que linea se produjo el error?
gracias. |
que parametro uso para que me muestre la linea con el error? | [code=fw:ld641qmg]<div class="fw" id="{CB}" style="font-family: monospace;"><br />xHarbour <span style="color: #000000;">1.2</span><span style="color: #000000;">.3</span> Intl. <span style="color: #000000;">(</span>SimpLex<span style="color: #000000;">)</span> <span style="color: #000000;">(</span>Build <span style="color: #000000;">20140725</span><span style="color: #000000;">)</span><br />Copyright <span style="color: #000000;">1999</span><span style="color: #000000;">-2014</span>, http:<span style="color: #B900B9;">//www.xharbour.org <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m --></span><br /><br />Syntax: <span style="color: #000000;">C</span>:\XHB280714\bin\harbour.exe <file<span style="color: #000000;">[</span>s<span style="color: #000000;">]</span><span style="color: #000000;">[</span>.prg<span style="color: #000000;">]</span>> <span style="color: #000000;">[</span>options<span style="color: #000000;">]</span><br /><br />Options: /a automatic memvar declaration<br /> /b debug info<br /> /build <span style="color: #00C800;">display</span> detailed version info<br /> /credits <span style="color: #00C800;">display</span> credits<br /> /d<id><span style="color: #000000;">[</span>=<val><span style="color: #000000;">]</span> <span style="color: #00D7D7;">#define</span> <id><br /> /es<span style="color: #000000;">[</span><level><span style="color: #000000;">]</span> set exit severity<br /> /ex create <span style="color: #00C800;">public</span> <span style="color: #00C800;">function</span> list <span style="color: #000000;">(</span>.xbx<span style="color: #000000;">)</span><br /> /g<type> output type generated is <type> <span style="color: #000000;">(</span>see below<span style="color: #000000;">)</span><br /> /gc<span style="color: #000000;">[</span><type><span style="color: #000000;">]</span> output type: <span style="color: #000000;">C</span> source <span style="color: #000000;">(</span>.c<span style="color: #000000;">)</span> <span style="color: #000000;">(</span><span style="color: #00C800;">default</span><span style="color: #000000;">)</span><br /> <type>: <span style="color: #000000;">0</span>=compact <span style="color: #000000;">1</span>=<span style="color: #0000ff;">normal</span> <span style="color: #000000;">2</span>=verbose <span style="color: #000000;">(</span><span style="color: #00C800;">default</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">3</span>=generate real C code<br /> /go output type: <span style="color: #000000;">Platform</span> dependant object module<br /> /gh output type: <span style="color: #000000;">Harbour</span> Portable Object <span style="color: #000000;">(</span>.hrb<span style="color: #000000;">)</span><br /> /i<path> <span style="color: #00D7D7;">#include</span> file search path<br /> /j<span style="color: #000000;">[</span><file><span style="color: #000000;">]</span> output i18n support <span style="color: #000000;">[</span><span style="color: #0000ff;">to</span> <file><span style="color: #000000;">]</span> <span style="color: #0000ff;">to</span> .hil<br /> /k compilation mode <span style="color: #000000;">(</span>type -k? <span style="color: #00C800;">for</span> more <span style="color: #00C800;">data</span><span style="color: #000000;">)</span><br /> /l suppress line number information<br /> /m compile module only<br /> /n<span style="color: #000000;">[</span><type><span style="color: #000000;">]</span> no implicit starting procedure <span style="color: #000000;">(</span><span style="color: #00C800;">default</span><span style="color: #000000;">)</span><br /> <type>: <span style="color: #000000;">0</span>=no implicit starting procedure<br /> <span style="color: #000000;">1</span>=no starting procedure <span style="color: #00C800;">at</span> all<br /> <span style="color: #000000;">2</span>=force application starting procedure<br /> /o<path> object file drive and/or path<br /> /p<span style="color: #000000;">[</span>o<path><span style="color: #000000;">]</span> generate pre-processed output <span style="color: #000000;">(</span>.ppo<span style="color: #000000;">)</span> file in <path><br /> /<span style="color: #0000ff;">pt</span><span style="color: #000000;">[</span>o<path><span style="color: #000000;">]</span> generate pre-processor trace <span style="color: #000000;">(</span>.ppt<span style="color: #000000;">)</span> file in <path><br /> /q quiet<br /> /q0 quiet and don<span style="color: #ff0000;">'t display program header<br /> /s syntax check only<br /> /u[[+]<file>] use command def set in <file> (or none)<br /> /undef:<id> #undef <id><br /> /v variables are assumed M-><br /> /vd external functions are assumed as dynamic functions<br /> /w[<level>] set warning level number (0..3, default 1)<br /> /x[<prefix>] set symbol init function name prefix (for .c only)<br /> /z suppress shortcutting (.and. & .or.)<br /> @<file> compile list of modules in <file><br /></span></div>[/code:ld641qmg]
|
que pasa que nadie ayuda | me aburri de estar interpretando o que deberia salir por defecto en un manual, es claro que uno no conoce ni el 20% de fivewin, me molesta tener que depender que alguien me diga que hacer, siendo que esto deberia estar claramente definido, estimado Antonio, con esta forma de operar, es dificil, que esta tremenda herramienta se pueda proyectar en el tiempo
sigo con lo de mdi |
que pasa que nadie ayuda | Ten en cuenta que estas usando una version de FW tremendamente vieja, que tiene por lo menos 3 años.
Tambien comprende que las personas que colaboran en este foro no estan aqui todo el dia esperando nada mas a que hora aparece una duda para resolverla inmediatamente, atendemos cuando tenemos tiempo y humor de hacerlo.
Ten en cuenta que hay diferencia de horario, que cuanod en CD. de Mexico son las 12 del dia, en España son las 7 de la noche y todo el mundo ya se ha retirado de trabajar, y lo mismo al reves, cuando en España son las 12 deldia, en Mexico son las 5 am y nadie (o casi nadie) esta detras de su computadora. |
que pasa que nadie ayuda | Luis,
A que error te refieres ? Por favor indica un ejemplo que reproduzca el problema para que podamos ayudarte. |
que pena nadie responde 36 visitas y 11 visitas a temas | que pena que nadie responda a una consulta, si existiera mejor y mayor documentacion sobre los temas que recien pregunte no haria uno el loco por aca, lo de verce lo entiendo, total es un tremendo aporte y gratis.. pero no todos conocen los trucos de estas herramientas de fivewin, dada su pobre o nula documentacion...
si no van a responder, que cae siempre en una buena voluntad, mejor borren los post que "no les interesan"... |
que pena nadie responde 36 visitas y 11 visitas a temas | Para empezar,
No firmas tus post.
Lo del Verce, hay muchos colegas que lo usan y si postearas tus dudas mas en concreto se te ayudaría, por otro lado, es un Gran Foro el que tienes a disposición y con hacer búsquedas en el foro podrían resolverse un mundo de dudas, el histórico de preguntas y respuestas de este GRAN FORO es mas que excelente manual, desde luego se te respeta tu punto de vista, pero creo que no es la forma correcta de pedir ayuda.
El borrar mensajes no es una solución, imagina si en todos los foros se hicieran lo que sugieres, no habría bibliografía por ningún lado.
Mi humilde punto de vista |
que pena nadie responde 36 visitas y 11 visitas a temas | Hola (como te llames):
Mucho ayudaría si completaras los datos de tu perfil de usuario, si te fijas la mayoría de los miembros de este foro estamos plenamente identificados y mostramos una dirección de correo a donde podemos recibir información o ayuda si ese fuera el caso.
Por lo demás, tanto un servidor como, estoy seguro, la gran mayoría de los participantes en nuestros foros, siempre estamos dispuestos a ayudar desinteresadamente en la medida de nuestros conocimientos o capacidades.
Yo tengo la versión de Harbour y xHarbour que requieres y con gusto te las enviaré en cuanto pueda ver tu dirección de correo en tu perfil de usuario.
Un abrazo.
Manuel Mercado. |
que pena nadie responde 36 visitas y 11 visitas a temas | Por cierto, te envie lo que requerias y tu correo me devolvio el envio,, dice que esta lleno,,, o acaso ya no esta vigente...
de otro lado,,, no es la forma de hacer un reclamo, aqui todos tenemos buena voluntad, y merecemos respeto,,,
Salu2 |
que pena nadie responde 36 visitas y 11 visitas a temas | saludos amigo, uso verce y lei tu post pero lo primero que vi es que no tenias nombre asi que me abtuve de contestarte, segundo vi que estas en el foro desde el 2006 y solo has posteado 32 post, es decir tu precisamente no se puede decir que ayudas a los demas y casi siempre y conozco personalmente a varios que no voy a nombran solo leen, extraen y copian informacion de aqui pero jamas ayudan a nadie, de vez en cuando si preguntan algo, no es mi estilo pq en lo que puedo ayudo a quien puedo, y de igual manera a veces pido ayuda y creo hay un balance entre lo que se da y se recibe, y te puedo asegurar que siempre es mas la ayuda que recibo que la que doy, pero es necesario dar tambien y darse a conocer, del verce hay una version 5.3 aunque yo sigo usando la 4.3 y no he tenido problemas, el programa es muy intuitivo, solo se configuran los directorios, agregas lib de terceros si la tienes y agregas los datos de tu proyecto
Alejandor Patiño
Venezuela |
que pena nadie responde 36 visitas y 11 visitas a temas | Mira mi caso es distinto al de QAZWSX2K ya que he recibido mas ayuda de la que he dado, ya que mi nivel no es gran cosa . Pero lo que si puedo decirte en todos estos años que cuando he tenido problemas consulté y siempre pude solucionar los problemas planteados. A veces con algunos días de atraso, pero he podido progresar y mejorar mi programación. En verce utilizo el 4.3, ya que cuando instale las 5xx me daban problemas y me parecía mas lenta (debe ser por la versión de fwh 2.6). Creo que te has expresado mal pero todos tenemos un mal día.
Un abrazo
Luis
Pd: no te enojes por esto hay cosas mas importante |
que tamaño debe tener un campo que guarda un CHECKSUM? | Eso.
Necesito saber para generar en una tabla que tamaño tengo que ponerle
para que almacene el numero checksum
campo, numerico, ....
gracias. |
que tamaño debe tener un campo que guarda un CHECKSUM? | Mira se és esto:
<!-- m --><a class="postlink" href="http://en.wikipedia.org/wiki/Checksum">http://en.wikipedia.org/wiki/Checksum</a><!-- m -->
salu2 |
que tamaño debe tener un campo que guarda un CHECKSUM? | Goos,
La función para el cálculo del checksum lo decidís vos, entonces vos sabrás que resultados dá la función que usas, tanto en tipo como en longitud.
Si usas MD5, que es bastante conocida, yo lo definiría como C(16), o si usas la funcion que ya viene en Harbour, HB_MD5 te la devuelve hexadecimal, es decir C(32). |
queriendo iniciar con fivelinux | Antonio, tengo linux red hat version 9 , al intentar construir el tutor01 me da este error
compiling...
./../../harbour/bin/harbour: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by ./../../harbour/bin/harbour)
compiling C module...
gcc: tutor01.c: No existe el fichero o el directorio
gcc: no hay ficheros de entrada
linking...
Package libgnomeprintui-2.2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libgnomeprintui-2.2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libgnomeprintui-2.2' found
gcc: tutor01.o: No existe el fichero o el directorio
rm: no se puede efectuar `lstat' sobre `tutor01.c': No existe el fichero o el directorio
rm: no se puede efectuar `lstat' sobre `tutor01.o': No existe el fichero o el directorio
done!
./build.sh: line 23: ./tutor01: No existe el fichero o el directorio
que me esta faltando instalar y como lo instalo ??
al digitar
rpm -q gtk2-devel
obtengo como respuesta
gtk2-devel-2.2.1-4
perdon por la ignorancia
gracias x todo
Saludo |
queriendo iniciar con fivelinux | Wilson,
Prueba lo siguiente desde una ventana de consola:
sudo yum install glibc
sudo yum install gtk2-devel
sudo yum install libgnomeprintui22-devel |
queriendo iniciar con fivelinux | Antonio, gracias ya sse instalaaron esass librerias, ahora me sale este otro error
compiling...
Harbour devel build 1.1-1 Intl.
Copyright 1999-2007, <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->
Compiling 'tutor01.prg'...
Lines 1015, Functions/Procedures 1
Generating C source output to 'tutor01.c'... Done.
compiling C module...
./build.sh: line 14: gcc: command not found
linking...
./build.sh: line 17: gcc: command not found
rm: no se puede borrar «tutor01.o»: No existe el fichero o el directorio
done!
./build.sh: line 23: ./tutor01: No existe el fichero o el directorio
[root@localhost samples]#
que estara mall ?
gracias x todo
x cierto como coonnnfiiguro el teclado para que no se repitan laas teclas ??
saludos |
queriendo iniciar con fivelinux | Wilson,
Te falta el compilador de C. Es raro que no venga incluido:
sudo yum install gcc
Para el teclado, no se. Yo te recomiendo usar Ubuntu. En la opinión de muchos es el Linux más amigable y más fácil de configurar, y posiblemente el que mejor soporte técnico y actualizaciones ofrece. |
queriendo iniciar con fivelinux | gracias Antonio, tengo un problema y es que el teclado dejo de funcionar en la parte grafica, tengo instalado centos 5 en mi laptop virtualizado con Microsoft Virtual Pc 2007 que estan regalando
Voy a ver si vuelco a instalar todo con ubunto, aunque en mi laptop no arranco me voy a bajar la version 7
Gracias x todo
Saludos
Att |
queriendo iniciar con fivelinux | Ubuntu es excelente. En la opinión de muchos, es el Linux con más futuro <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
queriendo iniciar con fivelinux | Antonio, ahora ya estoy con Ubuntu 7.04 lo instale con vmware player, ya instale la secuencia de programas:
sudo apt-get install libgtk2.0-dev
sudo apt-get install gcc
sudo apt-get install libncurses5-dev
sudo apt-get install libgpmg1-dev
sudo apt-get install libgnomeprintui2.2-dev
ahora obtengo este error
Harbour devel build 1.1-1 Intl.
Copyright 1999-2007, <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->
Compiling 'tutor01.prg'...
Lines 1015, Functions/Procedures 1
Generating C source output to 'tutor01.c'... Done.
compiling C module...
linking...
Package libglade-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libglade-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libglade-2.0' found
/home/user/wilson/fivelinux/lib/libfivec.a(lnx.o): In function `HB_FUN_SETRESOURCES':
lnx.c:(.text+0x27b): undefined reference to `glade_xml_new'
/home/user/wilson/fivelinux/lib/libfivec.a(lnx.o): In function `HB_FUN_LOADDIALOG':
lnx.c:(.text+0x2a7): undefined reference to `glade_xml_get_widget'
/home/user/wilson/fivelinux/lib/libfivec.a(lnx.o): In function `HB_FUN_LOADBUTTON':
lnx.c:(.text+0x3a8): undefined reference to `glade_xml_get_widget'
collect2: ld returned 1 exit status
done!
./build: line 23: ./tutor01: No such file or directory
Gracias x Todo
Saludos
pd: por cierto Ubuntu esta muuuuuy bonito |
queriendo iniciar con fivelinux | Wilson,
sudo apt-get install glade-2 |
queriendo iniciar con fivelinux | Antonio, gracias
EXITO TOTAL!!!!
ya compile , estoy muy emocionado, gracias nuevamente
existe un programa que viene con ubuntu llamado
Synaptic Package Manager
con ese he resuelto todos esos problemas !!!
la verdad que esto se ve oK
por cierto de mis experiencias de esto
Microsoft Virtual Pc es un fraude no funciona, me hizo perder una semana de trabajo, tiene erroes de memoria, no deja funcionar bien al linux, etc
Vmware Player funciona muuuuy bien, me baje una maquina virtual ya lista, claro que esta en ingles pero me sirve
aclaro que soy novato
aca una imagen
[url=http://img355.imageshack.us/my.php?image=screenshotff2.png:1m4gs3vy][img:1m4gs3vy]http://img355.imageshack.us/img355/310/screenshotff2.th.png[/img:1m4gs3vy][/url:1m4gs3vy]
gracias nuevamente |
queriendo iniciar con fivelinux | Wilson,
Bien! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Yo tambien prefiero vmware, aunque tengo instalados multiples sistemas operativos en el ordenador, ya que asi usas Linux a su velocidad real.
En el ordenador tengo tres discos duros internos: uno para Vista/XP, otro para Linux y el tercero para Mac. Asi no intefieren unos con otros. El arranque de Linux (grub) controla todos los sistemas operativos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
query on mdb | I made the listbox of the products ( see the picture) of a MDB
I want show the name of each category and subcategory and not the number
How I can made for search on category table the description and insert on listbox ?
I made :
[code:vgxjdthx]
IF oDb != NIL .AND. oDb:State == adStateOpen
IF OpenTables()
aBrowsep := { { { || STR( oPs:Fields( "ID" ):Value) }, i18n("Contatore"), 50, 0 },;
{ { || oPs:Fields( "CODICE" ):Value }, i18n("Codice"), 150, 0 },;
{ { || STR( oPs:Fields( "SCATEGORIA" ):Value)} , i18n("Categoria"), 150, 0 } ,;
{ { || STR( oPs:Fields( "CATEGORIA" ):Value)}, i18n("Sotto categoria"), 150, 0 },;
{ { || oPs:Fields( "PRODOTTO" ):Value} , i18n("Prodotto"), 150, 0 }}
FOR i := 1 TO Len(aBrowsep)
oCol := oApp():oGrid:AddCol()
oCol:bStrData := aBrowsep[ i, 1 ]
oCol:cHeader := aBrowsep[ i, 2 ]
oCol:nWidth := aBrowsep[ i, 3 ]
oCol:nDataStrAlign := aBrowsep[ i, 4 ]
oCol:nHeadStrAlign := aBrowsep[ i, 4 ]
NEXT
oApp():oGrid:SetADO( oPs )
oApp():oGrid:CreateFromCode()
oApp():oGrid:bChange := { || RefreshCont(oCont,oPs) }
oApp():oGrid:nRowHeight := 21
oApp():oGrid:nHeaderHeight := 36
oApp():oGrid:bClrStd := { || Colores(oPs) }
oApp():oGrid:RestoreState( cState )
// colors
oApp():oGrid:bClrHeader := { || { CLR_BLUE, RGB(143,172,230)} }
oApp():oGrid:nColDividerStyle := LINESTYLE_FORECOLOR
oApp():oGrid:nMarqueeStyle := MARQSTYLE_HIGHLROW
oPs:MoveFirst()
ACTIVATE DIALOG oApp():oDlg NOWAIT
STATIC FUNCTION ConnectToDataBase
oDB := TOLEAuto():New( "ADODB.Connection" )
oDB:ConnectionString := "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ecom.mdb;User Id=admin;Password=;"
oDB:CursorLocation := adUseClient
TRY
oDB:Open()
CATCH
oDB := NIL
MsgInfo('Connect Fail')
RETURN NIL
END
RETURN oDB
STATIC FUNCTION OpenTables
oPs := TOLEAuto():New( "ADODB.RecordSet" )
WITH OBJECT oPs
:ActiveConnection := oDB
:CursorType := adOpenDynamic
:LockType := adLockOptimistic
:Source := "PRODOTTI"
:CursorLocation := adUseClient
END
TRY
oPs :Open()
CATCH
oPs := NIL
MsgInfo( "Attenzione - Non posso aprire la tabella Prodotti" )
END
IF oPs != NIL
RETURN .T.
ENDIF
oSc := TOLEAuto():New( "ADODB.RecordSet" )
WITH OBJECT oSc
:ActiveConnection := oDB
:CursorType := adOpenDynamic
:LockType := adLockOptimistic
:Source := "SCATEGORIE"
:CursorLocation := adUseClient
END
TRY
oSc:Open()
CATCH
oSc := NIL
MsgInfo( "ATTENZIONE - Non posso aprire la tabella SCATEGORIE" )
END
oCt := TOLEAuto():New( "ADODB.RecordSet" )
WITH OBJECT oCt
:ActiveConnection := oDB
:CursorType := adOpenDynamic
:LockType := adLockOptimistic
:Source := "CATEGORIE"
:CursorLocation := adUseClient
END
TRY
oCt:Open()
CATCH
oCt := NIL
MsgInfo( "ATTENZIONE - Non posso aprire la tabella CATEGORIE" )
END
IF oSc != NIL .AND. oCt != NIL
RETURN .T.
ENDIF
RETURN .F.
[/code:vgxjdthx]
can I made somethig of it to search the name of category ?
[code:vgxjdthx]
STATIC FUNCTION search()
oCt:Search := "SCATEGORIA = " + STR( oPs:Fields( "SCATEGORIA" ):Value)
IF oCt:RecordCount() > 0
oCt:MoveFirst()
ENDIF
RETURN oCt:Fields( "Categoria" ):Value
[/code:vgxjdthx]
[img:vgxjdthx]http://img166.imageshack.us/img166/8355/pernageswz4.jpg[/img:vgxjdthx] |
question about DataRow | Hello,
In DataRow, it is possible to have all logical fields of a recordset to be set to .t.? For example, with an eval.
Thank you very much. Greetings. |
question about DataRow | [code=fw:26dcuks7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> oRec:<span style="color: #000000;">FCount</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">FieldGet</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"L"</span><br /> oRec:<span style="color: #000000;">FieldPut</span><span style="color: #000000;">(</span> n, .t. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span> n<br /> </div>[/code:26dcuks7] |
question about Dates | Hello,
I have the following string: Fri, 08 Aug 2008 19:25:01 GMT
How can I get only date in dd-mm-yyyy format?.
Is possible?.
Thank you very much. |
question about Dates | [code=fw:9qwwpd49]<div class="fw" id="{CB}" style="font-family: monospace;">SET DATE ITALIAN<br />SET CENTURY <span style="color: #0000ff;">ON</span><br />? uCharToVal<span style="color: #000000;">(</span> <span style="color: #ff0000;">"08 Aug 2008"</span>, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">)</span></div>[/code:9qwwpd49]
Result : 08-08-2008
If you can manage to truncate the string after the year, this function works.
Hope we can improve the function to handle full strings given by you in future versions. |
question about Dates | Thank you.
But the string is Fri, 08 Aug 2008. |
question about Dates | Even that string also works.
Please try using the function with different combinations. Just make sure that the time stamp is not included.
eg. October 23rd 2001 works
In the next revision any strings will be handled. |
question about Dates | Mr. Rao,
Thank you very much.
The help file is very small:
Syntax:
uCharToVal( <cExpression>, <uType> ) --> uValue
Parameters:
<cExpression> A string expression to be converted to a specific type.
<uType> It is value, whose type determines the kind of conversion we want to do.
But it is a very powerful function. |
question about Dates | Now in the revised build of FWH 11.05, even expressions like 'Fri, 08 Aug 2008 19:25:01 GMT' are handled. |
question about Folders | Hi,
I would like to create a message via msgalert() when the user clicks on a specific Tab of a Folder, only for one I indicate.
How can it be done?.
Thanks <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
question about Folders | [code=fw:3ona89nm]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oFolder:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> |nOption,nOldOption| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nOption == <span style="color: #000000;">3</span>, MsgAlert<span style="color: #000000;">(</span><span style="color: #ff0000;">'alert'</span><span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:3ona89nm] |
question about Folders | Thank you <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
It works fine. |
question about Menu and permisions | Hi
I would like to introduce a permission´s control for users in the menu´s option.
¿Is there a way to obtain the Array with all the items of the Menu?.
My Menu is like this:
MENU oMenu
MENUITEM "&Ficheros"
MENU
MENUITEM "&Auxiliares"
MENU
MENUITEM OemToAnsi( "C¢digos P&ostales" ) ;
RESOURCE "MNUPOSTAL" ;
ACTION Postal() ;
MESSAGE OemToAnsi( "Mantenimiento de C¢digos Postales" )
MENUITEM "P&rovincias" ;
RESOURCE "MNUPROVINCIAS" ;
ACTION Provincias() ;
MESSAGE "Mantenimiento de Provincias"
MENUITEM "&Zonas" ;
RESOURCE "MNUZONAS" ;
ACTION Zonas() ;
MESSAGE OemToAnsi( "Mantenimiento de Zonas de facturaci¢n" )
Thanks a lot!!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
question about Menu and permisions | I only define menu items that the user has access to. I think this is better than disabling menu items. When menu items are disabled then the user wonders why, or if they know why then it is kind of an insult.
So, I have a set/get function that stores a copy of the user object. Then you can retrieve the user object anywhere in the program without using a public.
Note that user():level is the same as doing oUser:= user(); oUser:level
[code=fw:226vqf2h]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">Menu</span> oMenu<br /><span style="color: #00C800;">if</span> user<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">level</span> > <span style="color: #000000;">3</span><br /> <span style="color: #0000ff;">menuitem</span>...<br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">if</span> user<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">level</span> > <span style="color: #000000;">2</span><br /> <span style="color: #0000ff;">menuitem</span>...<br /><span style="color: #00C800;">endif</span></div>[/code:226vqf2h]
Regards,
James |
question about Menu and permisions | Dear MgSoft,
In my application I am using Menu's based on User's permission. I am using MySQL. I have the following tables
Table Menu (Contains all menu items available in my application)
--------------
Menu ID
Menu Item
Menu Action
Menu BMP REsource Name
Menu Message
Table USers ( All users )
-----------
USer Code
User Name
Table UserMenu ( contain records only for the permitted menu for the users, if no records means, no permission for the user)
User Code
Menu ID
And finally,the administrator user will have a screen interface (screen snapshot given below) where he is able to set menu permission for the application users
[url=http://img10.imageshack.us/i/usermenud.jpg/:1vlrr7ur][img:1vlrr7ur]http://img10.imageshack.us/img10/2692/usermenud.jpg[/img:1vlrr7ur][/url:1vlrr7ur]
Regards
Anser |
question about Menu and permisions | [quote="mgsoft":3drq4up4]Hi
I would like to introduce a permission´s control for users in the menu´s option.
¿Is there a way to obtain the Array with all the items of the Menu?.
My Menu is like this:
MENU oMenu
MENUITEM "&Ficheros"
MENU
MENUITEM "&Auxiliares"
MENU
MENUITEM OemToAnsi( "C¢digos P&ostales" ) ;
RESOURCE "MNUPOSTAL" ;
ACTION Postal() ;
MESSAGE OemToAnsi( "Mantenimiento de C¢digos Postales" )
MENUITEM "P&rovincias" ;
RESOURCE "MNUPROVINCIAS" ;
ACTION Provincias() ;
MESSAGE "Mantenimiento de Provincias"
MENUITEM "&Zonas" ;
RESOURCE "MNUZONAS" ;
ACTION Zonas() ;
MESSAGE OemToAnsi( "Mantenimiento de Zonas de facturaci¢n" )
Thanks a lot!!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->[/quote:3drq4up4] |
question about Menu and permisions | [quote:3dnu9qgo]¿Is there a way to obtain the Array with all the items of the Menu?.[/quote:3dnu9qgo]
oMenu:aItems() -> returns an array of menu items as objects
James |
question about Menu and permisions | Thank you very much.
Anserkk, how do you group Menus in xBrowse?.
And how do you set on /off permisions?.
Thanks <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
question about Menu and permisions | MgSoft,
Sorry, I forgot to mention about an important column named Parent Menu ID in the Menu Table. This will help me to group the menu's in xBrowse as well as while creating Menu and SubMenu's Objects
Table Menu (Contains all menu items available in my application)
--------------
Menu ID
Menu Item
Menu Action
Menu BMP Resource Name
Menu Message
Parent Menu ID ( This will help me to setup parent child relationships between the Menu Items )
Regards
Anser |
question about Scopes | Hello,
I have a database with tree indexes, code, name and state:
CUSTOMER.DBF
CODE
NAME
ADDRESS
PHONE
STATE
I would like to set an Scope as an alternative to SET FILTER to xbrowse customers in state = "NY", instead of using:
[code=fw:3fqsrtdv]<div class="fw" id="{CB}" style="font-family: monospace;">SET FILTER <span style="color: #0000ff;">TO</span> FIELD->STATE = <span style="color: #ff0000;">"NY"</span></div>[/code:3fqsrtdv]
But I want to order the results by code, but this is index 1.
if I set the scope such as:
[code=fw:3fqsrtdv]<div class="fw" id="{CB}" style="font-family: monospace;">SET ORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">3</span><br /><br /> OrdScope<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"NY"</span> <span style="color: #000000;">)</span><br /> OrdScope<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"NY"</span> <span style="color: #000000;">)</span><br /> Dbgotop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">XBROWSE</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> OrdScope<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #00C800;">Nil</span> <span style="color: #000000;">)</span><br /> OrdScope<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #00C800;">Nil</span> <span style="color: #000000;">)</span><br /><br /> SET ORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br /> </div>[/code:3fqsrtdv]
But I want the results ordered by code or number, not state.
Is it possible?.
Thank you very much <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->. |
question about Scopes | You have to create an index state+code_number and use the scope the way you did. The result will be shown order by code_number for the scoped state. |
question about Scopes | Thank you.
So I have to change SET ORDER TO 3.
That is what I wanted to avoid.
Thanks |
question about Scopes | If you dont wat to change your index you might reopen you dbf with another alias set its order to 3, scope it, browse what you need and close it when finished. |
question about Scopes | Why do you want to avoid that?
If you not using the index on 'state' somewhere else in your program, you can change the index 3 to state+code_number,
otherwise you can add a 4th index and use tis one for your scope.
Marc |
question about Scopes | Marc,
As it is runned in a network eviroment.
Thanks for helping <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) --> |
question about Scopes | >As it is runned in a network environment.
Why does that matter? If you are concerned about speed, then I expect it is still going to be way faster than a filter.
Regards,
James |
question about TDataRow [answered] | Hello,
I load a record using TDataRow() -TDataRow():New( alias() )-, but I need to search in all the fields for a specific value: i don´t know the field there this value is.
Is it possible?.
Thank you. |
question about TDataRow [answered] | You must be aware that TDataRow operates on a single record.
TDataRow has DATA aData, which is a multi-dim array. First column is field name and second column is value of the field.
oRec := TDataRow():New( [cAlias] )
oRec:aData[ n, 1 ] --> nth field name
oRec:aData[ n, 2 ] --> nth field value.
You can search for what you want.
We recommend strongly never to modify this array directly. |
question about TDataRow [answered] | Thank you. |
question about new 7.12 ( xbrowse and msgitem) | this is a image of my application
and I have some graphics errors
the first U can see the arrow on the header of xbrowse : all not are trasparent
then there is an image on msgiten the space of each iten not is with the brush of 2007 style
How to correct it ?
[url=http://img404.imageshack.us/my.php?image=err2007ux8.jpg:2bbouh16][img:2bbouh16]http://img404.imageshack.us/img404/159/err2007ux8.th.jpg[/img:2bbouh16][/url:2bbouh16] |
question about new 7.12 ( xbrowse and msgitem) | Antonio,
I have the same problem with btnbmp
I have rem line 790 and I have insert these lines
Gradient( ::hDC, { 0, 0, ::nHeight / 4, ::nWidth },;
If( ! ::lMOver, nRGB( 219, 230, 244 ), nRGB( 255, 253, 222 ) ),;
If( ! ::lMOver, nRGB( 207, 221, 239 ), nRGB( 255, 231, 151 ) ), .T. )
Gradient( ::hDC, { ( ::nHeight / 4 ) + 1, 0, ::nHeight, ::nWidth },;
If( ! ::lMOver, nRGB( 201, 217, 237 ), nRGB( 255, 215, 84 ) ),;
If( ! ::lMOver, nRGB( 231, 242, 255 ), nRGB( 255, 233, 162 ) ), .T. )
it run ok when I use this command
[code:2i4a8ww6] REDEFINE BTNBMP oBtn1 ID 1 OF oDlt ;
FILE ".\bitmaps\ok.BMP" ;
ACTION(lReg:=.T.,oDlt:End()) ;
PROMPT " Conferma" LEFT
REDEFINE BTNBMP oBtn2 ID 2 OF oDlt ;
FILE ".\bitmaps\SEL2.BMP";
ACTION oDlt:End() ;
PROMPT " Annulla" LEFT[/code:2i4a8ww6]
I can see office style and id the mouse over the button change look
But the bitmaps are not trasparent
Any Idea ? |
question about new 7.12 ( xbrowse and msgitem) | Silvio,
We have just published a new FWH 7.12 build with the transparent bitmaps painting and optional 2007 look for XBrowse.
Please review the Class TXBrowse source for TransBmp() and use it in your Class TBtnBmp modifications. Thanks, |
question about new 7.12 ( xbrowse and msgitem) | have you correct only fwh ?
I must download only fwh new ? |
question about new 7.12 ( xbrowse and msgitem) | Antonio I recompiled with the last lib
but there is an error :
I made a xbrowse with bitmaps on header tosayto user wich field index
on the header of Xbrowse I not see the bitmaps
when I click on each header I can see the bitmap on the left of the records
this is a part of my code
oCol:= oApp():oGrid:AddCol()
[b:2dei8gev]oCol:AddResource("sort1")[/b:2dei8gev] [b:2dei8gev] oCol:AddResource("sort2")[/b:2dei8gev] oCol:bStrData := { || (oDCli)->NOMEINTERO}
oCol:cHeader := "Cognome Nome"
oCol:nWidth := 250
oCol:nHeadBmpNo := 2
oCol:nHeadBmpAlign := AL_RIGHT
oCol:bLClickHeader :={ ||(Sel_Index(2,oDCli), oApp():oTab:nOption:=2,oApp():oTab:refresh()) }
Also in your sample testxbrowse there is an error
look it please
[url=http://img150.imageshack.us/my.php?image=errorbrwsekv9.png:2dei8gev][img:2dei8gev]http://img150.imageshack.us/img150/6581/errorbrwsekv9.th.png[/img:2dei8gev][/url:2dei8gev] |
question about new 7.12 ( xbrowse and msgitem) | Silvio,
Fixed. We are uploading a new FWH 7.12 build.
It will be ready to download in just some minutes <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Please remember to set RGB( 255, 0, 255 ) as the color for the transparent area of the bitmaps
Thanks!
[url=http://imageshack.us:2q22ar63][img:2q22ar63]http://img258.imageshack.us/img258/3040/xbrowseqg3.png[/img:2q22ar63][/url:2q22ar63] |
question about new 7.12 ( xbrowse and msgitem) | Antonio,
thanks
but the link is too slow... I must go to school this morning..I 'll try from there ....wait me!! |
question about xBrowse | Hello,
I have a dbf with 10 fields but I only indicate 2 in xbrowse.
[code=fw:16bx6x1h]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">210</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"invoices"</span> ;<br /> FIELDS invoices->field3, invoices->field6 ;<br /> HEADERS <span style="color: #ff0000;">"field 3"</span>, <span style="color: #ff0000;">"field 6"</span> <br /> </div>[/code:16bx6x1h]
In that case, oBrw:aCols[oBrw:nColSel]:bOnPostEdit := {|x|x:Value := x:oEditGet:Value,oBrw:nColSel--}
does NOT save changes.
But if I define xBrowse as [code=fw:16bx6x1h]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ID</span> <span style="color: #000000;">210</span> <span style="color: #0000ff;">AUTOCOLS</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"LINEASTMP"</span> CELL LINES</div>[/code:16bx6x1h] it works, but I don´t need all fields.
Thanks. |
question about xBrowse | This is the recommended way
[code=fw:3d2uah4a]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">210</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"invoices"</span> ;<br /> COLUMNS <span style="color: #ff0000;">"field3"</span>, <span style="color: #ff0000;">"field6"</span> ;<br /> HEADERS <span style="color: #ff0000;">"field 3"</span>, <span style="color: #ff0000;">"field 6"</span> <span style="color: #B900B9;">// You can ommit headers if same name</span><br /> </div>[/code:3d2uah4a]
Please avoid using FIELDS command. This is provided for easy and quick migration from wbrowse. |
question about xBrowse and Fastedit | Hello,
I want to set on Fast Edit to edit a cell by pressing Enter.
But if I press double click, I want to execute an action:
[code=fw:2xpgtbhh]<div class="fw" id="{CB}" style="font-family: monospace;"> oBrw:<span style="color: #000000;">blDblClick</span> := <span style="color: #000000;">{</span> || msgalert<span style="color: #000000;">(</span><span style="color: #ff0000;">"my function"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /> oBrw:<span style="color: #000000;">nEditTypes</span> := EDIT_GET <span style="color: #B900B9;">// insert this line</span><br /> oBrw:<span style="color: #000000;">lFastEdit</span> := .t.<br /> </div>[/code:2xpgtbhh]
But if I set fastedit to .f. blDblClick is ignored.
How is possible to work as I need?.
Thank you. |
question about xBrowse and Fastedit | [quote:36jit58m]I want to set on Fast Edit to edit a cell by pressing Enter.
[/quote:36jit58m]
Enter key any way triggers edit, whether fast edit is set to true or not if the column's nEditType > 0
[quote:36jit58m]if I press double click, I want to execute an action:[/quote:36jit58m]
oCol:bLDClickData := { |r,c,f,oCol| YourAction( r,c,f,oCol ) }
This codeblock gets executed when the user double clicks on any cell of the column, whether the cell is editable or not and whether fastedit is true or not.
Note: oBrw:blDblClick is not recommended way in xbrowse, though it works. Instead we better set the columns' bLDClickData. |
question about xBrowse and Fastedit | Thank you for so quick reply.
I define the xBrowse
@ 0,0 XBROWSE oBrw OF oWnd AUTOCOLS ALIAS "CUSTOMER" CELL LINES
I insert:
oBrw:nEditTypes := EDIT_GET // insert this line
oBrw:lFastEdit := .t.
So when I press enter, I edit the field. If I press enter again, I move to next field.
That is perfect.
But if I double click on wtahtever field, I need to invoke my action.
So that is why I used oBrw:blDblClick
But it is ignored. Double click edits the field. I want to invoke my function.
Is it possible?.
Thank you very much!! |
question about xBrowse and Fastedit | [quote:37h2egb7]So that is why I used oBrw:blDblClick
But it is ignored. Double click edits the field. I want to invoke my function.
[/quote:37h2egb7]
That is what I advised you about in my previous post.
Please do not use oBrw:bLDblClick. This is not the preferred way of specifying double click action for xbrowse.
If you want a specific double click action for specific columns, you use
oCol:bLDClickData := { |nRow,nCol,nFlags,oColObject| your function(...)}
If you want the same action for all columns, then
oBrw:bLDClickDatas := { |nRow,nCol,nFlags,oColObject| your function(...)} |
question about xBrowse and Fastedit | Thanks a lot, it works perfect.
I see that there are old features that should not be used.
Please, when you have time it will be very interesing a fixed topic about best practices with xBrowse, shown at the top of forums (like How to do my question?).
Thanks again. |
question for a source conversion | A long time ago I created a dialog with two different xbrowse but with the same archive using Tdatabase as you can see in this picture
[img:uritv4d4]https://i.postimg.cc/nhJtcQ7Y/jj.png[/img:uritv4d4]
Now I would like to create the same thing but using the traditional dbf i.e. without tdatabase i.e. in an exclusive way
in the first xbrowse records with the "days" field = 1 the second xbrowse records with the "days" field> 1 are displayed
I can't create [b:uritv4d4] arrays[/b:uritv4d4] because the records of the first xbrowse and the second must be modified and saved in the archive
Any solution Please |
question for trichedit | Dear Antonio (or dear all)
I wish as U some questions on trichedit class only 8 small question ...
because I need it for a application and I compiled the testrtf,prg to see what I have and I rewrite a small rtfpad (from testrtf.prg)
[img:3mmtj5kj]http://www.eoeo.it/wp-content/uploads/2015/05/testrtf.jpg[/img:3mmtj5kj]
I add a second bar down the first and not when I open a file rtf ( as testrtf.prg)
[b:3mmtj5kj]1. question [/b:3mmtj5kj]
[b:3mmtj5kj]on testrtf.prg there is a save function[/b:3mmtj5kj]
[code=fw:3mmtj5kj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Save<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cFile := cGetFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Rich Text Format (*.rtf) |*.rtf|"</span> + ;<br /> <span style="color: #ff0000;">"Only Text Format (*.txt) |*.txt"</span>, ;<br /> <span style="color: #ff0000;">"Please write a filename"</span>, nGetFileFilter<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,, .t. <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cFile := Upper<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! <span style="color: #ff0000;">"."</span> $ cFile, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nGetFileFilter<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">".RTF"</span>, <span style="color: #ff0000;">".TXT"</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /><br /> oRTF:<span style="color: #000000;">SaveToRTFFile</span><span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> oRTF:<span style="color: #000000;">SetClear</span><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: #00C800;">nil</span></div>[/code:3mmtj5kj]
the file can be txt or rtf
cFile := Upper( cFile ) + If( ! "." $ cFile, If( nGetFileFilter() == 1, ".RTF", ".TXT" ), "" )
but on tichedit class I not found the possibility to set the format of the file
on include there are also
#define SF_TEXT 1
#define SF_RTF 2
but I not found any sample on testrtf to use or save a rtf file into txt
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[b:3mmtj5kj]2 Question [/b:3mmtj5kj]
I wish create a lines as this picture
[img:3mmtj5kj]http://www.eoeo.it/wp-content/uploads/2016/04/apice_pedice.bmp[/img:3mmtj5kj]
and on testrtf.rtf I found also there is the possibility to insert also Hyperlink but I not found the methods on trichedit class
I thinked to create these new methods
seeing the METHOD SetAttribute on trichedit class
[code=fw:3mmtj5kj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">METHOD</span> SetAttribute2<span style="color: #000000;">(</span> lUpp, lSup, lSub, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetUpperCaps<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> .T.,,,,, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetSupScript<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> , .T.,,,, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetSubScript<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> ,, .T.,,, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetHiddenTxt<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> ,,, .T.,, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetHyperLink<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> ,,,, .T., lOnOff <span style="color: #000000;">)</span><br /><br /><br /><br /><br /><span style="color: #00C800;">METHOD</span> SetAttribute2<span style="color: #000000;">(</span> lUpper, lSuper, lSub, lHidden, lLink, lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> <span style="color: #00C800;">LOCAL</span> nMask, nEffects<br /><br /> <span style="color: #00C800;">DEFAULT</span> lUpper := .F., ;<br /> lSuper := .F., ;<br /> lSub := .F., ;<br /> lHidden := .F., ;<br /> lLink := .F., ;<br /> lOnOff := .T.<br /><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> lUpper .or. lHidden <span style="color: #000000;">)</span> .and. ! ::<span style="color: #000000;">lRE30</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> <span style="color: #00C800;">endif</span><br /><br /> nMask := nOr<span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lUpper, CFM_ALLCAPS, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lSuper, CFM_SUPERSCRIPT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lSub, CFM_SUBSCRIPT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lHidden, CFM_HIDDEN, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lLink, CFM_LINK, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> nEffects := nOr<span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lUpper, CFE_ALLCAPS, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lSuper, CFE_SUPERSCRIPT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lSub, CFE_SUBSCRIPT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lHidden, CFE_HIDDEN, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lLink, CFE_LINK, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> RESetAttribute2<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, nMask, nEffects, lOnOff <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3mmtj5kj]
then I not found RESetAttribute( ::hWnd, nMask, nEffects, lOnOff ) to make RESetAttribute2( ::hWnd, nMask, nEffects, lOnOff )
perhaps Antonio can Help us
---------------------------------------------------------------------------------------------------------------------------------------------
[b:3mmtj5kj]3 Question [/b:3mmtj5kj]
I wish set the paragraph of the text but I not found a sample into testrtf.prg
but I found some methods :
aIndent := ortf:GetIndent() give me the left , right and first line ( izquierda,derecha,primeralinea)
ortf:GetParagraph() give me two parametes before and after
ortf:GetAlign() give me the type of align
On winword I have this dialog
[img:3mmtj5kj]http://www.eoeo.it/wp-content/uploads/2016/04/paragra.bmp[/img:3mmtj5kj]
then I thinked to create this dialog
[img:3mmtj5kj]http://www.eoeo.it/wp-content/uploads/2016/04/tab.bmp[/img:3mmtj5kj]
with ortf:GetParagraph() I have two parameters but I need the spaces I found (tab spaces) how I can make ?
---------------------------------------------------------------------------------------------------------------------------------------------
[b:3mmtj5kj]4 Question [/b:3mmtj5kj]
I found on testrtf.prg the find function
ok . I can find a word but...
how I can replace a word with another ?
and if I must replace all same words with another ?
wich is the method make it ?
I need it also to make a procedure of merge with fields from a dbf
---------------------------------------------------------------------------------------------------------------------------------------------
[b:3mmtj5kj]5 Question [/b:3mmtj5kj]
I can change the color of the text with ortf:SetTextColor( ChooseColor( ncolor ) )
but I not have the ncolor current of the text how I can found it ?
---------------------------------------------------------------------------------------------------------------------------------------------
[b:3mmtj5kj]6 Question [/b:3mmtj5kj]
When I open a rtf file ( as you can see on first picture of this message ) I see the file into the window main
but how I can show the file as our rpreview ( type printer layout ) as we see it on winword or wordpad application ?
---------------------------------------------------------------------------------------------------------------------------------------------
[b:3mmtj5kj]7 Question [/b:3mmtj5kj]
I remember there was a function called SHFileProperty() and I found also a sample on .\samples of fwh
I need it to show the property of the file from rtfpad , why this function there was not on new fwh release ?
---------------------------------------------------------------------------------------------------------------------------------------------
[b:3mmtj5kj]8 Question [/b:3mmtj5kj]
How I can insert object into rtfile sample I need to insert tables or excel or another object from a extern application ?
thanks |
question for trichedit | Silvio
[b:39p5jjux][u:39p5jjux]4 Question[/u:39p5jjux][/b:39p5jjux]
[url=http://postimage.org/:39p5jjux][img:39p5jjux]http://s31.postimg.org/j64p5vjzv/0024.png[/img:39p5jjux][/url:39p5jjux]
In TESTRTF.PRG
[code=fw:39p5jjux]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SetChildBar<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br />.../...<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Find"</span> <span style="color: #0000ff;">OF</span> oBar GROUP ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Search"</span> TOOLTIP <span style="color: #ff0000;">"Search"</span> NOBORDER ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> Find<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oRTF:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Find"</span> <span style="color: #0000ff;">OF</span> oBar GROUP ; <span style="color: #B900B9;">// I used the same resource Find</span><br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Replace"</span> TOOLTIP <span style="color: #ff0000;">"Replace"</span> NOBORDER ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> Replace<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oRTF:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br />.../...<br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Replace<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cFind := Space<span style="color: #000000;">(</span> <span style="color: #000000;">100</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cReplace := Space<span style="color: #000000;">(</span> <span style="color: #000000;">100</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nDir := <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">local</span> lCase := .F.<br /> <span style="color: #00C800;">local</span> lWord := .T.<br /> <span style="color: #00C800;">local</span> lAll := .F.<br /> <span style="color: #00C800;">local</span> oDlg<br /> <span style="color: #00C800;">local</span> oFind<br /> <span style="color: #00C800;">local</span> oReplace<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Replace"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oFind <span style="color: #0000ff;">VAR</span> cFind <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oReplace <span style="color: #0000ff;">VAR</span> cReplace <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">RADIO</span> nDir <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span>, <span style="color: #000000;">103</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> lCase <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">OF</span> oDlg<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> lWord <span style="color: #0000ff;">ID</span> <span style="color: #000000;">105</span> <span style="color: #0000ff;">OF</span> oDlg<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> lAll <span style="color: #0000ff;">ID</span> <span style="color: #000000;">106</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">201</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ; <span style="color: #B900B9;">//oRTF:SetFocus(), ;</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !lAll, ;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> oRTF:<span style="color: #000000;">Find</span><span style="color: #000000;">(</span> Trim<span style="color: #000000;">(</span> cFind <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> nDir == <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, lCase, lWord <span style="color: #000000;">)</span>,;<br /> oRTF:<span style="color: #000000;">ReplaceSel</span><span style="color: #000000;">(</span> , Trim<span style="color: #000000;">(</span> cReplace <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Text not Found"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ,;<br /> oRTF:<span style="color: #000000;">ReplaceAll</span><span style="color: #000000;">(</span> , Trim<span style="color: #000000;">(</span> cFind <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> nDir == <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, lCase, lWord, lAll, Trim<span style="color: #000000;">(</span> cReplace <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">202</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> oDlg:<span style="color: #000000;">bStart</span> := <span style="color: #000000;">{</span> || oDlg:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">NOWAIT</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:39p5jjux]
In TRICHEDI.PRG
[code=fw:39p5jjux]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">CLASS</span> TRichEdit <span style="color: #0000ff;">FROM</span> TControl<br />.../...<br /> <span style="color: #00C800;">METHOD</span> ReplaceAll<span style="color: #000000;">(</span> lUndo, cFind, lDown, lCase, lWord, lAll, cText <span style="color: #000000;">)</span><br />.../...<br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ReplaceAll<span style="color: #000000;">(</span> lUndo, cFind, lDown, lCase, lWord, lAll, cText <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /> <br /> <span style="color: #00C800;">local</span> lSw := .T.<br /> <span style="color: #00C800;">local</span> nV := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nPos := ::<span style="color: #000000;">GetPos</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">DEFAULT</span> lUndo := .T.<br /><br /> <span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> lSw<br /> lSw := ::<span style="color: #000000;">Find</span><span style="color: #000000;">(</span> cFind, lDown, lCase, lWord <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> lSw<br /> nV++<br /> ::<span style="color: #000000;">ReplaceSel</span><span style="color: #000000;">(</span> lUndo, cText <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">Enddo</span><br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span> nV <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"End Replace: "</span> + StrZero<span style="color: #000000;">(</span> nV, <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" found"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"String not found: "</span> + cFind <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">SetPos</span><span style="color: #000000;">(</span> nPos <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !Empty<span style="color: #000000;">(</span> nV <span style="color: #000000;">)</span>, .T., .F. <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:39p5jjux]
In TESTRTF.RC
[code=fw:39p5jjux]<div class="fw" id="{CB}" style="font-family: monospace;"><br />REPLACE <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">34</span>, <span style="color: #000000;">96</span>, <span style="color: #000000;">315</span>, <span style="color: #000000;">141</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | 0x4L | WS_POPUP | WS_CAPTION | WS_SYSMENU<br />CAPTION <span style="color: #ff0000;">"Replace"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br /><span style="color: #000000;">{</span><br /> GROUPBOX <span style="color: #ff0000;">""</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">224</span>, <span style="color: #000000;">121</span>, BS_GROUPBOX | WS_GROUP<br /> LTEXT <span style="color: #ff0000;">"Replace:"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">17</span>, <span style="color: #000000;">46</span>, <span style="color: #000000;">9</span><br /> EDITTEXT <span style="color: #000000;">101</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">28</span>, <span style="color: #000000;">202</span>, <span style="color: #000000;">13</span><br /> LTEXT <span style="color: #ff0000;">"With:"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">46</span>, <span style="color: #000000;">9</span><br /> EDITTEXT <span style="color: #000000;">111</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">59</span>, <span style="color: #000000;">202</span>, <span style="color: #000000;">13</span><br /> GROUPBOX <span style="color: #ff0000;">"&Dirección:"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">77</span>, <span style="color: #000000;">74</span>, <span style="color: #000000;">37</span>, BS_GROUPBOX | WS_GROUP<br /> RADIOBUTTON <span style="color: #ff0000;">"Hacia &delante"</span>, <span style="color: #000000;">102</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">88</span>, <span style="color: #000000;">56</span>, <span style="color: #000000;">9</span>, BS_AUTORADIOBUTTON | WS_TABSTOP<br /> RADIOBUTTON <span style="color: #ff0000;">"Hacia &atrás"</span>, <span style="color: #000000;">103</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">99</span>, <span style="color: #000000;">56</span>, <span style="color: #000000;">9</span>, BS_AUTORADIOBUTTON | WS_TABSTOP<br /> <span style="color: #0000ff;">CHECKBOX</span> <span style="color: #ff0000;">"Coincidir &mayúsculas y minúsculas"</span>, <span style="color: #000000;">104</span>, <span style="color: #000000;">104</span>, <span style="color: #000000;">88</span>, <span style="color: #000000;">120</span>, <span style="color: #000000;">9</span>, BS_AUTOCHECKBOX | WS_TABSTOP<br /> <span style="color: #0000ff;">CHECKBOX</span> <span style="color: #ff0000;">"&Palabras completas"</span>, <span style="color: #000000;">105</span>, <span style="color: #000000;">104</span>, <span style="color: #000000;">99</span>, <span style="color: #000000;">120</span>, <span style="color: #000000;">9</span>, BS_AUTOCHECKBOX | WS_TABSTOP<br /> <span style="color: #0000ff;">CHECKBOX</span> <span style="color: #ff0000;">"Re&place All"</span>, <span style="color: #000000;">106</span>, <span style="color: #000000;">104</span>, <span style="color: #000000;">110</span>, <span style="color: #000000;">120</span>, <span style="color: #000000;">9</span>, BS_AUTOCHECKBOX | WS_TABSTOP<br /> DEFPUSHBUTTON <span style="color: #ff0000;">"&Replace"</span>, <span style="color: #000000;">201</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">14</span>, <span style="color: #000000;">62</span>, <span style="color: #000000;">15</span><br /> PUSHBUTTON <span style="color: #ff0000;">"&Cancelar"</span>, <span style="color: #000000;">202</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">36</span>, <span style="color: #000000;">62</span>, <span style="color: #000000;">15</span><br /> <span style="color: #0000ff;">ICON</span> <span style="color: #ff0000;">"Find"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">266</span>, <span style="color: #000000;">67</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">20</span><br /><span style="color: #000000;">}</span><br /> </div>[/code:39p5jjux] |
question for trichedit | Silvio, try with
[b:1qms83yf]1 Question[/b:1qms83yf]
[code=fw:1qms83yf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">METHOD</span> SaveToFile<span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> </div>[/code:1qms83yf] |
question for trichedit | Cristobal,
run good thanks !!!
only how I can show on rtf the word find (before to recplace)
I thinked to use isselection but not run ...any idea ? |
question for trichedit | [quote="cnavarro":2h53eiiq]Silvio, try with
[b:2h53eiiq]1 Question[/b:2h53eiiq]
[code=fw:2h53eiiq]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">METHOD</span> SaveToFile<span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> </div>[/code:2h53eiiq][/quote:2h53eiiq]
Cristobal before pls see the methods METHOD InsertRTF( cRTF ) CLASS TRichEdit and METHOD CanPaste( nFormat )
before there was a new data nFormat ?
I thinked to add a data into trichedit
Data nformat
add nformat on New method and redefine and on some methods
then
[code=fw:2h53eiiq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> LoadRTF<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">cFile</span> <span style="color: #0000ff;">name</span>:= cFile, ::<span style="color: #000000;">nFormat</span> := SF_RTF, ::<span style="color: #000000;">LoadFile</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> LoadTxt<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">cFilename</span> := cFile, ::<span style="color: #000000;">nFormat</span> := SF_TEXT, ::<span style="color: #000000;">LoadFile</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> LoadFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /><br /><span style="color: #00C800;">METHOD</span> LoadFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> ::<span style="color: #000000;">nFormat</span> := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">IsRTF</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cFile</span> <span style="color: #000000;">)</span>, SF_RTF, SF_TEXT <span style="color: #000000;">)</span><br /><br /> RELoadAsRTF<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, cRTF, nFormat <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">SetClear</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 /> </div>[/code:2h53eiiq]
as default on New method
nFormat := SF_RTF, ;
then we can modify [b:2h53eiiq]SaveToFile method[/b:2h53eiiq] to save rtf and txt i noyt Know how |
question for trichedit | Silvio
SaveToFile method, use MemoWrite, and not use Methods SaveAsRTF and not use SaveToRTF
I misunderstood what you need? |
question for trichedit | [quote="Silvio.Falconi":ynbzz34s]Cristobal,
run good thanks !!!
only how I can show on rtf the word find (before to recplace)
I thinked to use isselection but not run ...any idea ?[/quote:ynbzz34s]
Silvio
Modify Method Replace
Find all words, and change color or style before replace |
question for trichedit | Silvio
[b:34nxalbq][u:34nxalbq]8 Question[/u:34nxalbq][/b:34nxalbq]
You can not use Copy and Paste? |
question for trichedit | Silvio
[b:1famn2jm][u:1famn2jm]2 Question[/u:1famn2jm][/b:1famn2jm]
Modify
[code=fw:1famn2jm]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">METHOD</span> SetAttribute<span style="color: #000000;">(</span> lBold, lItalic, lUnderline, lStrikeOut, lOnOff, lLink <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> <span style="color: #00C800;">local</span> nMask, nEffects<br /><br /> <span style="color: #00C800;">DEFAULT</span> lBold := .f., ;<br /> lItalic := .f., ;<br /> lUnderline := .f., ;<br /> lStrikeOut := .f., ;<br /> lOnOff := .t., ;<br /> lLink := .f.<br /><br /> nMask := nOR<span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lBold, CFM_BOLD, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lItalic, CFM_ITALIC, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lUnderline, CFM_UNDERLINE, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lStrikeOut, CFM_STRIKEOUT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lLink, CFM_LINK, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> nEffects := nOR<span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lBold, CFE_BOLD, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lItalic, CFE_ITALIC, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lUnderline, CFE_UNDERLINE, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lStrikeOut, CFE_STRIKEOUT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lLink, CFE_LINK, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br />.../...<br /> </div>[/code:1famn2jm]
<!-- m --><a class="postlink" href="ftp://asapdata.arc.nasa.gov/incoming/rose/DevStudio/VC/INCLUDE/RICHEDIT.H">ftp://asapdata.arc.nasa.gov/incoming/ro ... RICHEDIT.H</a><!-- m --> |
question for trichedit | I saw but not run ok
on richedit,ch I add
#define CFE_SUBSCRIPT 0x00010000 /* Superscript and subscript are */
#define CFE_SUPERSCRIPT 0x00020000 /* mutually exclusive */
#define CFM_HIDDEN 0x0100
#define CFM_LINK 0x00000020 /* Exchange hyperlink extension */
#define CFM_SUBSCRIPT CFE_SUBSCRIPT | CFE_SUPERSCRIPT
#define CFM_SUPERSCRIPT CFM_SUBSCRIPT
#define CFE_ALLCAPS 0x0080
#define CFM_ALLCAPS 0x0080
on trichedit.prg
I add
[code=fw:3o52tz4s]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00C800;">METHOD</span> SetAttribute2<span style="color: #000000;">(</span> lUpp, lSup, lSub, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetUpperCaps<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> .T.,,,,, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetSupScript<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> , .T.,,,, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetSubScript<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> ,, .T.,,, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetHiddenTxt<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> ,,, .T.,, lOnOff <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetHyperLink<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">SetAttribute2</span><span style="color: #000000;">(</span> ,,,, .T., lOnOff <span style="color: #000000;">)</span></div>[/code:3o52tz4s]
[code=fw:3o52tz4s]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">METHOD</span> SetAttribute2<span style="color: #000000;">(</span> lUpper, lSuper, lSub, lHidden, lLink, lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> <span style="color: #00C800;">LOCAL</span> nMask, nEffects<br /><br /> <span style="color: #00C800;">DEFAULT</span> lUpper := .F., ;<br /> lSuper := .F., ;<br /> lSub := .F., ;<br /> lHidden := .F., ;<br /> lLink := .F., ;<br /> lOnOff := .T.<br /><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> lUpper .or. lHidden <span style="color: #000000;">)</span> .and. ! ::<span style="color: #000000;">lRE30</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> <span style="color: #00C800;">endif</span><br /><br /> nMask := nOr<span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lUpper, CFM_ALLCAPS, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lSuper, CFM_SUPERSCRIPT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lSub, CFM_SUBSCRIPT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lHidden, CFM_HIDDEN, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lLink, CFM_LINK, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> nEffects := nOr<span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lUpper, CFE_ALLCAPS, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lSuper, CFE_SUPERSCRIPT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lSub, CFE_SUBSCRIPT, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lHidden, CFE_HIDDEN, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lLink, CFE_LINK, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> RESetAttribute<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, nMask, nEffects, lOnOff <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:3o52tz4s]
for make a test I try to add a menuitem to change a word on uppercase
on testrtf.prg I add on "insert" menu
MENUITEM "&Upper characters" RESOURCE "Upper" ;
MESSAGE "Formats the selection to capital letters (toggle)" ;
ACTION (ortf:SetUpperCaps( .t. ), ;
oRtf:SetFocus() )
[b:3o52tz4s]and not run !!![/b:3o52tz4s] I not see the modify then hen I close the window let me say the file is changed !!!
but this is strange because i not see the modify on word |
question for trichedit | Silvio, I think we should make a unique setAttribute function and include all |
question of tDataRow | Hello,
I need to search for a value in all fields of the record, because I don´t know the concrete field to look for.
Is there a way to search a value in the entire contents of the fields of the record?.
Thank you. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
question of tDataRow | Do you want to find which field of datarow object contains a search string? If that is what you want:
[code=fw:31vgit65]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> FieldContaining<span style="color: #000000;">(</span> oRec, cText <span style="color: #000000;">)</span><br /> <br /> cText := Upper<span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> FieldName<span style="color: #000000;">(</span> AScan<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">aData</span>, <span style="color: #000000;">{</span> |a| cText $ Upper<span style="color: #000000;">(</span> cValToChar<span style="color: #000000;">(</span> a<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;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:31vgit65]
If the result is empty, then no field contains the search text.
If not empty that is the first field containing the text. |
question of tDataRow | Mr. Nages,
Thank you. The function always returned me blank, but I modified in this way:
function FieldContaining( oRec, cText )
return ( AScan( ArrTranspose( oRec:aData )[ 2 ], { |a| cText $ cValToChar( a ) } ) )
So, I check if its 0 (not found) or > 0, found.
Thanks <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
question on how to delete ""tab"" of Tfolder | Hello everybody,
I am not a professional programmer, doing programming as a hobby.
Recently, I am interested in TFolder class since I were allowed to maniplulate part of screen without changing whole screen.
To maximize it's usage, I tried to delete 'tab' parts, but, it generated 'error'.
REDEFINE FOLDER oFolder ID 100 OF ::oDlg PROMPTS "Product","Molecule" DIALOGS "MMGPAGE1", "MMGPAGE2"
-> it worked!
REDEFINE FOLDER oFolder ID 100 OF ::oDlg DIALOGS "MMGPAGE1", "MMGPAGE2"
-> I tried to delete "Product", "Molecule" tabs, but, it returned following error description:
Error Base/1111 Argument errer: Len
Called from Len(0)
Called from TFolder:Redefine(194)
Called from TMain:new(56)
Called from Main(33)
Please help me.
Thanks. |
question on how to delete ""tab"" of Tfolder | Hello Kim,
please have a look at FWH\samples\[color=#FF0000:2nb6rflc]Genfold.prg[/color:2nb6rflc]
As well You can also Enable / Disable a Folder-page :
oFld:aEnable = { .t., .t., .f., .f. } // .t. = enable, .f. = disable
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
question on how to delete ""tab"" of Tfolder | [quote="ukoenig":siewu6hh]Hello Kim,
please have a look at FWH\samples\[color=#FF0000:siewu6hh]Genfold.prg[/color:siewu6hh]
As well You can also Enable / Disable a Folder-page :
oFld:aEnable = { .t., .t., .f., .f. } // .t. = enable, .f. = disable
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->[/quote:siewu6hh]
Thanks so much for your advice.
Kim yong woo |
question to ""static far char cHelpTopic[ 50 ];"" | Hello Antonio, you know that i do a check of the CHM help system. I will programm the new functions SetHelpPopup() and GetHelpPopup(). Can I do this instruction in helpchm.prg from FWH and is this variable then visible in all the user-*.prg?static far char cHelpPopup[ 30 ]; //similar to "static far char cHelpTopic[ 30 ];" in help.c |
question to ""static far char cHelpTopic[ 50 ];"" | Günther,"far" is no longer needed in 32 bits, so you can define it like this:static char cHelpPopup[ 30 ];What do you want to do ? May I help you ? |
question to ""static far char cHelpTopic[ 50 ];"" | Antonio, I will define the name of the embedded txt-file in a CHM file for [b:niu4mkzq]popup[/b:niu4mkzq] help topics. I read the way (static far cHelpFile [50] ) in your help.c source file. My question is, when i define a "static (far not needed as you write above) char cHelpPopup[ 30 ]" in FWH helpchm.prg, this pointer is visible from every prg-file from the programmer, or must this declared in FWH help.c?Also should the popuphelp [b:niu4mkzq]only[/b:niu4mkzq] callable with the mouse on "?" from the dialog systemcaption. F1 should always show the normal help from dialog. Can me show the way to this?Please show also to:<!-- m --><a class="postlink" href="http://forums.fivetechsoft.com/viewtopic.php?p=63441#63441">http://forums.fivetechsoft.com/viewtopi ... 3441#63441</a><!-- m -->I will provide all source when the problems changed to not problems! <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
question to ""static far char cHelpTopic[ 50 ];"" | Antonio, any suggestion? |
question to ""static far char cHelpTopic[ 50 ];"" | Günther,If you declare a static C variable then you need to implement a function to Get or Set its contents:[code:3hppw397]
static char cHelpPopup[ 30 ];
HB_FUNC( SETGETHELPPOPUP )
{
if( hb_pcount() > 0 )
strcpy( cHelpPopup, hb_parc( 1 ) );
hb_retc( cHelpPopup );
}
[/code:3hppw397] |
question to ""static far char cHelpTopic[ 50 ];"" | Also you have to properly initialize the static variable, as the C compiler doesn't do it for you, so it will contain rubish:cHelpPopup[ 0 ] = 0; |
question to ""static far char cHelpTopic[ 50 ];"" | [quote="Antonio Linares":2pjxu8z2]Also you have to properly initialize the static variable, as the C compiler doesn't do it for you, so it will contain rubish:[/quote:2pjxu8z2]No, in C language variables with static lifetime are automatically initialized to zero.EMG |
question to ""static far char cHelpTopic[ 50 ];"" | Enrico,Yes, you are right, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
question to ""static far char cHelpTopic[ 50 ];"" | Günther,Here you have an example that will provide you a good understanding about how the help works in Windows, so you can decide how to implement it.test.prg[code:2xykj3mr]
#include "FiveWin.ch"
#define WM_HELP 0x0053
#define WM_SYSCOMMAND 0x0112
#define WM_LBUTTONDOWN 0x0201
#define SC_CONTEXTHELP 0xF180
function Main()
local oDlg := TMyDialog():New()
oDlg:Activate()
return nil
CLASS TMyDialog FROM TDialog
METHOD HelpF1() VIRTUAL
METHOD Help( nWParam, nLParam ) VIRTUAL
METHOD HandleEvent( nMsg, nWParam, nLParam )
ENDCLASS
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TMyDialog
static lContextHelp := .F.
if nMsg == WM_HELP
MsgInfo( "HandleEvent WM_HELP" )
endif
if nMsg == WM_SYSCOMMAND .and. nWParam == SC_CONTEXTHELP
MsgInfo( "HandleEvent WM_SYSCOMMAND SC_CONTEXTHELP" )
lContextHelp = .T.
endif
if nMsg == WM_LBUTTONDOWN .and. lContextHelp
MsgInfo( "HandleEvent WM_LBUTTONDOWN .and. lContextHelp" )
lContextHelp = .F.
endif
return Super:HandleEvent( nMsg, nWParam, nLParam )
[/code:2xykj3mr] |
question to ""static far char cHelpTopic[ 50 ];"" | Thanks you very much! I will implement it. |
question to ""static far char cHelpTopic[ 50 ];"" | Antonio, yesterday i have send to you an email with all required changes for better CHM help. You can add this in a new build from FWH. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.