topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
string connection MS Access | [quote="cnavarro":2eghnz9j]Also change in function FW_RDBMSName( oCn )
[code=fw:2eghnz9j]<div class="fw" id="{CB}" style="font-family: monospace;">.../...<br /> <span style="color: #00C800;">if</span> <span style="color: #ff0000;">".mdb"</span> $ c .or. <span style="color: #ff0000;">".accdb"</span> .or. <span style="color: #ff0000;">"bds"</span> $ c<br />.../... </div>[/code:2eghnz9j][/quote:2eghnz9j]
Thank you for sparing your time
Success after minor change in you suggested code
[code=fw:2eghnz9j]<div class="fw" id="{CB}" style="font-family: monospace;">.../...<br /> <span style="color: #00C800;">if</span> <span style="color: #ff0000;">".mdb"</span> $ c .or. <span style="color: #ff0000;">".accdb"</span> $ c .or. <span style="color: #ff0000;">".bds"</span> $ c<br />.../... </div>[/code:2eghnz9j] |
string connection MS Access | So it is |
string connection MS Access | [quote="bpd2000":n0vcjgdv]Dear All,
I am unable to get connection using
oCn := FW_OpenAdoConnection( cmdb + "," + pwd )
when file extension of Access file is changed from .mdb to .bds
I need help how to connect[/quote:n0vcjgdv]
[code=fw:n0vcjgdv]<div class="fw" id="{CB}" style="font-family: monospace;"> oCn := FW_OpenAdoConnection<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"MSACCESS"</span>, <filenamewithfullpath>, , , <password> <span style="color: #000000;">}</span>, .t. or .f.<span style="color: #000000;">)</span><br /> </div>[/code:n0vcjgdv] |
string sql in dbf | I am using the Microsoft Visual Foxpro library, it is possible to open DBF using SQL string I put it in cool ADORDD
ps. the opening speed and filter is super fast
link: <!-- m --><a class="postlink" href="http://www.microsoft.com/download/en/details.aspx?id=14839">http://www.microsoft.com/download/en/de ... x?id=14839</a><!-- m -->
Ronaldo Minacapelli |
string sql in dbf | see exemple
try
oRs := CreateObject("ADODB.RecordSet")
oRs:CursorLocation := adUseClient
oRs:LockType := adLockOptimistic
oRs:CursorType := adOpenDynamic
oRs:ActiveConnection := "Provider=VFPOLEDB.1;Data Source="+Curdrive()+":\"+Curdir()+";Mode=Read;Extended Properties=DBASE IV"
catch
oDlg:Refresh()
If MsgYesno("Erro no acesso ao OLEDB Visual FoxPro, deseja baixa-lo agora? ","Drive VFP")
ShellExecute( 0, "open", "http://www.bazevani.com.br/atualizacao/VFPOLEDBSetup.msi" )
Else
oDlg:Refresh()
MsgStop("Operação cancelada, necessário a instalação do drive: OLEDB Visual FoxPro","Erro !")
Endif
oDlg:Refresh()
return(.T.)
end
try
oRs:Source := cSQL1
oRs:Open()
catch
oDlg:Refresh()
MsgStop("Operação cancelada, ocorreu alguem problema na leitura do arquivo internet.dbf","Erro !")
oDlg:Refresh()
return(.T.)
end
While .NOT. oRs:Eof
nNro := oRs:Fields("Imovel"):value |
string to array | I have this string
|First|== exactamente igual|frank
and I wish create an array 4 columns
cOperator := ALLTRIM( StrToken( aRighefiltro[k],1 , "|" ) )
cField := ALLTRIM( StrToken( aRighefiltro[k], 2, "|" ) )
cCondition := LEFT(ALLTRIM( StrToken( aRighefiltro[k], 3, "|" ) ),2)
cEspressione := ALLTRIM( StrToken( aRighefiltro[k], 4, "|" ) )
RowData := { cOperator, cField, cCondition, cEspressione}
AaDd(aRighe, RowData)
xbrowser aRighe
IF the first value is Empty the array aRighe not calculate the exact column |
string to array | Try this:
[code=fw:1dog8fow]<div class="fw" id="{CB}" style="font-family: monospace;">aTokens := HB_aTokens<span style="color: #000000;">(</span> cString, <span style="color: #ff0000;">"|"</span> <span style="color: #000000;">)</span><br /><br />cOperator := aTokens<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br />cField := aTokens<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br />cCondition := aTokens<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><br />cEspressione := aTokens<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span></div>[/code:1dog8fow] |
string to array | aString := StringToArray( cString, "|" )
FUNCTION StringToArray( cString, cSeparator )
LOCAL nPos
LOCAL aString := {}
DEFAULT cSeparator := ";"
cString := ALLTRIM( cString ) + cSeparator
DO WHILE .T.
nPos := AT( cSeparator, cString )
IF nPos = 0
EXIT
ENDIF
AADD( aString, SUBSTR( cString, 1, nPos-1 ) )
cString := SUBSTR( cString, nPos+1 )
ENDDO
RETURN ( aString ) |
structure inside structure | Hey guys,I'm still working with that dll and now i faced another problem.One parameter is a structure that one of the member is a structure.i tried this:[code:onhpbgfu]
STRUCT payload
MEMBER Length AS DWORD
MEMBER Data AS LONG
ENDSTRUCT
STRUCT textfir
MEMBER IsWideChar AS BOOL
MEMBER TextFIR AS payload
ENDSTRUCT
[/code:onhpbgfu]I declared the member textfir as payload structure, but it didnt work.I was suppose to change the tstruct class but before I prefered post my problem here!thanks again for any help! |
structure inside structure | You can declare the nested structure as a STRING with a length of its structure:MEMBER TextFIR AS STRING LEN payload:SizeOf()Will you provide data in such structure or will you receive data from it ?In both cases, you can use payload:cBuffer to transfer the info to/from TextFIR |
structure inside structure | i got it!I'm gonna receive data from this structure....One more time thanks again! |
structure inside structure | Diego,you are welcome <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
stucture of SQL table | Dear Mr. Rao,
how can we get the structure of a SQL table.
Can you please tell me where I can find documentation for maria lib.
Thank you in advance
Otto |
stucture of SQL table | In SQL it is referred to as DDL.
<!-- m --><a class="postlink" href="https://stackoverflow.com/questions/6597890/how-to-generate-ddl-for-all-tables-in-a-database-in-mysql">https://stackoverflow.com/questions/659 ... e-in-mysql</a><!-- m -->
show create table <database name>.<table name>;
Robb |
stucture of SQL table | If you are using FWMariaDB
[code=fw:2yiwsugd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aStruct := oRs:<span style="color: #000000;">aStructure</span><br /> </div>[/code:2yiwsugd]
If you are using any ADO connection
[code=fw:2yiwsugd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> aStruct := FWAdoStruct<span style="color: #000000;">(</span> oRs <span style="color: #000000;">)</span><br /> </div>[/code:2yiwsugd] |
style of xbrowse - Resolved!! | I have a xbrowse on a explorerbar
how could i go about hiding that it is an xbrowse table?
removing the header and lines and borders and scrolls
[img:289jhksx]https://i.postimg.cc/YSDQcVdr/testvtask.png[/img:289jhksx]
I do not remember where I saw it but in a test there was aun xbrowse but then it did not look like this and the data was displayed in the form of a table but you did not see that it was an xbrowse
any solution pls ? |
style of xbrowse - Resolved!! | Resolved !!!!
[img:2hrgwddv]https://i.postimg.cc/sXn6Nwh7/ok.png[/img:2hrgwddv] |
sub menus | As I move my Clipper submenuing (cascading) menus in to a more "Windows" style, I'm confused on the direction to take.
Currently in Clipper I have a main menu function() of 2 selections that selects a sub menu function() of 3 selections, that further selects a sub sub menu function() of 4 selections and so on.
I gather this is the "old" way of doing it, but it seems that using menu, menuitem will only allow 1 level down.
Or, is this cascading menu supposed to be accomplished thru some MDI child setup.
I do not find anything in \samples folder that goes down more than one level, although the FiveDbu.prg example has a recent files option that touches on it.
How is accomplished in FW?
Bruce |
sub menus | Bruce
I prefer Buttonbars or Toolbars with a combination of MDI menus .. have a look at these samples
Buttonbars:
Test2007.prg
Customer.prg
Toolbars:
Toolbar1.prg
Toolbar2.prg
Rick Lipkin |
sub menus | Bruce,
You can use as many submenus as needed:
[code=fw:3gyoz4e5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">MENU</span> oMenu<br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Files"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Another"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"And more"</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> </div>[/code:3gyoz4e5] |
sub menus | Antonio,
I will check my arrangement of the menuitem layout for errors, now confirming it is possible.
Rick,
Appreciate your suggestions and direction to some relative examples.
There sure are some slick solutions available.
Its all new.
Bruce |
sub menus | Bruce,
Cascading menus are tedious to use. You may note that most windows apps limit pull-down menus to two levels deep. Any more can get difficult to handle with a mouse.
You can consider an interface redesign possibly putting the third level in a combo box on a dialog that is called from the second level menu.
I recommend this book for learning about interface design: About Face 2.0, The Essentials of Interaction Design by Alan Cooper. There is a version 3 also but I prefer 2.0. You can get this on Amazon.
Regards,
James |
subir achivo a un mysql... | Hola.
Tengo un archivo .txt que a lo sumo puede pesar 200K y quiero almacenarlo en una DB con Mariadb.
tienen algun ejemplo de como subir estos tipos de achvos?
gracias |
subir achivo a un mysql... | En un campo tipo text?
[code=fw:2oria573]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cText := MemoRead<span style="color: #000000;">(</span><span style="color: #ff0000;">'miarchivo.txt'</span><span style="color: #000000;">)</span><br />oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"UPDATE mitabla SET campotexto = "</span>+Clipvalue2Sql<span style="color: #000000;">(</span>cText<span style="color: #000000;">)</span> + <span style="color: #ff0000;">" where id= 1"</span><span style="color: #000000;">)</span><br /> </div>[/code:2oria573]
Yo uso Dolphin, tendrias que encontrar el equivalente en la clase nativa |
subir achivo a un mysql... | bien. gracias. |
subrayado en tword con write() | Que tal Amigos:
Tengo documento creado con tword solo que quiero subrayar una parte del texto, con la funcion write() no me da esa opcion, ya le puse VK_VCONTROL+"S" ,"^S", entre otros y nada, creo que debe ser mas sencillo pero.... no se como.
Les agradezco su ayuda...
Saludos |
such seek | is possible such seek in DBFCDX
trakputer
komputer
winputer
dbseek(*put,)
best regards
kajot |
such seek | OrdWildSeek( "*PUT*" ) |
such seek | Thanks
is any function to scope with wildchar
best regards
kajot |
such seek | [quote="kajot":3mkvpqvl]Thanks
is any function to scope with wildchar
best regards
kajot[/quote:3mkvpqvl]
Obviously NO. |
sudden problem with tscrollpanel -RESOLVED | if I press the vertical scroll it does not go forward. I can only scroll with the mouse wheel
What's happened ?
[img:2hiehxox]https://i.postimg.cc/HkSqjYTL/err-scroll.gif[/img:2hiehxox]
the same problem I have on another tscrollpanel
[img:2hiehxox]https://i.postimg.cc/KjvVmwCT/erro2.gif[/img:2hiehxox]
with the older version of fwh it worked fine without errors.
I saw that with fwh 19.05 run ok
with fwh 21.1, 21.2 and last fwh not run ok |
sudden problem with tscrollpanel -RESOLVED | Silvio,
We are checking it
many thanks for your great feedback |
sudden problem with tscrollpanel -RESOLVED | [quote="Antonio Linares":3k7n4qlj]Silvio,
We are checking it
many thanks for your great feedback[/quote:3k7n4qlj]
I sent you a test sample |
sudden problem with tscrollpanel -RESOLVED | Please
there are news for the scroll panel, I have all blocked, I cannot scroll the umbrellas on the beach or select the products
the scrollpanel does not work
what has been changed? |
sudden problem with tscrollpanel -RESOLVED | [quote:8u41vch2]ok now run ok
Nages corrected it and sent me a new release[/quote:8u41vch2]
Solved by Mr. Rao |
sudden problem with tscrollpanel -RESOLVED | yes..and i am happy |
sugerencia BTNBMP look 2010 | Hola,
Por favor, implementar el estilo 2010, añadiendo la cláusula 2010, pues el 2007 ya está algo desfasado.
Gracias. |
sugerencia BTNBMP look 2010 | Hola,
¿Algún comentario por parte de Fivetech?.
Gracias. |
sugerencia BTNBMP look 2010 | up |
sugerencia BTNBMP look 2010 | Lucas
como seria ese look? tienes una imagen que nos muestre como seria?
puedes crear un ejemplo que tenga los colores que dices y ver si los podemos añadir como parte del default |
sugerencia BTNBMP look 2010 | Daniel,
Muchas gracias por responder.
Pues en lugar del azul del look 2007 debe ser como los botones de la Ribbon con la cláusula 2010. |
sugerencia BTNBMP look 2010 | Lucas
Los botones ribbon (clase TRBTN) solo se pintan diferentes cuando se usa la clausula 2010 en la ribbonbar, de forma nativa no tienen la clausula 2010, de hecho el comando ADD BUTTON para agregar el boton al grupo tampoco tiene la clausula 2010
la clausula 2007 de la clase BTNBMP es para poder usar colores degragados en los botones, esos colores son totalmente configurables desde nuestros PRGs, agregar una clausula 2010 seria hacer exactamente los mismo q la clausula 2007 solo que con colores diferentes, lo que solo nos traeria un simple esfuerzo de agregar un par de lineas de codigo a nuestros PRG para tener el look deseado a nuestra conveniencia |
sugerencia BTNBMP look 2010 | Daniel,
Creo que es bastante factible que la propia clase BTNBMP soporte ese estilo, al fin y al cabo es cortar y pegar el código de 2007 cambiando los colores a 2010.
Parece que desde Fivetech no se presta demasiada atención al interface gráfico, que es lo que vende una aplicación. Y tener botones en 2012 con look 2007 no es muy avanzado <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->. |
sugerencia BTNBMP look 2010 | Lucas
Lamento no haberme explicado claramente, pues por tu comentario difiero totalmente de lo que que expresas
[quote="lucasdebeltran":3gwj7sfd]Parece que desde Fivetech no se presta demasiada atención al interface gráfico[/quote:3gwj7sfd]
justamente por estar pendientes de eso es que funciona de forma parametrizable para no restringir al programador a usar colores preestablecidos, hasta el punto que el usuario final pueda cambiar los colores de los botones que usa si lo desea...
la clausula 2007 solo abre la posibilidad de usar degradados, los valores por default son azules, pero facilmente configurables
al agregar la clausula 2010 a la btnbmp solo se cambiarian las datas que manejan los colores, ahora imagina si windows determina este año sacar un look nuevo? entonces tambien habria que agregar la clausula 2012??, me parece totalmente infucnional hacer validaciuones innecesarias a nivel de clase solo para cambiar un color, cuando tenemos pleno control del objeto, en nuestros PRGs solo involucra una linea de codigo adicional y q aparte no nos limita a usar los colores que queramos..
el hecho que no estes de acuerdo en la forma como esta diseñado un control no significa que "Fivetech no se presta demasiada atención al interface gráfico", puedo nombrarte otras clases pensando exactamente en eso, que no son nativas de windows, y que se han diseñado para ofrecer una mejor interfaz grafica y manipulacion de datos, como esta xbrowse, folderex, meterex, controles ribbon(ribbonbar, rbbtn, rbgroup), buttonbar, tselex, explorerlist, vistamenu, etc...
te dejo un ejemplo funcional de como hacer tu propio skin usando la clausula GRADIENT sin necesidad de cambiar la clase
[code=fw:3gwj7sfd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">static</span> oWnd<br /> <br /><span style="color: #B900B9;">//----------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBtn,oFont<br /> <span style="color: #00C800;">local</span> cVer := FWVERSION<br /> <span style="color: #00C800;">local</span> bGrad := <span style="color: #000000;">{</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! lInvert, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">230</span>, <span style="color: #000000;">234</span>, <span style="color: #000000;">239</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">253</span>, <span style="color: #000000;">222</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">151</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">2</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">215</span>, <span style="color: #000000;">84</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">162</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ;<br /> <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;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"MS SANS SERIF"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">dialog</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Rounded Buttons in "</span> + cVer <span style="color: #0000ff;">size</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span><br /> <br /> @ <span style="color: #000000;">5</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">70</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> cVer <span style="color: #000000;">2007</span> ; <br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">CENTER</span>;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Hello"</span><span style="color: #000000;">)</span> ;<br /> GRADIENT bGrad<br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">75</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">60</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&"</span> + cVer <span style="color: #000000;">2007</span> ; <br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">CENTER</span>;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Yes"</span> <span style="color: #000000;">)</span> ;<br /> GRADIENT bGrad<br /><br /> @ <span style="color: #000000;">70</span>, <span style="color: #000000;">165</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">60</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> cVer + CRLF + <span style="color: #ff0000;">"FIVEWIN"</span> <span style="color: #000000;">2007</span> ; <br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">CENTER</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Hello"</span><span style="color: #000000;">)</span> ;<br /> GRADIENT bGrad<br /> <br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oWnd <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:3gwj7sfd] |
sugerencia BTNBMP look 2010 | Daniel,
Quizás yo debo de ser muy tonto. Si lo que tu me dices es cierto, entonces sobra el estilo 2007.
En todo caso, creo que es mucho más fácil definir un botón con la cláusula 2010 que montar todo ese tinglado que me acabas de indicar muy amablemente.
Y en la clase únicamente hay que tocar:
[code=fw:3dim6fsu]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> l2007<br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bClrGrad</span> := <span style="color: #000000;">{</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lInvert, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">253</span>, <span style="color: #000000;">222</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">151</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">2</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">215</span>, <span style="color: #000000;">84</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">162</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ;<br /> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">2</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">219</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">244</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">207</span><span style="color: #000000;">-50</span>, <span style="color: #000000;">221</span><span style="color: #000000;">-25</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">2</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">201</span><span style="color: #000000;">-50</span>, <span style="color: #000000;">217</span><span style="color: #000000;">-25</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">231</span>, <span style="color: #000000;">242</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ;<br /> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span></div>[/code:3dim6fsu]
Añadiendo l2010 con los nRGBs que no se exactamente cuales son, pero vamos, sería cuestión de ir probando.
Además, curiosamente veo que en brnbmp.prg ya se prevé en parte el estilo 2010, pues hay comprobaciones del mismo !!!.
Algo me debo perder lo siento. Vamos, que si Fivetech no añade una cláusula 2010 lo puedo hacer yo naturalmente en el prg, ahora bien, en cada update tengo que estar modificando los fuentes de las clases. Y resulta que ni FW 11.12 ni 12.01 son utilizables pues tienen bugs reportados ampliamente y no resueltos. Luego son unas cuantas modificaciones que no me paga el cliente!!!. |
sugerencia BTNBMP look 2010 | no tienes porque modificar la clase...
te muestro nuevamente el ejemplo, te recalco esta parte [b:3rzyznq2][size=150:3rzyznq2]sin necesidad de cambiar la clase[/size:3rzyznq2][/b:3rzyznq2]
si facilmente puedes escribir 2010 y en vez de cambiar el 2007 por el 2010, puedes agregar esta linea [b:3rzyznq2]GRADIENT bGrad[/b:3rzyznq2], amigo es muy simple y no tocas la clase y puedes hasta ofrecer un modulo de configuracion de colores en tu sistema, lo que propones es innesesario (a mi punto de vista)
[quote="Daniel Garcia-Gil":3rzyznq2]te dejo un ejemplo funcional de como hacer tu propio skin usando la clausula GRADIENT sin necesidad de cambiar la clase
CODE: SELECT ALL COLLAPSE VIEW
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------//
function Main()
local oBtn,oFont
local cVer := FWVERSION
local bGrad := { | lInvert | If( ! lInvert, ;
{ { 1, nRGB( 255, 255, 255 ), nRGB( 230, 234, 239 ) } }, ;
{ { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2/3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } ;
} ) }
DEFINE FONT oFont NAME "MS SANS SERIF" SIZE 0,-12
DEFINE dialog oWnd TITLE "Rounded Buttons in " + cVer size 500, 300 PIXEL
@ 5, 10 BTNBMP oBtn OF oWnd ;
SIZE 60, 70 ;
PROMPT cVer 2007 ;
FONT oFont CENTER;
ACTION MsgInfo("Hello") ;
GRADIENT bGrad
@ 10, 75 BTNBMP oBtn OF oWnd ;
SIZE 60, 60 ;
PROMPT "&" + cVer 2007 ;
FONT oFont CENTER;
ACTION MsgInfo( "Yes" ) ;
GRADIENT bGrad
@ 70, 165 BTNBMP oBtn OF oWnd ;
SIZE 80, 60 ;
PROMPT cVer + CRLF + "FIVEWIN" 2007 ;
FONT oFont CENTER ;
ACTION MsgInfo("Hello") ;
GRADIENT bGrad
ACTIVATE DIALOG oWnd CENTER
return nil
[/quote:3rzyznq2]
nota adicional: la clausula GRADIENT se agrego exactamente para evitar crear "estilos" |
sugerencia BTNBMP look 2010 | Lucas,
[quote:u00h8pxp]Y resulta que ni FW 11.12 ni 12.01 son utilizables pues tienen bugs reportados ampliamente y no resueltos[/quote:u00h8pxp]
Puedes indicar cuales son esos bugs ? FWH 12.01 funciona realmente bien en todas nuestras pruebas.
Antes de hacer una afirmación asi, te ruego que medites un poco lo que dices... |
sugerencia BTNBMP look 2010 | Antonio,
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23395">viewtopic.php?f=3&t=23395</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23392">viewtopic.php?f=3&t=23392</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23389">viewtopic.php?f=3&t=23389</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23387">viewtopic.php?f=3&t=23387</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23358">viewtopic.php?f=3&t=23358</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23336">viewtopic.php?f=3&t=23336</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23316">viewtopic.php?f=3&t=23316</a><!-- l -->
En todo caso, muchas gracias por vuestra atención y excelente soporte. Siempre todos los inconvenientes se solucionan de forma rápida y eficaz, cosa que no pasa con todos los productos. |
sugerencia BTNBMP look 2010 | Lucas,
Todos esos temas que comentas estan tratados, contestados y con soluciones propuestas. Son pequeños detalles, no bugs que no permitan usar un producto.
De ahi a decir que la versión 12.01 no es utilizable hay un abismo.
Por favor, un poco de cordura, porque lo que se dice aqui lo lee mucha gente y decir algo asi es hacernos daños a nosotros mismos innecesariamente. |
sugerencia BTNBMP look 2010 | muchos de los problemas con group, vienen de la forma como ordenamos los controles en un dialogo,
normalmente nosotros los programadores estamos constantemente insertando controles aqui, alla, aca.
y en determinado momento el control se pinta antes del group, luego cuando se pinta el group este oculta los controles que estan por debajo
del group, yo he experimentado este problema, y tengo que recurrir al ordenamiento y numeracion correcta de los items.
si se que cuando el dialogo esta trasparente dan problemas algunas cosas, pero me falta encontrar la situacion correcta para poner un ejemplo
facilmente compilable por AL o D y que ellos ubiquen el problema.
muchos de los problemas reportados no pueden ser facilmente rasteables por fivetech de ahi que ellos pidan que en lo posible
se cree un prg que muestre el error, pero son pocos los que reportan problemas en fwh y que se tomen el tiempo para crear un ejemplo que
reprodusca la falla.
yo en la medida de lo posible, cuando encuentro un problema, creo un ejemplo que lo contenga, y ahora ya primero trato de corregirlo
por mi mismo, ya cuando no puedo o llego a un nivel que no tengo, solicito ayuda a los gurus. esto ha provocado que de aca a un tiempo sepa un poco mas que antes. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->, claro yo soy programador por hobby mas que todo y me puedo dar ese lujo de estar contantemente tratando de aprender, se que otros programadores por motivos de trabajo (tiempos de entrega, etc) no pueden darse ese lujo. pero corremos con el riegos de estancarnos si no nos damos tiempo para profundizar en las herramientas que usamos. (hay que conocer el compilador y hasta donde llega su poder, y de fwh como libreria gui)
eso que tu pides (efecto 2010 en btnbmp) lo puedes hacer ya sea alterando la clase como tu mismo piensas, o como te sugirio Daniel mediante parametros que la misma clase tiene, o mi via que es usar los methodos extendidos de xharbour, ahora harbour los soporta tambien con la lib xhb.lib, los cuales permiten alterar las datas y methods de una clase particular ya sea de fwh o cualqueir otra, sin afectar el codigo original. aca pongo un ejemplo.
[code=fw:je6zb0lo]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*procedimiento para reemplazar methodos o agregar nuevos a clases de fwh*/</span><br />PROCEDURE OverrideAndExtend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> EXTEND <span style="color: #00C800;">CLASS</span> TFOLDER WITH <span style="color: #00C800;">METHOD</span> RefreshPages<br /> EXTEND <span style="color: #00C800;">CLASS</span> TFOLDER WITH <span style="color: #00C800;">METHOD</span> GoFirstControl<br /><br /> EXTEND <span style="color: #00C800;">CLASS</span> TDIALOG WITH <span style="color: #00C800;">METHOD</span> RefreshDialog<br /> EXTEND <span style="color: #00C800;">CLASS</span> TDIALOG WITH <span style="color: #00C800;">METHOD</span> MySetFocus<br /> EXTEND <span style="color: #00C800;">CLASS</span> TDIALOG WITH <span style="color: #00C800;">METHOD</span> MyCountControl<br /><br /> EXTEND <span style="color: #00C800;">CLASS</span> TCONTROL WITH <span style="color: #00C800;">METHOD</span> MyDisable<br /><br /> EXTEND <span style="color: #00C800;">CLASS</span> TXBROWSE WITH <span style="color: #00C800;">METHOD</span> MyConfig<br /> EXTEND <span style="color: #00C800;">CLASS</span> TXBROWSE WITH <span style="color: #00C800;">METHOD</span> SetMyBmpSort<br /><br /> EXTEND <span style="color: #00C800;">CLASS</span> TPRINTER WITH <span style="color: #00C800;">METHOD</span> Cm2PixX<br /> EXTEND <span style="color: #00C800;">CLASS</span> TPRINTER WITH <span style="color: #00C800;">METHOD</span> Cm2PixY<br /> EXTEND <span style="color: #00C800;">CLASS</span> TPRINTER WITH <span style="color: #00C800;">METHOD</span> SayText<br /> EXTEND <span style="color: #00C800;">CLASS</span> TPRINTER WITH <span style="color: #00C800;">DATA</span> nPxL<br /> EXTEND <span style="color: #00C800;">CLASS</span> TPRINTER WITH <span style="color: #00C800;">DATA</span> nPxC<br /><br /> OVERRIDE <span style="color: #00C800;">METHOD</span> GetDlgCode IN <span style="color: #00C800;">CLASS</span> TButton WITH KGetDlgCode<br /><br /><span style="color: #00C800;">RETURN</span><br />...<br /><br /><span style="color: #00C800;">FUNCTION</span> KGetDlgCode<span style="color: #000000;">(</span> nLastKey <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> <span style="color: #00C800;">Self</span> := HB_QSelf<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nLastKey</span> := nLastKey<br /><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oWnd</span> != <span style="color: #00C800;">NIL</span> .and. <span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TFOLDER"</span> <span style="color: #000000;">)</span> .or. ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TFOLDEREX"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> DLGC_WANTALLKEYS<br /> <span style="color: #00C800;">CASE</span> nLastKey == VK_ESCAPE .and. ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oWnd</span> != <span style="color: #00C800;">NIL</span> .and. <span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TWINDOW"</span> <span style="color: #000000;">)</span> .and. ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TDIALOG"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> DLGC_WANTALLKEYS<br /> <span style="color: #00C800;">ENDCASE</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*-------------------------------------------------------------------------------------------------*/</span><br /><span style="color: #B900B9;">/*funcion nueva para method de tget*/</span><br /><span style="color: #00C800;">FUNCTION</span> MyDisable<span style="color: #000000;">(</span> aNameCtrl <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> <span style="color: #00C800;">Self</span> := HB_QSelf<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> IN aNameCtrl <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">bWhen</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">Disable</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><br /><br /><span style="color: #00C800;">FUNCTION</span> SetMyBmpSort<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> <span style="color: #00C800;">Self</span> := HB_QSelf<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oBmp, hBmp<br /><br /> ::<span style="color: #000000;">aSortBmp</span> := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"BMS_ARROWDOWN"</span><br /> hBmp := oBmp:<span style="color: #000000;">hBitmap</span><br /> AAdd<span style="color: #000000;">(</span> ::<span style="color: #000000;">aSortBmp</span>, <span style="color: #000000;">{</span> hBmp, <span style="color: #000000;">0</span>, nBmpWidth<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span>, nBmpHeight<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span>, <span style="color: #00C800;">FALSE</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"BMS_ARROWUP"</span><br /> hBmp := oBmp:<span style="color: #000000;">hBitmap</span><br /> AAdd<span style="color: #000000;">(</span> ::<span style="color: #000000;">aSortBmp</span>, <span style="color: #000000;">{</span> hBmp, <span style="color: #000000;">0</span>, nBmpWidth<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span>, nBmpHeight<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span>, <span style="color: #00C800;">FALSE</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:je6zb0lo]
yo soy de los que piensa, que en fwh por estar poniendo nuevos aspectos y corrigiendo estas florituras (trasparencias/gradients/skins), no se optimiza su timpo en efocarse en aspectos basicos del core (saltos de focos) que a estas alturas deberia estar al 100%, pero lamentablemente todos sabemos que lo que muestres en pantalla influye mucho en el cliente, y a la mayoria de los clientes no le gusta aspectos espartanos. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
pero aca estamos, este es el barco y todos debemos apoyarnos para que llegue a buen puerto.
salu2 |
sugerencia BTNBMP look 2010 | Reitero nuevamente el agradecimiento al equipo de Fivetech, especialmente a Daniel por su siempre tan pronta y eficaz ayuda. |
sugerencia BTNBMP look 2010 | Yo uso la versión 12.01 y es estable.
La tengo funcionando en todas las aplicaciones y en todos los clientes que tengo y no hay ningún problema.
Y te aseguro que mis aplicaciones menos sencillas son todo lo que quieras y además están funcionando 24 horas al día. |
sugerencia BTNBMP look 2010 | Amor y Paz. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
sugerencia GET ACTION XXX | Hola,
Creo que en la funcionalidad REDEFINE GET cGET ACTION BLABLA() BITMAP "XXX" falta el TOOLTIP sobre el bitmap.
Gracias. |
sugerencia GET ACTION XXX | Lucas...
redefine get miGet ......
miGet:cToolTip:="Este es mi tooltip" |
sugerencia GET ACTION XXX | Adolfo,
El tooltip lo tiene que ser del botón, como BTNBMP TOOLTIP.
Es una cosa que falta y sería muy interesante, porque si usas la cláusula ACTION en el get y el usuario pone el cursor sobre el botón no sale el tooltip. |
sugerencia GET ACTION XXX | Hola,
¿Algún comentario por parte de Fivetech?.
Gracias. |
sugerencia GET ACTION XXX | up |
sugerencia RICHEDIT | Hola,
Por favor, ¿sería posible que el menú contextual de Copy, Cut, Align,etc. apareciera en el idioma del SO?.
Y para el título del Preview, ¿que en lugar de FWH RICHEDIT FILE fuera el título del Diálogo?.
También sería interesante que los mensajes y textos de FWH aparecieran en el idioma del Sistema Operativo o, al menos, que estuvieran en un único .ch para poderlo traducir y no tener que cambiar las clases con cada nueva build de FWH.
Muchas gracias <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->. |
sugerencia RICHEDIT | Me sumo a esta propuesta.
Saludos
Fernando Espinoza |
sugerencia RICHEDIT | Pasa también lo mismo con los Memos.
El menú sale en inglés. |
sugerencia RICHEDIT | Lucas.
Puedes Sobre-Escribir los metodos,, Tener un PRG exclusivo con los metodos nuevos y al que debes llamar antes de iniciar la ventana principal
En este caso el metodo RButtonDown( nRow, nCol, nFlags ) de tRichEdit y de mGet
OVERRIDE METHOD RbButtonDown IN CLASS TRichEdit WITH MiRButtonDown
En tu metodo MiRbuttonDown puedes escribir los menues en Español, o tener algo que identifique que lenguaje utilizar y tienes una solución.
Por lo que veo para que Fivetech solucione ese problema, debera tener un .CH con los mensajes en los distintos idiomas y llamarlos de acuerdo a un flag que le indique cual usar.
Espero que te sirva.
Desde Chile
Adolfo |
sugerencia RICHEDIT | [quote="Adolfo":391u5hhv]Lucas.
Puedes Sobre-Escribir los metodos,, Tener un PRG exclusivo con los metodos nuevos y al que debes llamar antes de iniciar la ventana principal
En este caso el metodo RButtonDown( nRow, nCol, nFlags ) de tRichEdit y de mGet
OVERRIDE METHOD RbButtonDown IN CLASS TRichEdit WITH MiRButtonDown
En tu metodo MiRbuttonDown puedes escribir los menues en Español, o tener algo que identifique que lenguaje utilizar y tienes una solución.
Por lo que veo para que Fivetech solucione ese problema, debera tener un .CH con los mensajes en los distintos idiomas y llamarlos de acuerdo a un flag que le indique cual usar.
Espero que te sirva.
Desde Chile
Adolfo[/quote:391u5hhv]
Adolfo,
OVERRIDE METHOD funciona en Harbour?
Creo que no. Si es así, como sería en Harbour? |
sugerencia RICHEDIT | LUCAS...
Tal como te respondio Przemys?aw Czerpak en abril del 2011, la solucion esta en el \\harbour-3.0.0\doc\xhb-diff.txt
### RUNTIME CLASS MODIFICATION ###
========================================
Harbour and xHarbour use dynamic bindings so it's possible to modify class
definitions at runtime. To avoid possible very serious problems which can
be caused by such class modification Harbour provides LOCKED clause in class
definition. xHarbour does not have such functionality and even documented
command like OVERRIDE CLASS or EXTEND CLASS as official features though
they break inheritance scheme and never worked correctly in the whole
xHarbour history. They are available in Harbour only in xHarbour compatible
library after including xhbcls.ch for porting existing xHarbour code to
Harbour and work exactly like in xHarbour having the same problems so they
are not planned to be part of Harbour core code.
O sea Incluir xhbcls.ch en tu prg, y la libreria xdiff.lib y/o xhb.lib pero con las restricciones y posibles errores que puedes tener.
Luego utilizas el OVERRIDE
Carlos he ahi tambien la respuesta, no existe en HARBOUR pero puede usarse en modo compatibilidad.
Desde Chile
Adolfo |
sugerencia RICHEDIT | [quote="Adolfo":1oktcf1u]LUCAS...
Tal como te respondio Przemys?aw Czerpak en abril del 2011, la solucion esta en el \\harbour-3.0.0\doc\xhb-diff.txt
### RUNTIME CLASS MODIFICATION ###
========================================
Harbour and xHarbour use dynamic bindings so it's possible to modify class
definitions at runtime. To avoid possible very serious problems which can
be caused by such class modification Harbour provides LOCKED clause in class
definition. xHarbour does not have such functionality and even documented
command like OVERRIDE CLASS or EXTEND CLASS as official features though
they break inheritance scheme and never worked correctly in the whole
xHarbour history. They are available in Harbour only in xHarbour compatible
library after including xhbcls.ch for porting existing xHarbour code to
Harbour and work exactly like in xHarbour having the same problems so they
are not planned to be part of Harbour core code.
O sea Incluir xhbcls.ch en tu prg, y la libreria xdiff.lib y/o xhb.lib pero con las restricciones y posibles errores que puedes tener.
Luego utilizas el OVERRIDE
Carlos he ahi tambien la respuesta, no existe en HARBOUR pero puede usarse en modo compatibilidad.
Desde Chile
Adolfo[/quote:1oktcf1u]
Adolfo,
En xHarbour de noviembre de 2010 no encuentro estos ficheros; esperaré a actualizarme.
gracias. |
sugerencia RICHEDIT | Hola,
¿Algún comentario por parte de Fivetech?.
Gracias. |
sugerencia RICHEDIT | Adolfo,
Esa solución no es operativa. Primero, si buscas posts con OVERRIDE, verás que Antonio desaconseja su uso.
En segundo lugar, si se hace algún cambio en ese método seguiremos usando el método anterior. Lo cual no vale para nada, porque si queremos estar actualizados tenemos que estar editando cada mes los .prgs y perdiendo tiempo.
Mira el ejemplo de rpreview.prg y uno de sus métodos. No es factible usar el override, pues si hay un cambio seguiré con la versión vieja:
[code=fw:9o3f0i3i]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> BuildWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TPreview<br /><br /> <span style="color: #00C800;">local</span> oIcon, cTitle := <span style="color: #ff0000;">"FiveWin Printing Preview"</span>, oCursor, oBar, nCol := <span style="color: #000000;">325</span><br /> <span style="color: #00C800;">local</span> oThis := <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">local</span> nRow := <span style="color: #000000;">7</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">oWndMain</span> := WndMain<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">hOldRes</span> := GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! File<span style="color: #000000;">(</span> ::<span style="color: #000000;">cResFile</span> <span style="color: #000000;">)</span><br /><br /> #ifdef __CLIPPER__<br /> ::<span style="color: #000000;">cResFile</span> := <span style="color: #ff0000;">"Preview.dll"</span><br /> #else<br /> <span style="color: #00C800;">if</span> ! IsWin64<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cResFile</span> := <span style="color: #ff0000;">"Prev32.dll"</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">cResFile</span> = <span style="color: #ff0000;">"Prev64.dll"</span><br /> <span style="color: #00C800;">endif</span><br /> #endif<br /><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> SetResources<span style="color: #000000;">(</span> ::<span style="color: #000000;">cResFile</span> <span style="color: #000000;">)</span> < <span style="color: #000000;">32</span><br /> MsgStop<span style="color: #000000;">(</span> ::<span style="color: #000000;">cResFile</span> + <span style="color: #ff0000;">" not found, imposible to continue"</span>,;<br /> <span style="color: #ff0000;">"FiveWin Printing Error"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">hNewRes</span> := GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oDevice</span> != <span style="color: #00C800;">nil</span><br /> cTitle = ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">cDocument</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oWndMain</span> != <span style="color: #00C800;">nil</span><br /> oIcon = ::<span style="color: #000000;">oWndMain</span>:<span style="color: #000000;">oIcon</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIcon <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Print"</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont</span> <span style="color: #0000ff;">NAME</span> GetSysFont<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-12</span><br /><br /> ::<span style="color: #000000;">CheckStyle</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> !::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">lPrvModal</span> .and. ::<span style="color: #000000;">oWndMain</span> != <span style="color: #00C800;">nil</span> .and. ;<br /> Upper<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWndMain</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TMDIFRAME"</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> ;<br /> <span style="color: #0000ff;">TITLE</span> cTitle ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_BLACK,CLR_LIGHTGRAY ;<br /> <span style="color: #0000ff;">ICON</span> oIcon ;<br /> <span style="color: #0000ff;">VSCROLL</span> <span style="color: #0000ff;">HSCROLL</span> <span style="color: #0000ff;">MDICHILD</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #B900B9;">/*FROM 0, 0 TO 24, 80*/</span> ;<br /> <span style="color: #0000ff;">TITLE</span> cTitle ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_BLACK,CLR_LIGHTGRAY ;<br /> <span style="color: #0000ff;">ICON</span> oIcon ;<br /> <span style="color: #0000ff;">VSCROLL</span> <span style="color: #0000ff;">HSCROLL</span> <span style="color: #0000ff;">MENU</span> ::<span style="color: #000000;">BuildMenu</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SetFont</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oFont</span> <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">SetRange</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">SetRange</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">cPageNum</span> = TXT_PAGENUM<br /> ::<span style="color: #000000;">BuildButtonBar</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">/*<br /> #ifdef __CLIPPER__<br /> SET MESSAGE OF ::oWnd TO TXT_PREVIEW CENTERED ;<br /> NOINSET CLOCK DATE KEYBOARD<br /> #else<br /> if l2007<br /> SET MESSAGE OF ::oWnd TO TXT_PREVIEW CENTERED ;<br /> NOINSET CLOCK DATE KEYBOARD 2007<br /> else<br /> DEFINE STATUSBAR OF ::oWnd PROMPT " " + TXT_PREVIEW<br /> endif<br /> #endif<br />*/</span><br /><br /> <span style="color: #00C800;">if</span> lRebar<br /> <span style="color: #0000ff;">DEFINE</span> STATUSBAR <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" "</span> + TXT_PREVIEW<br /> <span style="color: #00C800;">else</span><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">TO</span> TXT_PREVIEW <span style="color: #0000ff;">CENTERED</span> ;<br /> NOINSET CLOCK DATE KEYBOARD<br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">l2007</span> := <span style="color: #000000;">(</span> nStyle == <span style="color: #000000;">2007</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">l2010</span> := <span style="color: #000000;">(</span> nStyle == <span style="color: #000000;">2010</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">oMeta1</span> := TMetaFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</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>,;<br /> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">aMeta</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>,;<br /> ::<span style="color: #000000;">oWnd</span>,;<br /> CLR_BLACK,;<br /> CLR_WHITE,;<br /> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">nHorzRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">nVertRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! IsWin64<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> ::<span style="color: #000000;">oCursor</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"LUPA"</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> ::<span style="color: #000000;">oCursor</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"search"</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oMeta1</span>:<span style="color: #000000;">oCursor</span> := ::<span style="color: #000000;">oCursor</span><br /> ::<span style="color: #000000;">oMeta1</span>:<span style="color: #000000;">blDblClick</span> := <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> ::<span style="color: #000000;">SetOrg1</span><span style="color: #000000;">(</span> nCol, nRow, nKeyFlags <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">oMeta1</span>:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span> | nKey, nFlags | ::<span style="color: #000000;">CheckKey</span><span style="color: #000000;">(</span> nKey, nFlags <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oMeta1</span>:<span style="color: #000000;">bMouseWheel</span> := <span style="color: #000000;">{</span> | nKeys, nDelta, nXPos, nYPos | ;<br /> ::<span style="color: #000000;">CheckMouseWheel</span><span style="color: #000000;">(</span> nKeys, nDelta, nXPos, nYPos <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> #ifndef __XPP__ <span style="color: #B900B9;">// XBPP bug. Warning: don't change this into #ifdef __CLIPPER__</span><br /> ::<span style="color: #000000;">oMeta2</span> := TMetaFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</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: #ff0000;">""</span>,;<br /> ::<span style="color: #000000;">oWnd</span>, CLR_BLACK, CLR_WHITE, ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">nHorzRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">nVertRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> #else<br /> ::<span style="color: #000000;">oMeta2</span> := TMetaFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:_New<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: #ff0000;">""</span>,;<br /> ::<span style="color: #000000;">oWnd</span>, CLR_BLACK, CLR_WHITE, ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">nHorzRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">nVertRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> #endif<br /><br /> ::<span style="color: #000000;">oMeta2</span>:<span style="color: #000000;">oCursor</span> = ::<span style="color: #000000;">oCursor</span><br /> ::<span style="color: #000000;">oMeta2</span>:<span style="color: #000000;">blDblClick</span> := <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> ::<span style="color: #000000;">SetOrg2</span><span style="color: #000000;">(</span> nCol, nRow, nKeyFlags <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">oMeta2</span>:<span style="color: #000000;">hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">SetFactor</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBar := ::<span style="color: #000000;">oBar</span><br /> <span style="color: #00C800;">if</span> !lRebar<br /> nCol := ATail<span style="color: #000000;">(</span> oBar:<span style="color: #000000;">aControls</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">nRight</span> + <span style="color: #000000;">30</span><br /> nRow := Int<span style="color: #000000;">(</span> oBar:<span style="color: #000000;">nHeight</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">6</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> nStyle >= <span style="color: #000000;">2007</span><br /> oBar:<span style="color: #000000;">bPainted</span> = <span style="color: #000000;">{</span> || oBar:<span style="color: #0000ff;">Say</span><span style="color: #000000;">(</span> nRow, nCol, <span style="color: #ff0000;">"Factor:"</span>,,, ::<span style="color: #000000;">oFont</span>, .T., .T. <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">aMeta</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">1</span>,;<br /> oBar:<span style="color: #0000ff;">Say</span><span style="color: #000000;">(</span> nRow, nCol<span style="color: #000000;">+100</span>, ::<span style="color: #000000;">cPageNum</span> + LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> ::<span style="color: #000000;">nPage</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" / "</span> + ;<br /> LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">aMeta</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,,, ::<span style="color: #000000;">oFont</span>, .T., .T. <span style="color: #000000;">)</span>,;<br /> oBar:<span style="color: #0000ff;">Say</span><span style="color: #000000;">(</span> nRow, nCol<span style="color: #000000;">+100</span>, ::<span style="color: #000000;">cPageNum</span> + LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> ::<span style="color: #000000;">nPage</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,;<br /> ,,, ::<span style="color: #000000;">oFont</span>, .T., .T. <span style="color: #000000;">)</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;">if</span> nStyle < <span style="color: #000000;">2007</span><br /> @ nRow, nCol <span style="color: #0000ff;">SAY</span> ::<span style="color: #000000;">oSay</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Factor:"</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">45</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oBar</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont</span><br /><br /> ::<span style="color: #000000;">oSay</span>:<span style="color: #000000;">lTransparent</span> = .T.<br /> <span style="color: #00C800;">endif</span><br /><br /> @ nRow<span style="color: #000000;">-4</span>, nCol<span style="color: #000000;">+40</span> <span style="color: #0000ff;">COMBOBOX</span> ::<span style="color: #000000;">oFactor</span> <span style="color: #0000ff;">VAR</span> ::<span style="color: #000000;">nZFactor</span> ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"1"</span>, <span style="color: #ff0000;">"2"</span>, <span style="color: #ff0000;">"3"</span>, <span style="color: #ff0000;">"4"</span>, <span style="color: #ff0000;">"5"</span>, <span style="color: #ff0000;">"6"</span>, <span style="color: #ff0000;">"7"</span>, <span style="color: #ff0000;">"8"</span>, <span style="color: #ff0000;">"9"</span> <span style="color: #000000;">}</span> ;<br /> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oBar</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">35</span>,<span style="color: #000000;">200</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> oThis:<span style="color: #000000;">SetFactor</span><span style="color: #000000;">(</span> oThis:<span style="color: #000000;">nZFactor</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> nStyle < <span style="color: #000000;">2007</span><br /> <span style="color: #00C800;">if</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">aMeta</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">1</span><br /> @ nRow, nCol<span style="color: #000000;">+100</span> <span style="color: #0000ff;">SAY</span> ::<span style="color: #000000;">oPage</span> <span style="color: #0000ff;">PROMPT</span> TXT_PAGENUM + LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> ::<span style="color: #000000;">nPage</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" / "</span> + ;<br /> LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDevice</span>:<span style="color: #000000;">aMeta</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">180</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oBar</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont</span><br /> <span style="color: #00C800;">else</span><br /> @ nRow, nCol + <span style="color: #000000;">100</span> <span style="color: #0000ff;">SAY</span> ::<span style="color: #000000;">oPage</span> <span style="color: #0000ff;">PROMPT</span> TXT_PAGENUM + LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> ::<span style="color: #000000;">nPage</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">180</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oBar</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">oPage</span>:<span style="color: #000000;">lTransparent</span> = .T.<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #B900B9;">// if IsAppThemed() .or. l2007</span><br /> <span style="color: #00C800;">if</span> lRebar .or. nStyle >= <span style="color: #000000;">2007</span><br /> FixSays<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBar</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> #ifndef __XPP__<br /> ::<span style="color: #000000;">oFactor</span>:<span style="color: #000000;">Set3dLook</span><span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /> #endif<br /><br /> SetResources<span style="color: #000000;">(</span> ::<span style="color: #000000;">hOldRes</span> <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bPos</span> := <span style="color: #000000;">{</span> | nPos | ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">(</span> GO_POS, .f., nPos <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bPos</span> := <span style="color: #000000;">{</span> | nPos | ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">(</span> GO_POS, .f., nPos <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 /> </div>[/code:9o3f0i3i]
Efectivamente, hay dos soluciones: a) que cada .prg de Fivewin detecte el idioma del SO (los principales: inglés, español, portugués, etc) y traduzca los mensajes o b) que es lo más factible, tener un .ch con todos los mensajes y de este modo traducir este .ch y listo. |
sugerencia RICHEDIT | FIVEWIDI
OVERRIDE es de xHarbour, asi que no tienes nada que buscar, lo que pasa es que en tu pregunta, solo pones Harbour.
El problema es que como dice Przemys?aw Czerpak es absolutamente des-aconsejable el uso de Override por posibles problemas de herencia si ese método es llamado desde otras clases, si solo es llamado por la clase madre, y los cambios son menores, no implican nuevas datas o cambios bruscos de flujo del prg.. puede que si.
Lucas.
Tambien estoy de acuerdo en NO UTILIZAR OVERRIDE, por algo no esta en HARBOUR en forma nativa. Pero como querias una respuesta, ahi te deje lo mejor que tenia.
Por lo pronto lo mas directo "desgraciadamente" es modificar la clase.
ANTONIO
Que tan dificil podra ser el crear un CH con todas los mensajes en diferentes idiomas, se me ocurren 3 para partir, Español, Ingles, Portugues, por lo demas cada usuario puede aportar con las versiones en su idioma para hacer a FWH mas INTERNACIONAL aún o algo como lo que hizo Manuel Mercado en su TsBrowse, que soporta 17 idiomas : Español, Ingles, Eslovaco, Ruso, Portugues, Polaco, Malayo, Lituano, Italiano, Griego, Aleman, Gallego, Frances, Holandes y 3 formas de CHINO, solo agregando el PRG con las traducciones requeridas.
Desde Chile
Adolfo |
sugerencia RICHEDIT | Adolfo,
Si usamos un CH externo, los PRGs tendrían que recompilarse. Aunque desde luego que ayudaría a organizar bien el soporte de distintos idiomas.
Vamos a estudiarlo y ver en que forma hacerlo, gracias <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
sugerencia RICHEDIT | muchas gracias por escuchar maestro.
al menos, fwh debería soportar inglés y castellano, con un tipo set fwhlanguage to spanish, etc.
o también definir los mensajes de la librería en una función externa con un array, de modo que las funciones de fivewin llamarían a fwlangtext( 100 ) pasando el id, de modo que sólo hay que incluir esta función... |
sugerencia RICHEDIT | up. |
sugerencia RICHEDIT | Creo que la solución es usar una función FWString( "nombre_literal" ) que así permitiría reeemplazar la función por una propia facilmente sin tener que recompilar todo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Para establecer el lenguaje podriamos usar otra función como FWSetLanguage( "español" ), etc.
Comentarios ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
sugerencia RICHEDIT | Muchas gracias Antonio.
Así es como funcionaba EasyReport.
Por ejemplo, en report.prg:
MsgStop( "Preview.dll not found", "Error" )
Sería:
MsgStop( FWString( 1002 ), FWString( 1003 ) )
Y FWString( nChoice) devolvería según el idioma:
LOCAL cReturn
LOCAL cLang := ObtenemosIdiomaMensajes()
DO CASE
CASE nChoice = 1002
IF cLang = "EN"
cReturn := "Preview.dll not found"
ELSEIF cLang = "ESP"
cReturn := "No se encuentra el archvio preview.dll"
ENDIF
[...]
ENDCASE
RETURN( cReturn )
Sería estupendo!! |
sugerencia RICHEDIT | Creo preferible el usar cadenas en vez de números para identificar facilmente el contenido:
MsgStop( "Preview.dll not found", "Error" )
Sería:
MsgStop( FWString( "Preview.dll not found" ), FWString( "Error" ) ) |
sugerencia RICHEDIT | [quote="Antonio Linares":3dso2aaq]Creo que la solución es usar una función FWString( "nombre_literal" ) que así permitiría reeemplazar la función por una propia facilmente sin tener que recompilar todo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Para establecer el lenguaje podriamos usar otra función como FWSetLanguage( "español" ), etc.
Comentarios ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:3dso2aaq]
Esa es la solución quen he aplicacdo a ni apkicación, y va perfecto. Además evito usar DLL para diferentes idiomas, lo tengo en ficheros INI que puedo editar con cualquier cosa.
Lo de usar números hace ilegible el código. |
sugerencia RICHEDIT | Saludos mi propuesta a este punto es la siguiente
Crear un Hash con los mensajes, asi podriamos usar literales y nombres intuitivos
para verlo en funcionamiento
cree un archivo de cabecera de esta forma llamado hashmsg.ch y lo agrege a fivewin.ch
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hashmsg.ch"</span></div>[/code:3f51s9fs]
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;">#ifndef _HASHMSG_<br /><span style="color: #00D7D7;">#define</span> _HASHMSG_<br /><br /><span style="color: #00C800;">static</span> FWMsgs := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /><br />#xtranslate TRICH_S_PRINTER_NOT_READY => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_S_PRINTER_NOT_READY"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_V_FILE => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_V_FILE"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_UNDO => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_UNDO"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_REDO => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_REDO"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_COPY => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_COPY"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_CUT => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_CUT"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_PASTE => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_PASTE"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_DELETE => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_DELETE"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_FONT => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_FONT"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_ALIGN => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_ALIGN"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_LEFT => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_LEFT"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_CENTER => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_CENTER"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_RIGHT => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_RIGHT"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_JUSTIFY => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_JUSTIFY"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_PRINT => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_PRINT"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_T_SELECTALL => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_T_SELECTALL"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_A_NOFILE_PROVIDE => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_A_NOFILE_PROVIDE"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_Q_OVERWRITE => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_Q_OVERWRITE"</span> <span style="color: #000000;">)</span><br />#xtranslate TRICH_I_FOUND => FW_getMessages<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRICH_I_FOUND"</span> <span style="color: #000000;">)</span><br /><br />#xtranslate $_ => FW_getMessages<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <br />#endif</div>[/code:3f51s9fs]
el cKey del Hash lo pense en este formato... 5 primeras letras el prg donde se encuentra 1 lentra para determinar donde se usara el mensaje:
S = MsgStop
V = Contenido de una variable
T = Texto, prompt
A = MsgAlert
Q = MsgYesNo / MsgNoYes
I = MsgInfo
por ultimo breve descripcion del mensaje
ejemplos
TRICH_S_PRINTER_NOT_READY, esto esta ubicado en el archivo trichedi.prg se usara en un MsgStop
TRICH_V_FILE, esto esta ubicado en el archivo trichedi.prg se usara como contenido de una variable
TRICH_Q_OVERWRITE, esto esta ubicado en el archivo trichedi.prg se usara en un MsgYesNo
los mensajes puedes contener "macros" incluidos:
Ejemplo
FWMsgs[ "TRICH_Q_OVERWRITE" ] = "[FILENAME] already exists" + CRLF + "Do you want to overwrite it ?"
[FILENAME] recibe el nombre de un archivo
teniendo esto.. continuamos a los cambios en windows.prg
agregar esta lineas al final
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> FW_setMessages<span style="color: #000000;">(</span> h <span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">local</span> hOld<br /> <br /> hOld = FWMsgs<br /> <br /> <span style="color: #00C800;">if</span> h != <span style="color: #00C800;">NIL</span> <br /> FWMsgs = h<br /> elseif<span style="color: #000000;">(</span> Len<span style="color: #000000;">(</span> FWMsgs <span style="color: #000000;">)</span> == <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <br /> FW_defMessages<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> hOld<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> FW_getMessages<span style="color: #000000;">(</span> c <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cRet := <span style="color: #ff0000;">"[]"</span><br /><br /> <span style="color: #00C800;">if</span> c == <span style="color: #00C800;">NIL</span> <br /> <span style="color: #00C800;">return</span> FWMsgs<br /> <span style="color: #00C800;">endif</span><br /> <br />#ifdef __HARBOUR__<br /> #ifndef __XHARBOUR__<br /> <span style="color: #00C800;">if</span> hb_HHASKEY<span style="color: #000000;">(</span> FWMsgs, c <span style="color: #000000;">)</span><br /> cRet = FWMsgs<span style="color: #000000;">[</span> c <span style="color: #000000;">]</span><br /> #else<br /> <span style="color: #00C800;">if</span> HHASKEY<span style="color: #000000;">(</span> FWMsgs, c <span style="color: #000000;">)</span><br /> #endif<br /> cRet = FWMsgs<span style="color: #000000;">[</span> c <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">endif</span> <br /><br />#endif<br /><br /><span style="color: #00C800;">return</span> cRet<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> FW_defMessages<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"FWMSG_PRUEBA1"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"Printer not ready!"</span><br /> <br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_S_PRINTER_NOT_READY"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"Printer not ready!"</span><br /> <br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_V_FILE"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"FWH RICHEDIT FILE"</span><br /> <br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_UNDO"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Undo"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_REDO"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Redo"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_COPY"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Copy"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_CUT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"Cu&t"</span> <br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_PASTE"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Paste"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_DELETE"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Delete"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_FONT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Font..."</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_ALIGN"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"A&lign"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_LEFT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Left"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_CENTER"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Center"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_RIGHT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Right"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_JUSTIFY"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Justify"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_PRINT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"P&rint"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_SELECTALL"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"Select &All"</span><br /> <br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_A_NOFILE_PROVIDE"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"No filename provided to save the richedit text"</span><br /> <br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_Q_OVERWRITE"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"[FILENAME] already exists"</span> + CRLF + <span style="color: #ff0000;">"Do you want to overwrite it ?"</span><br /> FWMsgs<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_I_FOUND"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"something found"</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:3f51s9fs]
ahora nos falta donde inicializar el hash, para usar cualquier control de fivewin y que este nos muestre un mensaje deberia existir un "Default Window"
modificamos esta funcionn para inicializar el hash
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> SetWndDefault<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span> <br /> oWndDefault := oWnd <br /> FW_setMessages<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3f51s9fs]
para finalizar esta propuesta los cambios de richedit
Cambiar estos metodos
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> RButtonDown<span style="color: #000000;">(</span> nRow, nCol, nFlags <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> <span style="color: #00C800;">local</span> oMenu, oClp<br /><br /> <span style="color: #00C800;">if</span> GetFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> != ::<span style="color: #000000;">hWnd</span><br /> ::<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> GetFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> != ::<span style="color: #000000;">hWnd</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> #ifdef __XPP__<br /> #undef <span style="color: #00C800;">New</span><br /> #endif<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bRClicked</span> != <span style="color: #00C800;">NIL</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bRClicked</span>, nRow, nCol, nFlags <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> CLIPBOARD oClp <span style="color: #0000ff;">OF</span> <span style="color: #00C800;">Self</span> FORMAT <span style="color: #0000ff;">TEXT</span><br /><br /> <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #0000ff;">POPUP</span><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_UNDO <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">UnDo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"UnDo"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanUndo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_UNDO <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">UnDo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"UnDo"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanUndo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #endif<br /><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_REDO <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">ReDo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ReDo"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanRedo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_REDO <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">ReDo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ReDo"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanRedo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #endif<br /><br /> <span style="color: #0000ff;">SEPARATOR</span><br /> <br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_CUT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">Cut</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Cut"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanCut</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_CUT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">Cut</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Cut"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanCut</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #endif<br /><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_COPY <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">Copy</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Copy"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanCopy</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_COPY <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">Copy</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Copy"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanCopy</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #endif<br /><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_PASTE <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">Paste</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Paste"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanPaste</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_PASTE <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">Paste</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Paste"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanPaste</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #endif<br /><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_DELETE <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">Del</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Del"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanDel</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_DELETE <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">Del</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Del"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ::<span style="color: #000000;">CanDel</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> #endif<br /><br /> <span style="color: #0000ff;">SEPARATOR</span><br /><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_FONT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetCharFormat</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Font"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_FONT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRIchEdit</span>:<span style="color: #000000;">SetCharFormat</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Font"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> #endif<br /><br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_ALIGN <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> <span style="color: #0000ff;">MENU</span><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_LEFT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetAlign</span><span style="color: #000000;">(</span> PFA_LEFT <span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Left"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_CENTER <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetAlign</span><span style="color: #000000;">(</span> PFA_CENTER <span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Center"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_RIGHT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetAlign</span><span style="color: #000000;">(</span> PFA_RIGHT <span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Right"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lRE30</span><br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_JUSTIFY <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetAlign</span><span style="color: #000000;">(</span> PFA_JUSTIFY <span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Justify"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> <span style="color: #00C800;">endif</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_LEFT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">SetAlign</span><span style="color: #000000;">(</span> PFA_LEFT <span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Left"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_CENTER <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">SetAlign</span><span style="color: #000000;">(</span> PFA_CENTER <span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Center"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_RIGHT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">SetAlign</span><span style="color: #000000;">(</span> PFA_RIGHT <span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Right"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lRE30</span><br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_JUSTIFY <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">SetAlign</span><span style="color: #000000;">(</span> PFA_JUSTIFY <span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Justify"</span> ;<br /> <span style="color: #0000ff;">WHEN</span> !::<span style="color: #000000;">lReadOnly</span><br /> <span style="color: #00C800;">endif</span><br /> #endif<br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> <span style="color: #0000ff;">SEPARATOR</span><br /><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_PRINT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #00C800;">Print</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Printer"</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_PRINT <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #00C800;">Print</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Printer"</span><br /> #endif<br /><br /> <span style="color: #0000ff;">SEPARATOR</span><br /><br /> #ifndef __XPP__<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_SELECTALL <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SelectAll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"SelAll"</span><br /> #else<br /> <span style="color: #0000ff;">MENUITEM</span> TRICH_T_SELECTALL <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">TRichEdit</span>:<span style="color: #000000;">SelectAll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"SelAll"</span><br /> #endif<br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">POPUP</span> oMenu <span style="color: #00C800;">AT</span> nRow, nCol <span style="color: #0000ff;">OF</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /> </div>[/code:3f51s9fs]
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;"><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 /> <span style="color: #00C800;">DEFAULT</span> cFileName := ::<span style="color: #000000;">cFileName</span><br /><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span><br /> MsgAlert<span style="color: #000000;">(</span> TRICH_A_NOFILE_PROVIDE <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> File<span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">if</span> MsgYesNo<span style="color: #000000;">(</span> StrTran<span style="color: #000000;">(</span> TRICH_Q_OVERWRITE, <span style="color: #ff0000;">"[FILENAME]"</span>, cFileName <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /> MemoWrit<span style="color: #000000;">(</span> cFileName, ::<span style="color: #000000;">GetText</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> MemoWrit<span style="color: #000000;">(</span> cFileName, ::<span style="color: #000000;">GetText</span><span style="color: #000000;">(</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><br /> </div>[/code:3f51s9fs]
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> Search<span style="color: #000000;">(</span> cSearch <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> <span style="color: #00C800;">local</span> nIndex := REFindText<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, cSearch, .t. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nLine<br /><br /> <span style="color: #00C800;">if</span> nIndex == <span style="color: #000000;">-1</span><br /> nLine = <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> TRICH_I_FOUND <span style="color: #000000;">)</span><br /> nLine = ::<span style="color: #000000;">SendMsg</span><span style="color: #000000;">(</span> EM_EXLINEFROMCHAR, <span style="color: #000000;">0</span>, nIndex <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> nLine <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> nLine<br /><br /> </div>[/code:3f51s9fs]
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">Print</span><span style="color: #000000;">(</span> cName <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TRichEdit<br /><br /> <span style="color: #00C800;">local</span> aMargins := PageGetMargins<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oPrn<br /><br /> <span style="color: #00C800;">DEFAULT</span> cName := TRICH_V_FILE<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">IsSelection</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> cName <span style="color: #0000ff;">FROM</span> USER SELECTION<br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> cName <span style="color: #0000ff;">FROM</span> USER<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> MsgStop<span style="color: #000000;">(</span> TRICH_S_PRINTER_NOT_READY <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">endif</span><br /><br /> CursorWait<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> AEval<span style="color: #000000;">(</span> aMargins, <span style="color: #000000;">{</span> |x,y| aMargins<span style="color: #000000;">[</span> y <span style="color: #000000;">]</span> := x * <span style="color: #000000;">1440</span> / <span style="color: #000000;">2540</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> REPrint<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, cName, oPrn:<span style="color: #000000;">hDC</span>, PrnGetPagNums<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, PrnGetSelection<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> PrnGetCollate<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, PrnGetPages<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, PrnGetCopies<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, aMargins <span style="color: #000000;">)</span><br /><br /> CursorArrow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ENDPRINT</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:3f51s9fs]
por ultimo la prueba: [url:3f51s9fs]http://www.sitasoft.net/fivewin/samples/testrich.zip[/url:3f51s9fs]
[code=fw:3f51s9fs]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// FWH and FW++ RichEdit sample</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</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> oDlg, oRich<br /> <span style="color: #00C800;">local</span> hRichDLL := LoadLibrary<span style="color: #000000;">(</span> <span style="color: #ff0000;">"riched20.dll"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lSyntaxHL := .f.<br /><br /> <span style="color: #B900B9;">//hay dos opciones </span><br /> <span style="color: #B900B9;">//1) llenamos primero nosotros el hash </span><br /> <span style="color: #B900B9;">// y despues lo modificamos antes de crear el Main Window</span><br /> <span style="color: #B900B9;">//2) Modificamos el hash despues de crear el Main Window</span><br /> <br /> <span style="color: #B900B9;">//descomentar para usar opcion 1</span><br /> <span style="color: #B900B9;">//FW_defMessages()</span><br /> <span style="color: #B900B9;">//ChangeFWMsg()</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Test"</span><br /><br /> <span style="color: #B900B9;">//Usando metodo 2</span><br /> <span style="color: #B900B9;">//comentar estas linea si va a usar el metodo 1 </span><br /> ChangeFWMsg<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> oRich = TRichEdit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #0000ff;">Redefine</span><span style="color: #000000;">(</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">{</span> || <span style="color: #ff0000;">""</span> <span style="color: #000000;">}</span>, oDlg <span style="color: #000000;">)</span><br /> oRich:<span style="color: #000000;">lHighLight</span> = .f.<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> ;<br /> <span style="color: #0000ff;">ACTION</span> oRich:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> MemoRead<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TestRich.prg"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> lSyntaxHL <span style="color: #0000ff;">ID</span> <span style="color: #000000;">115</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span> oRich:<span style="color: #000000;">lHighLight</span> := lSyntaxHL,;<br /> oRich:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> oRich:<span style="color: #000000;">GetText</span><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;">120</span> ;<br /> <span style="color: #0000ff;">ACTION</span> oRich:<span style="color: #000000;">LoadFromRTFFile</span><span style="color: #000000;">(</span> cGetFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"RTF file (*.rtf) | *.rtf"</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;">130</span> ;<br /> <span style="color: #0000ff;">ACTION</span> oRich:<span style="color: #000000;">SaveToRTFFile</span><span style="color: #000000;">(</span> cGetFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"RTF file (*.rtf) | *.rtf"</span>,;<br /> <span style="color: #ff0000;">"Please write a filename"</span>, <span style="color: #ff0000;">"test"</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;">998</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRich:<span style="color: #000000;">GoToLine</span><span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span>, oRich:<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;">CENTERED</span> ;<br /> <span style="color: #B900B9;">// ON INIT oRich:AutoURLDetect( .t. )</span><br /><br /> FreeLibrary<span style="color: #000000;">(</span> hRichDLL <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ChangeFWMsg<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_S_PRINTER_NOT_READY"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"El Impresor no está Listo!"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_UNDO"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Reversar"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_REDO"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"Re&hacer"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_COPY"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Copiar"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_CUT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"C&ortar"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_PASTE"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Pegar"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_DELETE"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Borrar"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_FONT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Letra"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_ALIGN"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Alineación"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_LEFT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Izquierda"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_CENTER"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"C&entro"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_RIGHT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Derecha"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_JUSTIFY"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Justificado"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_PRINT"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"I&mprimir"</span><br /> $_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_SELECTALL"</span><span style="color: #000000;">]</span> = <span style="color: #ff0000;">"Seleccionar &Todo"</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /> </div>[/code:3f51s9fs] |
sugerencia RICHEDIT | Daniel,
Muchas gracias por tu inestimable ayuda y explicación además de la funcionalidad de Harbour.
Pero, ¿y no sería más sencillo MsgStop( FWString( "Preview.dll not found" ), FWString( "Error" ) ) ?.
Esta FWString buscará el equivalente a los textos pasados y los devolverá según el idioma especificado por ejemplo en un DO CASE:
function FWString( cString )
local cIdioma := ObtenerIdioma del SO o indicado en el Main() de nuestra aplicación
DO CASE
CASE cString = "Preview.dll not found"
IF cLang = "EN"
cReturn := cString
ELSEIF cLang = "ESP"
cReturn := "No se encuentra el archvio preview.dll"
ENDIF
[...]
ENDCASE
No sé, de esta forma es más facil modificar las clases de Fivewin y cambiar los mensajes. Además, con este sistema en las clases de Fivewin se sabe el mensaje de error.
Pero, [u:1j98q87o]en todo caso[/u:1j98q87o], lo importante es traducir estos mensajes.
Y en Richedit falta el title del PREVIEW:
//----------------------------------------------------------------------------//
METHOD Preview( cName ) CLASS TRichEdit
local aMargins := PageGetMargins()
local nLen := ::Len()
local nPrint := 0
local oPrn
DEFAULT cName := [b:1j98q87o]"FWH RICHEDIT FILE"[/b:1j98q87o]
Muchísimas gracias, una vez más, por todo tu tiempo, dedicación y ayuda y para el progreso del producto. |
sugerencia RICHEDIT | [quote="lucasdebeltran":3hakufk0]Pero, ¿y no sería más sencillo MsgStop( FWString( "Preview.dll not found" ), FWString( "Error" ) ) ?.[/quote:3hakufk0]
Inicialmente este proceso sera transparente al programador, pero con la facibilidad de configurarlos... Ahora bien, por la forma como lo suguieres, lo veo mas intuitivo que sencillo, aparte que a la hora de ejecucion seria un proceso de un pobre rendimiento, te explico porque:
1) para el texto del mensaje debes pasar un string a una funcion, para ser comprobado debera ser convertido a mayuscula o minuscula y que todo el string sea identico
2) para el titulo debe ser igual el proceso.
3) dentro de la funion de los string, aparte de convertir los texto a May/Min, debes tenes una serie de IF o en su defecto CASE y en el mejor de los casos SWITCH (creo que xharbour no soporta casos de switch con variables character, los que nos obligaria a usar CASE/IF)
4) ese proceso de busqueda a que encuentre el string ante una gran cantidad de opciones, demora mas el procesos (aunque sabemos que puede suceder que no notemos ese detalle por lo rapido que son las maquinas ahora)
5) finalmente devolver el resultado (si lo encuentra)
de la forma que lo propongo, es menos intuitivo (pero entendible) y a la vez es mas versatil... pues al utilizar un hash (compatible en ambos compiladores) nos evitamos las busquedas en CASE/IF y conversiones a May/Min y vamos "directo al mensaje" que queremos
para hecerlo de forma mas abreviada, esta "$_"
ejemplo
[code=fw:3hakufk0]<div class="fw" id="{CB}" style="font-family: monospace;">$_<span style="color: #000000;">[</span> <span style="color: #ff0000;">"TRICH_T_UNDO"</span> <span style="color: #000000;">]</span> = <span style="color: #ff0000;">"&Reversar"</span></div>[/code:3hakufk0]
a simple vista creo que se sabe que es ese mensaje, igual seria cargar el hash de mensajes para cada idioma e incluso perosnalizarlos tambien |
sugerencia RICHEDIT | Daniel,
Muchas gracias por tu atención. Sin dudas, como ya comenté, tu solución es muy superior y la mía es muy sencillita y fácil de implementar. Además, hoy en día no hay problema para procesar un DO CASE/IF ENDIF con el Hardware actual, y además teniendo en cuenta que este proceso sólo se realiza en el caso de producirse un error, y afortunadamente no es siempre.
En todo caso, lo importante es poder disponer del resultado en todas las clases, sea cual fuere el método empleado. Si puede hacerse con tu solución pues estupendo. Va a ser una característica muy importante de la librería. |
sugerencia RICHEDIT | La idea de Lucas se puede implementar usando Hashes en lugar de DO/CASE o SWITH, con lo que desaparecería el problema de performance.
Cosas que son interesantes para tener:
1) Que me genere un log con las strings que no ha sabido traducir.
2) Se pueden usar las funciones de Harbour para interpretar archivos INI que te los deja transformados en Hashes para almacenar el texto traducido.
i18n es un término a buscar, de ahi podemos sacar ideas de como lo han resuelto en otros ámbitos (incluyendo Harbour, creo) |
sugerencia RICHEDIT | Hola,
¿Se sabe cuándo estará lista esta característica?. Pense qué iba a estar en esta nueva build.
Muchas gracias por vuestra atención. |
sugerencia RICHEDIT | Buenas tardes
Creo que, al margen de las soluciones propuestas, muy acertadas, quizás no estaría de más incluir como DATA bMnuRDown o algo así
Así en el METHOD RButtonDown( nRow, nCol, nFlags )
Entre ENDMENU y el Activate Menu oMenu POPUP AT .......
Se podría incluir el código:
ENDMENU
if !empty( ::bMnuRDown ) .and. Valtype( ::bMnuRDown ) = "B"
oMenu := Nil // Se podría guardar el menú ("oMenu") antes
oMenu := Eval( ::bMnuRDown, Self )
endif
ACTIVATE POPUP oMenu AT nRow, nCol OF Self
Para que cada uno pueda definir el Menú según sus necesidades, tanto de opciones, como otros aspectos ya comentados y, de momento también podría servir
Incluso se podría guardar el valor del objeto oMenu ya definido en una variable local para que si se devuelve a oMenu un valor <> "O", se restaure el menú por defecto.
Esta característica entiendo que podría extenderse a todos los controles que puedan usar un menú contextual ( METHOD RButtonDown ) si la DATA es añadida en Clases superiores
y poder definir el Menú contextual del cualquier control según tus necesidades.
Disculpen mi ignorancia, si esa posibilidad ya existe, ya que llevo distanciado de la programación cierto tiempo y no he podido conocer aún todos los avances que a día de hoy, ha tenido FW
Un saludo
Cristobal Navarro |
sugerencia RICHEDIT | Amigos de Fivetech,
Sí, por favor, necesitaría tener traducido de serie el menú de RichEdit.
Muy agradecida <!-- 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 --> <!-- 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 --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
sugerencia muy fácil | Antonio:Como muchos modificamos los fuentes de las clases, cuando lanzas una nueva build sería útil adjuntar un archivo indicando los archivos fuente que se han modificado en dicha build, para permitirnos una mejor actualización,Un saludo, |
sugerencia muy fácil | [quote="MOISES":8q46nmab]Antonio:
Como muchos modificamos los fuentes de las clases, cuando lanzas una nueva build sería útil adjuntar un archivo indicando los archivos fuente que se han modificado en dicha build, para permitirnos una mejor actualización,
Un saludo,[/quote:8q46nmab]Yo creo que lo realmente fácil es mirar con el explorer los fuentes, ordenarlos por fecha y ya sabemos cuales se han modificado.Lo realmente útil aunque no fácil (Antonio deberá molestarse en acordarse y hacerlo manualmente), es que el método que se ha tocado tenga un comentario con la fecha de última actualización.Yo gastaría cartuchos en otras guerras. Es mi humilde punto de vista.SaludosCarlos G. |
sugerencia muy fácil | Hola:Pues ambas sugerencias son factibles. A fin de cuentas, Fivewin es un producto comercial y las actualizaciones no son gratis, por lo que, al igual que sucede en otros productos comerciales, se indica en un fichero los cambios y los módulos afectados.Un saludo |
sugerencia muy fácil | En el fichero whatsnew.txt de FiveWin se detallan todos los cambios y novedades. |
sugerencia para FWSTRING | Antonio, agregue estas lineas en mi version no esta pero si pueden agregarlas para proximas atualizaciones o si pueden mejorar mi codigo mejor.
gracias
[code=fw:3pc7cmwx]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> FWLanguageID<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">return</span> cString<br /> <span style="color: #00C800;">endif</span><br /> <br /> <span style="color: #B900B9;">// esto agregue. el 388 puse porque es la ultima linea por defecto que trae aStrings</span><br /><br /> <span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span>ValType<span style="color: #000000;">(</span>cString<span style="color: #000000;">)</span> == <span style="color: #ff0000;">'N'</span><span style="color: #000000;">)</span><br /> cRet:= aStrings<span style="color: #000000;">[</span><span style="color: #000000;">388</span> + cString<span style="color: #000000;">]</span><span style="color: #000000;">[</span>nLanguage<span style="color: #000000;">]</span><br /> <span style="color: #00C800;">RETURN</span> cRet<br /> <span style="color: #00C800;">ENDIF</span><br /><br /> cSeek := Upper<span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> cString <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:3pc7cmwx] |
sugerencia para FWSTRING | Estimado Gustavo,
Lo que quieres es buscar una cadena pero usando un número, su índice ? |
sugerencia para FWSTRING | Exacto,
Hice ese cambio y en mi caso está funcionando. porque vi lo util que era la función fwstring y ya comence a utilizarlo no solo en frases cortas sino en explicaciones largas, entonces me resultó mas util referirme al indice que ocupa en aTranslate que no una frase.
fwstring(1)
[b:ly6zxher]en vez de:[/b:ly6zxher]
fwstring('ajs dajsk dalksd alksjd aklsdj alksdj lkasdj alksdjalkdsja lkdjakld akdjald') |
sugerencia para MARIADB | Hola.
Hago una sugerencia, a no ser que ya este implementado y quieran indicarme como hacerlo. Quisiera que, cuando se produce un error en INSERT, REMOVE, ETC... informe tanto de los campos como de los valores que se pasaron al hacer la operación. Porque ahora cuando se produce un error muestra:
1064 Algo esta equivocado en su sintaxis cerca '( y aqui muestra los campos pero no muestra los valores que se pasaron.,
gracias. |
suggestion for FW_AdoCreateTable | Hello,
It would be very interesting that FW_AdoCreateTable checks if the table exists and the specified structure matches current table structure.
If not, it runs an ALTER TABLE.
So with this function we créate and update table structures.
Thank you very much- |
suggestions how to implement a procedure with xbrowse | I work in a school.
in school when you have to purchase the products you have to ask for at least 5 or 6 quotes from different suppliers.
It happens that you do not always ask the same material in the 5 suppliers.
This is because you have to take the material and then you have to make an estimate for the product quality and for the price of each product required.
if I ask for a quote of some products to only one provider I can use a table xbrowse
the problem is that if the number of suppliers is 6 I have to do 6 xbrowse tables and insert in these pictures the required products
How do I fix it so you can easily enter in all the tables required products?
[b:1legwzgs]First suggestion [/b:1legwzgs]
I thought I'd create only a table for 6 supplier type :
product code CR
Description CR
amount Numeric
supplier 1 logic
supplier 2 logic
supplier 3 logic
supplier 4 logic
supplier 5 logic
supplier 6 logic
but I do not know what the suppliers have to select them at the time of budget creation
[b:1legwzgs]Second suggestion[/b:1legwzgs]
or I can makke many folders as the number of suppliers and enter a xbrowse on each folder
on this case should insert the products to 6 times
and often I do not have to enter the same product to the same supplier
in the end I have to create a page in WinWord or RTF for each vendor where you enter the required products
Can you give me some good advice? |
suggestions how to implement a procedure with xbrowse | Silvio,
Also a suggestion :
Create 2 xbrowse : 1 with all available products that you could ever want to ask a quotation for.
Second Xbrowse that you fill with a selection of the current products in the first xbrowse that you want.
For the first vendor you can than print, mail, .... this xbrowse, and lets say save it to a quotation dbf with this product and date and ID of the vendor.
For the second vendor, the xbrowse is still filled with all data for the first vendor, and you only erase/add items you need for the second vendor.
You repeet for each vendor the same process.
It only involves 2 xbrowse, and you can recall quotation informatie from the database to add the prices of your vendors.
BTW : If you vendors have exel files with all there products (most of them have it) you could easaly import them in the second xbrowse so you already know if the vendor has the product.
With the selection, you can then ask the quotation.
Just a idea ...
Marc |
sumar columnas de un Report | Hola:
Tengo un report del tipo:
[code=fw:3tkf143g]<div class="fw" id="{CB}" style="font-family: monospace;"> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ACUM.DEBE"</span> ;<br /> <span style="color: #00C800;">DATA</span> FIELD->aAcumDebe ;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span> ;<br /> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span> ;<br /> GRID <span style="color: #000000;">2</span><br /><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ACUM.HABER"</span> ;<br /> <span style="color: #00C800;">DATA</span> FIELD->AcumHaber+FIELD->PENDIENTE ;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span> ;<br /> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span> ;<br /> GRID <span style="color: #000000;">2</span></div>[/code:3tkf143g]
¿Hay alguna forma de sumar las columnas 2 y 3?
Algo así:
COLUMN TITLE "Resúmen" ;
DATA columna3 + columna 4 del Report ;
PICTURE "999,999,999.99" ;
Muchas gracias. |
sumar columnas de un Report | lucasdebeltran
Si entiendo bien es:
[code=fw:1dl982fm]<div class="fw" id="{CB}" style="font-family: monospace;">COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Resúmen"</span> ;<br /><span style="color: #00C800;">DATA</span> <span style="color: #000000;">(</span>FIELD->aAcumDebe + <span style="color: #000000;">(</span> FIELD->AcumHaber+FIELD->PENDIENTE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span> ; <br />TOTAL ; && --> Si desea que totalice esta columna.<br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span> ; <br />GRID <span style="color: #000000;">2</span></div>[/code:1dl982fm]
Un saludo.
Loren. |
sumar columnas de un Report | Loren,
Si, eso ya lo sé, lo que resulta es que cada columna tiene operaciones (sumas, restas, divisiones, etc). Se que a nivel interno debe haber un array con los valores de las columnas, algo del tipo aColums[numero]:cValue, pero no se cúal es.
Es para simplificar el código y no tener que en la columna última tener que volver a hacer todas las operaciones.
Muchas gracias. |
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | Holacomo puedo sumar una columna y poner la suma en el Footer <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> SaludosAida <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | Ya pude poner la suma de una columna en un footer <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> pero como le puedo hacer para que refresque la cantidad cuando alteren algun registro. <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> SaludosAida <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | Hola Aida,Revisa \FWH\SAMPLES\TESTBRW3.PRG, linea 286Saludos. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.