topic
stringlengths
1
63
text
stringlengths
1
577k
oBrw:ToCalc() OpenOffice similiar to oBrw:ToExcel()
Antonio and Friends,How about having a Method in xBrowse to export data to Calc (OpenOffice) similiar to oBrw:ToExcel() in future xBrowse updates.Nowadays I find that more people are getting used to OpenOffice and are insisting to have reports in Calc instead of Excel.OpenOffice Calc can be configured to open MS Excel files, but you still need MS-Excel installed on the PC (OLE) for xBrowse to convert to Excel.RegardsAnserRegardsAnser
oBrw:ToCalc() OpenOffice similiar to oBrw:ToExcel()
Friends,From another forum I found that in Mr.Manual Mercados' TSBrowse there is a Method to export TsBrowse Data to Excel Format without using OLE. This TSBrowse has 2 methods to transfer browser data to ExcelMethod 1 : using OLE similiar to xBrowse:ToExcel() methodMethod 2 : Data is transfered to excel without using OLEThe advantage of the 2nd method is that it can convert Browser data to Excel format without having Excel installed in the PC.Once Excel file is created, then it can be opened using OpenOffice Calc.In my part of the world there are lot of people using OpenOffice instead of MS-Office. As a developer I can give flexibilty to my users to choose MS-Office or OpenOffice, xBrowse will workI have the code of the method without OLE. I don't know whether it is OK if I post the source code of that method here. (It is an opensource). If somebody confirm, I shall paste the code hereIf experts here can convert that method to FWH xBrowse equivalent, then xBrowse will have two methods to transfer Browser data to ExceloBrw:ToExcel() andoBrw:ToExcelNoOle()RegardsAnser
oBrw:ToExcel( ... ) Use bHeader y bFooter (Resuelto)
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=37671">viewtopic.php?f=3&t=37671</a><!-- l -->
oBrw:ToExcel( ... ) Use bHeader y bFooter (Resuelto)
Hola. Mr. Nages. Como podria agregar informacion al Inicio y al final del documento Excel Creado con oBrw:ToExcel( ... ) Ejm : HEADER LINEA1 HEADER LINEA2 HEADER LINEA3 ..... INFORMACION AGREGADA POR oBrw:ToExcel( ... ) .... FOOTER LINEA1 FOOTER LINEA2 FOOTER LINEA3 .......... Podria ser algo asi, ejemplo : oBrw:ToExcel( ..., bHeader, bFooter ) Gracias
oBrw:ToExcel( ... ) Use bHeader y bFooter (Resuelto)
Saludos man, hasta donde se hay forma de saber el final de una hoja creada, alli podrias con la clase excel agregar dicha linea de footer y al inicio la cabezera, se que no es lo mas practica, pero es una solucion temporal mientras se hace lo que sugieres en la clase de xbrowse, mandame un wsap cuando puedas que necesito conversarte algo de trabajo, saludos..., gracias... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
oBrw:ToExcel( ... ) Use bHeader y bFooter (Solved)
Hello. Mr. Nages. How could I add information at the Start and end of the Excel document Created with oBrw: ToExcel (...) Example : HEADER LINEA1 HEADER LINEA2 HEADER LINEA3 ..... Iformation Added by oBrw:ToExcel( ... ) .... FOOTER LINEA1 FOOTER LINEA2 FOOTER LINEA3 .......... It could be something like that, example : oBrw:ToExcel( ..., bHeader, bFooter ) Thanks.
oBrw:ToExcel( ... ) Use bHeader y bFooter (Solved)
oBrw:ToExcel(...) returns oSheet object( Worksheet object of Excel ) You can add/modify whatever information you want to the oSheet object.
oBrw:ToExcel( ... ) Use bHeader y bFooter (Solved)
Thanks Mr. Nages
oBrw:ToExcel() doesn't runs with FWH9.10
Hi all, there is a problem using the method oBrw:ToExcel() when only openoffice (3.0 >) is installed. A self contained sample is available on <!-- w --><a class="postlink" href="http://www.softwarexp.co.uk/beta/xtest.zip">www.softwarexp.co.uk/beta/xtest.zip</a><!-- w --> and the following error appairs: Application =========== Path and name: C:\BRW.EXE (32 bits) Size: 1,853,952 bytes Time from start: 0 hours 0 mins 2 secs Error occurred at: 03/11/09, 19:28:18 Error description: Error BASE/1102 Argument error: UPPER Args: [ 1] = U Stack Calls =========== Called from: => UPPER(0) Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:TOCALC(6563) Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:TOEXCEL(5993) Called from: K:\TESTXBRW\XTEST.PRG => (b)MAIN(34) Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK(176) Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT(1427) Called from: .\source\classes\WINDOW.PRG => _FWH(3347) Called from: => SENDMESSAGE(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND(407) Called from: => TWINDOW:HANDLEEVENT(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(928) Called from: => DIALOGBOXINDIRECT(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273) Called from: K:\TESTXBRW\XTEST.PRG => MAIN(36) Any solution or turnaround ? I have a lot of customers with OpenOffice instead of Microsoft Office so I need an urgent solution. Thanks in advance.
oBrw:ToExcel() doesn't runs with FWH9.10
Marco, We are already reviewing it to provide you a solution today or tomorrow morning, thanks
oBrw:ToExcel() doesn't runs with FWH9.10
Please substitute the present line 5993 in METHOD ToExcel( ... ) [quote:3i9s9j1k] return ::ToCalc( bProgress, nGroupBy,, aCols )[/quote:3i9s9j1k] as [quote:3i9s9j1k] return ::ToCalc( bProgress, nGroupBy,,, aCols )[/quote:3i9s9j1k] One more comma is needed in the parameters.
oBrw:ToExcel() doesn't runs with FWH9.10
It runs. Thanks
oBrw:ToExcel() error
Hi everyone; I'm seen an error when exporting from xbrowse using :ToExcel(). Error text is: [code=fw:180g5lki]<div class="fw" id="{CB}" style="font-family: monospace;">Error Excel.Application.ACTIVESHEET/<span style="color: #000000;">424</span> Unknown error: <span style="color: #000000;">CELLS</span><br />...<br />Stack-List<br />Called by TXBROWSE:<span style="color: #000000;">TOEXCEL</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">6935</span><span style="color: #000000;">&#41;</span></div>[/code:180g5lki] Any ideas? Thank you, Reinaldo.
oBrw:ToExcel() error
We need to see what is the code in line 6935. Very likely, such an error could arise when the parameters of Cells(...) are invalid or invalid assignment.
oBrw:ToExcel() error
Hi. The line at 6935 is this: [code=fw:1eaj2bln]<div class="fw" id="{CB}" style="font-family: monospace;">                     oSheet:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nPasteRow, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:1eaj2bln] The parameters reported on the error log are: [ 1 ] = N 353213 [ 2 ] = N 1 Again the error text is: Error Excel.Application: ACTIVE SHEET/1 Unknown error: CELLS. Information on how to solve this problem, is appreciated. Thank you, Reinaldo.
oBrw:ToExcel() error
[quote:a783rpgb][ 1 ] = N 353213 [/quote:a783rpgb] This is the reason. Here nPasteRow's value appears to be beyond the limit. If the code of xbrowse is bug-free ( let us assume so for the time being ), this value should not exceed the total rows in the table. If the table really contains more rows than 352,213 then we now know that this number seems to be the limit and so we need to export subsets of the table. Check #1: Does the table really contain more rows than the limit? If so please consider exporting subsets of table. Check #2: Does Eval( oBrw:bKeyCount() ) correctly return the number of rows in the table? If not check the codeblocks for oBrw:bKeyCount() .and. oBrw:bSkip Check #3: We need to investigate why the number is so high. I request your cooperation in the logging the relevant values to a log file in the loop. Please locate this part of the program code in toExel() method and insert the lines I indicated: [code=fw:a783rpgb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />               <br />               ferase<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'x.log'</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// INSERTED</span><br />               logfile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'x.log'</span>, <span style="color: #000000;">&#123;</span> nRow, nPasteRow, nDataRows <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// INSERTED              </span><br />               <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> nRow <= <span style="color: #000000;">&#40;</span> nDataRows + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> .and. lContinue<br />                  <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br />                     cText += CRLF<br />                  <span style="color: #00C800;">endif</span><br />                  cText    += ::<span style="color: #000000;">ClpRow</span><span style="color: #000000;">&#40;</span> .t., aCols <span style="color: #000000;">&#41;</span><br /><br />                  lContinue := <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>            <span style="color: #B900B9;">// Eval( ::bSkip, 1 )</span><br />                  nRow ++<br />                  <span style="color: #00C800;">if</span> nRow % <span style="color: #000000;">1000</span> == <span style="color: #000000;">0</span> .or. nRow > <span style="color: #000000;">353000</span>  <span style="color: #B900B9;">// INSERTED</span><br />                     logfile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'x.log'</span>, <span style="color: #000000;">&#123;</span> nRow, nPasteRow, nDataRows <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// INSERTED</span><br />                  <span style="color: #00C800;">endif</span> <span style="color: #B900B9;">// INSERTED            </span><br />                  <br /> </div>[/code:a783rpgb] Examine the log file after termination of the program.
oBrw:ToExcel() error
Mr. Rao; Hi. Thank you for the information. The error log is being saved to a systemerrors table. I get to inspect the table on a daily base looking for bugs. However, I don't have an installation where the program is used by less than 70 users and although I do know the login user's name that generates the runtime error, I do not have access to c: drive of each workstation. Therefore loggin to x.log will not help. Loggin to a shared drive won't help either as x.log would be re-written time and again by many users. I will try to log to a table each time this piece of code executes and hopefully I will be able to match the runtime error to it. Trying to export 353k records to excel does not make any sense to me. In theory users may set a filter and then try to export to excel that subset that passes the filter condition. Filters are created using AOFs. bKeyCount() might be the problem here as it might not be respecting filters ...? If so, then this is something I can fix. I'll get back when I have more info. Thank you, Reinaldo.
oBrw:ToExcel() error
[quote:1evtb8o6]bKeyCount() might be the problem here as it might not be respecting filters ...?[/quote:1evtb8o6] Likely. Actually the Loop should end when either nRow > Eval( bKeyCount ) .or. Eval( bSkip, 1 ) != 1, whichever happens first. You can try checking behavior of these codeblocks.
oBrw:ToExcel() error ACTIVESHEET:CELLS/0 S_OK: _FORMULA
Hi, My program was worked good until few days. I havnt changed anything is source code. Now while XBROWSE exporting data to EXCEL 'TXBROWSE:TOEXCEL()' method produce error: Application =========== Path and name: C:\dantools\dantools.exe (32 bits) Size: 3,117,056 bytes Time from start: 0 hours 0 mins 36 secs Error occurred at: 26/04/2012, 15:06:10 Error description: Error Excel.Application:ACTIVESHEET:CELLS/0 S_OK: _FORMULA Args: [ 1] = C =SUBTOTAL(9,I2:I87) Stack Calls =========== Called from: source\rtl\win32ole.prg => TOLEAUTO:_FORMULA(0) Called from: .\xbrowse.PRG => TXBROWSE:TOEXCEL(6871) Called from: .\mybrowse.PRG => (b)EXCELMENU(457) Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE(474) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:SHOWPOPUP(1484) Called from: .\mybrowse.PRG => (b)BTNBAR(307) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(466) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(660) Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1489) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1455) Called from: .\source\classes\WINDOW.PRG => _FWH(3409) Called from: => DIALOGBOXINDIRECT(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273) Called from: .\mybrowse.PRG => MYBROWSE(197) Called from: .\sql.PRG => IZVRSISQL(583) Called from: .\sql.PRG => (b)SQL(101) Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK(176) Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT(1447) Called from: .\source\classes\WINDOW.PRG => _FWH(3409) Called from: => SENDMESSAGE(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND(407) Called from: => TWINDOW:HANDLEEVENT(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(933) Called from: => DIALOGBOXINDIRECT(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273) Called from: .\sql.PRG => SQL(456) Called from: .\dantools.PRG => (b)TAPPLICATION:BUILDMENU(261) Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(441) Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(1043) Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND(243) Called from: => TMDIFRAME:HANDLEEVENT(0) Called from: .\source\classes\WINDOW.PRG => _FWH(3409) Called from: => WINRUN(0) Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(992) Called from: .\dantools.PRG => TAPPLICATION:ACTIVATE(207) Called from: .\dantools.PRG => MAIN(122) While analizing i remembered that i have changed "List Separator" in "Regional and Language Options" from "," to "|" I need that from time to time for saving EXCEL files as ".CSV" file with "|" separator. I put it back to "," and program work OK. I maded one more test: Changed "List Separator" with "|" and in XBROWSE CLASS in static function SetExcelLanguage( oExcel ) changed line: cxlSum := "SUBTOTAL(9," with cxlSum := "SUBTOTAL(9|" and program work good. SO: "," character really is "List Separator" which is put in "Regional and Language Options" My Question is HOW TO DETERMINE "List Separator" from "Regional and Language Options" and how to send it like a parameter to XBROWSE Or some other solution PLEASE. No sense to change program all time or not changing "Regional and Language Options" Best Regards,
oBrw:ToExcel() error ACTIVESHEET:CELLS/0 S_OK: _FORMULA
[quote:dsdolc1t]My Question is HOW TO DETERMINE "List Separator" from "Regional and Language Options" and how to send it like a parameter to XBROWSE [/quote:dsdolc1t] We shall soon provide a way for the programmer to specify language specific parameters, to replace the defaults where necessary. We also need to do this commonly for toExcel() methods both in XBrowse and Treport.
oBrw:ToExcel() error ACTIVESHEET:CELLS/0 S_OK: _FORMULA
Hi Rao, Thanks for reply, I see but ... some sugestions for now ? I ask again ...any chance to TO DETERMINE "List Separator" from "Regional and Language Options" from FWH If yes i will make some changes to XBROWSE class to use "List Separator" May be i can ask user when start oBrw:ToExcel() what "List Separator" use but that is amateurish and however someone dont know what is that If no ...any chance to use TRY clausule to stop CRASHING ptogram ? Any ideas useful Best Regards,
oBrw:ToExcel() error ACTIVESHEET:CELLS/0 S_OK: _FORMULA
Great Mr. Rao. I also offer my help to test on spanish systems. Thank you very much.
oBrw:ToExcel() error ACTIVESHEET:CELLS/0 S_OK: _FORMULA
Hi Rao, [b:ni90rcan]I please again ... some sugestions for now ?[/b:ni90rcan] any chance to TO DETERMINE "List Separator" from "Regional and Language Options" from FWH If yes i will make some changes to XBROWSE class to use "List Separator" [b:ni90rcan]If no ...any chance to use TRY clausule to stop CRASHING program ?[/b:ni90rcan] Any ideas useful Best Regards,
oBrw:ToExcel() error ACTIVESHEET:CELLS/0 S_OK: _FORMULA
??
oBrw:ToExcel() error ACTIVESHEET:CELLS/0 S_OK: _FORMULA
My solution for this problem. First i added a function [b:3siyxqck]GetListSeparator()[/b:3siyxqck] in XBROWSE CLASS which return "List Separator" from "Regional and Language Options" [code=fw:3siyxqck]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> GetListSeparator<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Return "List Separator" from "Regional and Language Options"</span><br /><br /><span style="color: #B900B9;">// Managing Register services from FiveWin</span><br /><br /><span style="color: #00D7D7;">#define</span>  HKEY_CLASSES_ROOT       <span style="color: #000000;">2147483648</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_CURRENT_USER       <span style="color: #000000;">2147483649</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_LOCAL_MACHINE      <span style="color: #000000;">2147483650</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_USERS              <span style="color: #000000;">2147483651</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_PERFORMANCE_DATA   <span style="color: #000000;">2147483652</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_CURRENT_CONFIG     <span style="color: #000000;">2147483653</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_DYN_DATA           <span style="color: #000000;">2147483654</span><br /><br /><br />   <span style="color: #00C800;">local</span> cListSeparator := <span style="color: #ff0000;">","</span>  <span style="color: #B900B9;">// Default value</span><br />   <span style="color: #00C800;">local</span> hKey, cName, uValue, n := <span style="color: #000000;">0</span><br /><br />   <span style="color: #00C800;">if</span> RegOpenKey<span style="color: #000000;">&#40;</span> HKEY_CURRENT_USER,;<br />         <span style="color: #ff0000;">"Control Panel<span style="color: #000000;">\I</span>nternational"</span>, @hKey <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />      <span style="color: #00C800;">while</span> RegEnumValue<span style="color: #000000;">&#40;</span> hKey, n++, @cName, @uValue <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />            <span style="color: #00C800;">if</span> cName = <span style="color: #ff0000;">"sList"</span><br />               cListSeparator := <span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span> uValue, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endif</span><br />      end<br /><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cListSeparator</div>[/code:3siyxqck] In class XBROWSE in method [b:3siyxqck]METHOD ToExcel( bProgress, nGroupBy, aCols ) CLASS TXBrowse[/b:3siyxqck] i changed lines: [b:3siyxqck]if ! Empty( cxlSum ) cxlAggr := cxlSum[/b:3siyxqck] with: [b:3siyxqck] if ! Empty( cxlSum ) // cxlAggr := cxlSum cxlAggr := left(cxlSum,len(alltrim(cxlSum))-1) + GetListSeparator() [/b:3siyxqck] Working nice with English and probably Spanis .. i am not sure for other languages. First i started with changing in: [b:3siyxqck]static function SetExcelLanguage( oExcel )[/b:3siyxqck] changed line: [b:3siyxqck]cxlSum := "SUBTOTAL(9,"[/b:3siyxqck] with: [b:3siyxqck]cxlSum := "SUBTOTAL(9" + GetListSeparator()[/b:3siyxqck] Working GOOD BUT if change list separator while program is still active program CRASH again with the same error: [b:3siyxqck]Error description: Error Excel.Application:ACTIVESHEET:CELLS/0 S_OK: _FORMULA[/b:3siyxqck] So I think first WAY is ok but i still ask for your opinion or some other or better solution. Best regards,
oBrw:ToExcel() error ACTIVESHEET:CELLS/0 S_OK: _FORMULA
An easier way to get list separator is cListSeparator := oExcel:International[ 5 ]
oBrw:aCols[5]:SetColsAsRows( ) SOLUCIONADO
Buenas noches amigos. Estoy tratando de agregar nuevas funcionalidades a un programa de Nominas Quincenales que he desarrollado. Tengo un pequeño inconveniente: Al utilizar :SetColsAsRows() todo funciona, excepto porque el fondo de las columnas unidas no se pinta totalmente en la columna única creada. Parece como que pinta segun el tamaño de las columnas agregadas. ¿Cómo solucionar esto? Dejo la siguiente imagen. [url=http&#58;//www&#46;4shared&#46;com/photo/38I_CtgWce/Plani&#46;html:1r3g7iwd][img:1r3g7iwd]http&#58;//dc529&#46;4shared&#46;com/img/38I_CtgWce/1458c4f8d78/Plani&#46;bmp[/img:1r3g7iwd][/url:1r3g7iwd] Muchas gracias de antemano.
oBrw:aCols[5]:SetColsAsRows( ) SOLUCIONADO
Disculpen, olvidé poner el código. [code=fw:273mawbb]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oLbx <span style="color: #0000ff;">ID</span> <span style="color: #000000;">181</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"Plani"</span>,<span style="color: #ff0000;">"Seccion"</span>,<span style="color: #ff0000;">"Ninssbi"</span>,<span style="color: #ff0000;">"Numemp"</span>,<span style="color: #ff0000;">"Nombre"</span>,<span style="color: #ff0000;">"MF"</span>,<span style="color: #ff0000;">"Sbasico"</span>,<span style="color: #ff0000;">"Dias_t"</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ALIAS</span> cAlias CELL LINES FOOTERS &nbsp;<span style="color: #B900B9;">// FASTEDIT</span><br /><br />&nbsp; &nbsp;WITH OBJECT oLbx<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">Nombre</span>:<span style="color: #000000;">oDataFont</span> := <span style="color: #000000;">&#123;</span>|| oFont <span style="color: #000000;">&#125;</span> <br /><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nFreeze</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">5</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW &nbsp; <span style="color: #B900B9;">//ilumina toda la linea</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrHeader</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">140</span>, &nbsp;<span style="color: #000000;">0</span>, &nbsp;<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">231</span>, <span style="color: #000000;">242</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrFooter</span> &nbsp; &nbsp;:= :<span style="color: #000000;">bClrHeader</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Colores texto de footers</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//:bClrStd &nbsp; &nbsp; &nbsp; := {|| { nRGB( &nbsp;0, &nbsp;0, &nbsp;0), nRGB(255,248,220) } } &nbsp;// colores para lineas normales</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> &nbsp;<span style="color: #000000;">0</span>, &nbsp;<span style="color: #000000;">0</span>, &nbsp;<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, aGradRowSel <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSelFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, aGradBarSel <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> &nbsp; &nbsp; <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lKinetic</span> &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lContrastClr</span> &nbsp;:= .f. &nbsp;<span style="color: #B900B9;">//para que no cambie color de texto automaticamente segun intensidad del fondo</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nRowHeight</span> &nbsp; &nbsp;:= <span style="color: #000000;">50</span> &nbsp;<span style="color: #B900B9;">//altura entre lineas</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nColDividerStyle</span>:=LINESTYLE_LIGHTGRAY<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nRowDividerStyle</span>:=LINESTYLE_LIGHTGRAY<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">For</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Next</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//SUPER HEADERS</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DATOS &nbsp;DEL &nbsp;TRABAJADOR"</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">7</span><span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #B900B9;">//, oFont1 )</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DATOS DEL DEVENGADO"</span>, &nbsp;<span style="color: #000000;">8</span>, <span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #B900B9;">//, oFont1 )</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DATOS DE DEDUCCIONES"</span>, &nbsp;<span style="color: #000000;">24</span>, <span style="color: #000000;">31</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//, oFont1 )</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"NETO"</span>, &nbsp;<span style="color: #000000;">32</span>, <span style="color: #000000;">32</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//, oFont1 )</span><br /><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">03</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddBmpFile</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">".<span style="color: #000000;">\E</span>mo1_16x16.bmp"</span> <span style="color: #000000;">&#41;</span> &nbsp;; &nbsp;:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">03</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nGrpBmpNo</span> &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">08</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddBmpFile</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">".<span style="color: #000000;">\E</span>mo2_16x16.bmp"</span> <span style="color: #000000;">&#41;</span> &nbsp;; &nbsp;:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">08</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nGrpBmpNo</span> &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddBmpFile</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">".<span style="color: #000000;">\E</span>mo4_16x16.bmp"</span> <span style="color: #000000;">&#41;</span> &nbsp;; &nbsp;:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nGrpBmpNo</span> &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">32</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddBmpFile</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">".<span style="color: #000000;">\E</span>mo3_16x16.bmp"</span> <span style="color: #000000;">&#41;</span> &nbsp;; &nbsp;:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">32</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nGrpBmpNo</span> &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp; ADD oCol <span style="color: #0000ff;">TO</span> oLbx <span style="color: #00C800;">AT</span> <span style="color: #000000;">6</span> <span style="color: #00C800;">DATA</span> Capitalize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>oLbx:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Cargo<span style="color: #000000;">&#41;</span> HEADER <span style="color: #ff0000;">"Cargo"</span><br /><br />&nbsp; &nbsp; oLbx:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span>,<span style="color: #000000;">6</span>,<span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> DlgSetup<span style="color: #000000;">&#40;</span>oDlg,oLbx,bGeneros,oFont1<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; oFont:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; oFont1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:273mawbb]
oBrw:aCols[5]:SetColsAsRows( ) SOLUCIONADO
OK, solucionado. Debe ser mi version 1204. Voy a revisar la Classe y tratar de modificarla. //Para pintar bien fondo de cols de menor tamaño a la que se unen con :SetColsAsRow() oBrw:aCols[6]:nWidth := oBrw:aCols[5]:nWidth oBrw:aCols[8]:nWidth := oBrw:aCols[5]:nWidth Saludos.
oBrw:aCols[x]:Hide() muuuy lento
Hola jovenes, Requiriendo de su sapiencia. Uso TXBROWSE y defino las columnas asi: ADD TO oBrw DATA (Archivo)->Campo Posteriormente, si no deseo que alguna columna sea mostrada pero que aparezca cuando se de clic derecho en los encabezados, uso: oBrw:aCols[x]:Hide() El asunto es que, por ejemplo, tengo 44 columnas de las cuales solo se mostraran 7 y el resto se ocultaran con la instruccion anterior. Con las condiciones anteriores, la ventana que contiene el xBrowse tarda 16 segundos en aparecer, pero con solo eliminar la instruccion para ocultar las columnas (esto es, que muestre todas), la ventana ahora solo tarda 3 segundos en aparecer. Alguna idea de porque es tan lenta esta instruccion? Salu2
oBrw:aCols[x]:Hide() muuuy lento
probaste que pasa si usas nWidth= 0 o si utilizas colores, probaste sacarle los colores? o fijarte si usas que la ultima columna tome todo el ancho que quede del xBrowse? otra pregunta, utlizar datos de tablas o mysql? si es asi yo hay veces que hago la consulta de suponte 5 campos y solo en el xbrowe defino 2, si se que los otros no los voy a mostrar (pero si usarlo para otro procedimiento) no los defino en el xbrowse.
oBrw:aCols[x]:Hide() muuuy lento
Hola goosfancito, Gracias por contestar. No puedo usar nWith=0 porque aparecerian las rayas verticales divisorias y si el usuario desea ver una de las "minimizadas" deberia ampliar todas para ver cual es la que necesita. Los colores si son necesarios porque sirven para diferenciar el sexo de los animales que esta mostrando. Si hago que la ultima columna ocupe el resto de la ventana, al "des-ocultar" una columna no sera visible en la ventana a menos que reduzca la ultima columna o recorra la lista. No uso mysql, es una DBF y aunque de inicio muestre solo algunas columnas, el usuario debe tener disponibles todos los campos por si desea incluir otra columna al dar clic con el boton derecho en los encabezados.
oBrw:aCols[x]:Hide() muuuy lento
Rodolfo Para entender tu codificación. Si mostras 7 columnas, porque necesitás ADD las 44?
oBrw:aCols[x]:Hide() muuuy lento
La informacion basica se encuentra en esas 7 columnas, pero si el usuario desea ver la informacion adicional bastaria con dar clic derecho en el area de encabezados y seleccionar las columnas que ahora desea ver.
oBrw:bClrStd error in 16.04
Hi, I was using it in 16.02 without any error. [code=fw:wj25rtvi]<div class="fw" id="{CB}" style="font-family: monospace;">  oBrw:<span style="color: #000000;">bClrStd</span>   := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#93;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,GetSysColor<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>    <span style="color: #B900B9;">// Line 569</span><br /> </div>[/code:wj25rtvi] But it gives an error in 16.04. [code=fw:wj25rtvi]<div class="fw" id="{CB}" style="font-family: monospace;">   Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1132</span>  Bound error: <span style="color: #000000;">array</span> access<br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = A   <span style="color: #000000;">&#123;</span> ... <span style="color: #000000;">&#125;</span> length: <span style="color: #000000;">0</span><br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = N   <span style="color: #000000;">1</span><br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>:  => ARRAY:__OPARRAYINDEX<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>TXBROWSE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">653</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBROWSE:<span style="color: #000000;">AROW</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\Kasa.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>GET_NEW_KASA<span style="color: #000000;">&#40;</span> <span style="color: #000000;">569</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBRWCOLUMN:<span style="color: #000000;">CREATEBARGET</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">12452</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBRWCOLUMN:<span style="color: #0000ff;">ADJUST</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">10475</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBROWSE:<span style="color: #0000ff;">ADJUST</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1284</span> <span style="color: #000000;">&#41;</span></div>[/code:wj25rtvi] Any help?
oBrw:bClrStd error in 16.04
This must have happened when browsing an empty array. Please make this modification in xbrowse.prg: Please locate METHOD CreateBarGet() CLASS TXBrwColumn ( Line 12450 ) [code=fw:19980xdr]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> CreateBarGet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> &nbsp;TXBrwColumn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aColors &nbsp;:= Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bClrEdit</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> lRight &nbsp; := .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">uBarGetVal</span> != <span style="color: #00C800;">nil</span> .and. ::<span style="color: #000000;">oBarGet</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; lRight &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">uBarGetVal</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:19980xdr] Move assignment of aColors from declaration to after the if condition like this: [code=fw:19980xdr]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> CreateBarGet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> &nbsp;TXBrwColumn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aColors &nbsp;<span style="color: #B900B9;">//:= Eval( ::bClrEdit )</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> lRight &nbsp; := .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">uBarGetVal</span> != <span style="color: #00C800;">nil</span> .and. ::<span style="color: #000000;">oBarGet</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; aColors &nbsp; &nbsp; := Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bClrEdit</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Inserted</span><br />&nbsp; &nbsp; &nbsp; lRight &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">uBarGetVal</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:19980xdr] With this correction, you should not get this error. But we have a general advice about the definition of bClrStd Your definition: [code=fw:19980xdr]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bClrStd</span> &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#93;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,GetSysColor<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span></div>[/code:19980xdr] This assumes that bClrStd will never be evaluated when the Array is empty. This is not a very safe assumption. It is better to code this in a safe manner like this [code=fw:19980xdr]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bClrStd</span> &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nLen</span> > <span style="color: #000000;">0</span> .and. oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#93;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,GetSysColor<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span></div>[/code:19980xdr]
oBrw:bClrStd error in 16.04
Thank you mr. Rao, It is working now.
oBrw:bKeyDown VK_LEFT y VK_RIGHT ( SOLUCIONADO )
Hola que tal: Yo pude capturar las pulsaciones de VK_Down y VK_Right pero cambiándolas en el tGet.prg por lo que mi contestación te valdría si tienes un Get cuando quieres capturarlas. Yo me cree una variable publica que la llame zGetKey y la puse en valor 1 y en las ventanas que quiero capturar el VK_Left, el VK_Right, el VK_Up y el VK_Down les cambie el valor a 2, 3 y 4. Después copie el tGet.prg de Source a la carpeta de la aplicación y lo edite y me fui al METHOD KeyDown y dentro del do case en : case nKey == VK_UP, nKey == VK_DOWN, nKey == VK_LEFT y nKey == VK_RIGHT, cree un do case en cada uno con las acciones que quiero y lo meti dentro de la compilación. El METHOD KeyDown del tGet.prg me queda así: [code=fw:2bf17u1i]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> KeyDown<span style="color: #000000;">&#40;</span> nKey, nFlags <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TGet<br /><br />   <span style="color: #00C800;">local</span> nHi, nLo, nPos, nLastHi := <span style="color: #000000;">-1</span>, uVal<br /><br />   ::<span style="color: #000000;">nLastKey</span> = nKey<br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bKeyDown</span> != <span style="color: #00C800;">nil</span><br />      <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> uVal := Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bKeyDown</span>, nKey, nFlags, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"N"</span> .and. ;<br />         uVal == <span style="color: #000000;">0</span><br />         <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />          <span style="color: #00C800;">case</span> nKey == VK_PRIOR<br />               <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lSpinner</span><br />                  Self--<br />               <span style="color: #00C800;">endif</span><br /><br />          <span style="color: #00C800;">case</span> nKey == VK_NEXT<br />               <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lSpinner</span><br />                  <span style="color: #00C800;">Self</span>++<br />               <span style="color: #00C800;">endif</span><br /><br />      <span style="color: #00C800;">case</span> nKey == VK_UP<br />        <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">1</span><br />             <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">aControls</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">1</span><br />               ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoPrevCtrl</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />               <span style="color: #00C800;">return</span> <span style="color: #000000;">1</span>   <span style="color: #B900B9;">// avoid default behavior</span><br />             <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">2</span><br />             arriba<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">3</span><br />             arribaf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">4</span><br />             arriadfa<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endcase</span><br />      <span style="color: #00C800;">case</span> nKey == VK_DOWN<br />        <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">1</span><br />             <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">aControls</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">1</span><br />               ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />               <span style="color: #00C800;">return</span> <span style="color: #000000;">1</span><br />             <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">2</span><br />             abajo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">3</span><br />             abajof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">4</span><br />             abajadfa<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endcase</span><br /><br />      <span style="color: #00C800;">case</span> nKey == VK_LEFT<br />        <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">1</span><br />             <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />                ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">WordLeft</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">else</span><br />                ::<span style="color: #000000;">oGet</span>:<span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">endif</span><br /><br />             ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> = <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />             <span style="color: #00C800;">while</span> .t.<br />                CallWindowProc<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nOldProc</span>, ::<span style="color: #000000;">hWnd</span>, WM_KEYDOWN, nKey, nFlags <span style="color: #000000;">&#41;</span><br />                ::<span style="color: #000000;">GetSelPos</span><span style="color: #000000;">&#40;</span> @nLo, @nHi <span style="color: #000000;">&#41;</span><br />                <span style="color: #00C800;">if</span> nLo <= ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> - <span style="color: #000000;">1</span><br />                   EXIT<br />                <span style="color: #00C800;">endif</span><br />             end<br />             ::<span style="color: #000000;">nPos</span> = nLo + <span style="color: #000000;">1</span><br />             <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nPos</span> < ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span><br />                ::<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> <span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">else</span><br />                ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> = ::<span style="color: #000000;">nPos</span><br />             <span style="color: #00C800;">endif</span><br />             <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">2</span><br />             izquierda<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">3</span><br />             izquierdaf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">4</span><br />             izquadfa<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endcase</span><br /><br />      <span style="color: #00C800;">case</span> nKey == VK_RIGHT<br />        <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">1</span><br />             nPos = ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span><br />             <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />                ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">wordRight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">else</span><br />                ::<span style="color: #000000;">oGet</span>:<span style="color: #0000ff;">right</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">endif</span><br />             <span style="color: #00C800;">if</span> nPos <> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span><br />                <span style="color: #00C800;">while</span> .t.<br />                   CallWindowProc<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nOldProc</span>, ::<span style="color: #000000;">hWnd</span>, WM_KEYDOWN, nKey, nFlags <span style="color: #000000;">&#41;</span><br />                   ::<span style="color: #000000;">GetSelPos</span><span style="color: #000000;">&#40;</span> @nLo, @nHi <span style="color: #000000;">&#41;</span><br />                   <span style="color: #00C800;">if</span> nHi + <span style="color: #000000;">1</span> >= ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> .or. ::<span style="color: #000000;">lPassword</span> .or. ;<br />                      nHi == nLastHi<br />                      EXIT<br />                   <span style="color: #00C800;">endif</span><br />                   nLastHi = nHi<br />                end<br />                ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> = nHi + <span style="color: #000000;">1</span><br />                ::<span style="color: #000000;">nPos</span>     = nHi + <span style="color: #000000;">1</span><br />             <span style="color: #00C800;">endif</span><br />             <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">2</span><br />             derecha<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">3</span><br />             derechaf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">case</span> zGetKey = <span style="color: #000000;">4</span><br />             dereadfa<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endcase</span><br />                                          <span style="color: #B900B9;">// Many thanks to HMP</span><br />      <span style="color: #00C800;">case</span> nKey == VK_INSERT .and. ! GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span> ;<br />           .and. ! GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// to copy to the clipboard</span><br /><br />           Set<span style="color: #000000;">&#40;</span> _SET_INSERT, ! Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />           DestroyCaret<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">if</span> Set<span style="color: #000000;">&#40;</span> _SET_INSERT <span style="color: #000000;">&#41;</span><br />              CreateCaret<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">6</span>, ::<span style="color: #000000;">nGetChrHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">else</span><br />              CreateCaret<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">2</span>, ::<span style="color: #000000;">nGetChrHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">endif</span><br />           ShowCaret<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">&#40;</span> nKey == VK_INSERT .and. GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .or. ;<br />           <span style="color: #000000;">&#40;</span> nKey == <span style="color: #0000ff;">ASC</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"V"</span><span style="color: #000000;">&#41;</span> .and. GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .or. ;<br />           <span style="color: #000000;">&#40;</span> nKey == <span style="color: #0000ff;">ASC</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'X'</span><span style="color: #000000;">&#41;</span> .and. GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .and. ;<br />           ! lAnd<span style="color: #000000;">&#40;</span> nFlags, <span style="color: #000000;">2</span> ** <span style="color: #000000;">29</span> <span style="color: #000000;">&#41;</span><br /><br />          <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lReadOnly</span><br />             CallWindowProc<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nOldProc</span>, ::<span style="color: #000000;">hWnd</span>, WM_KEYDOWN, nKey, nFlags <span style="color: #000000;">&#41;</span><br />             SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">buffer</span> <span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"C"</span><br />                ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">buffer</span> = Pad<span style="color: #000000;">&#40;</span> GetWindowText<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">buffer</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />                SetWindowText<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">buffer</span> <span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">else</span><br />                ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">buffer</span> = GetWindowText<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">endif</span><br />             ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Assign</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />             <span style="color: #B900B9;">// ::GetSelPos( @nLo, @nHi )</span><br />             <span style="color: #B900B9;">// ::nPos = nHi + 1</span><br />             <span style="color: #B900B9;">// ::oGet:Pos = ::nPos</span><br />             <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bChange</span> != <span style="color: #00C800;">nil</span><br />                Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bChange</span>, nKey, nFlags, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">endif</span><br />          <span style="color: #00C800;">endif</span><br /><br />          <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br />      <span style="color: #00C800;">case</span> nKey == VK_HOME .or. nKey == VK_END<br /><br />           <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span><br />              CallWindowProc<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nOldProc</span>, ::<span style="color: #000000;">hWnd</span>, WM_KEYDOWN, nKey, nFlags <span style="color: #000000;">&#41;</span><br /><br />              ::<span style="color: #000000;">GetSelPos</span><span style="color: #000000;">&#40;</span> @nLo, @nHi <span style="color: #000000;">&#41;</span><br />              ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> = nLo + <span style="color: #000000;">1</span><br />              ::<span style="color: #000000;">nPos</span> = nLo + <span style="color: #000000;">1</span><br />           <span style="color: #00C800;">else</span><br />               <span style="color: #00C800;">if</span> nKey == VK_HOME<br />                  ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Home</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                  ::<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> <span style="color: #000000;">&#41;</span><br />               <span style="color: #00C800;">endif</span><br /><br />               <span style="color: #00C800;">if</span> nKey == VK_END<br />                  ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                  ::<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Pos</span> <span style="color: #000000;">&#41;</span><br />               <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br />      <span style="color: #00C800;">case</span> nKey == VK_DELETE .or. nKey == VK_BACK<br /><br />           <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lReadOnly</span><br />              <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br />           <span style="color: #00C800;">endif</span><br /><br />           <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lDrag</span><br />              <span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">KeyDown</span><span style="color: #000000;">&#40;</span> nKey, nFlags <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">endif</span><br /><br />           ::<span style="color: #000000;">GetSelPos</span><span style="color: #000000;">&#40;</span> @nLo, @nHi <span style="color: #000000;">&#41;</span><br /><br />           <span style="color: #B900B9;">// Deletes selection</span><br />           <span style="color: #00C800;">if</span> nHi != nLo<br />              ::<span style="color: #000000;">GetDelSel</span><span style="color: #000000;">&#40;</span> nLo, nHi <span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span><br />                 CallWindowProc<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nOldProc</span>, ::<span style="color: #000000;">hWnd</span>, WM_KEYDOWN, nKey, nFlags <span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">else</span><br />              <span style="color: #00C800;">if</span> nKey == VK_DELETE<br />                 ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Delete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">else</span><br />                 ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">BackSpace</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">endif</span><br />           ::<span style="color: #000000;">EditUpdate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bChange</span> != <span style="color: #00C800;">nil</span><br />              Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bChange</span>, nKey, nFlags, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">KeyDown</span><span style="color: #000000;">&#40;</span> nKey, nFlags <span style="color: #000000;">&#41;</span></div>[/code:2bf17u1i] Observa que cuando vale zGetKey 1 es lo que originalmente había en el case. Un saludo Carlos
oBrw:bKeyDown VK_LEFT y VK_RIGHT ( SOLUCIONADO )
Saludos de nuevo: Alguien ha podido detectar cuando las teclas VK_LEFT y VK_RIGHT son presionadas via oBrw:bKeyDown de XBrowse.? El teclado alfanumerico es detectado más no así las teclas arriba, abajo, derecha e izquierda. [code=fw:31bjhrtz]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey |MSGInfo<span style="color: #000000;">&#40;</span>nKey<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></div>[/code:31bjhrtz] No hace nada al presionar dichas teclas, necesito detectarlas para continuar mi proyecto, ya he buscado en el foro pero los que preguntan por lo mismo en el foro no han sido rrespondidos o no han corpatido la solución.. Gracias.. <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Gracias..
oBrw:bKeyDown VK_LEFT y VK_RIGHT ( SOLUCIONADO )
Victor, Tienes que modificar el método KeyDown() de la Clase TXBrowse para detectar esas teclas y evaluar un codeblock (por ejemplo). Que necesitas hacer para esas teclas ? Igual se nos ocurre otra forma
oBrw:bKeyDown VK_LEFT y VK_RIGHT ( SOLUCIONADO )
Gracias por tomarse la molestia de leer mi petición: Carlos: Con get no hay problema, tengo algo similiar a lo que me comentas para obtener estas teclas, solo necesito obtenerlas y hacer que funcionen en la clase xbrowse, de todas maneras muchas gracias por tu comentario... <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> Maestro Antonio: Estoy trabajando con oBrw:SetTree() de xBrowse para obtener el árbol de directorios de un disco duro, pero como solo tiene 1 columna y el scroll horizontal no reposiciona el xbrowse para ver lo que esta oculto: [img:1v6onso9]http&#58;//img14&#46;imageshack&#46;us/img14/876/j8f3&#46;jpg[/img:1v6onso9] He solucionado este detalle haciendo chapuza, ocultando la barra de scroll horizontal que por defecto muestra xbrowse con: oBrw:lHScroll := .F. y a la vez poniendo una barra de scroll independiente para agrandar la columna y mover el xbrowse: [code=fw:1v6onso9]<div class="fw" id="{CB}" style="font-family: monospace;">@ <span style="color: #000000;">30</span>, nX1 <span style="color: #0000ff;">xBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> nX2,<span style="color: #000000;">425</span> <span style="color: #0000ff;">Pixel</span> <span style="color: #0000ff;">OF</span> oObj1 NOBORDER<br /><br />@ <span style="color: #000000;">456</span>, <span style="color: #000000;">01</span> SCROLLBAR oHScroll <span style="color: #0000ff;">HORIZONTAL</span> <span style="color: #0000ff;">Pixel</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oObj1 RANGE <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">UP</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>nX1 <= <span style="color: #000000;">-2</span>, <span style="color: #000000;">&#40;</span>MueveBr<span style="color: #000000;">&#40;</span><span style="color: #000000;">-10</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">DOWN</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>nX1 <= oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span>, <span style="color: #000000;">&#40;</span>MueveBr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #B900B9;">// ON THUMBPOS(nTrack:= oHScroll:GetPos(),  oHScroll:SETPOS(nTrack), MSGInfo(nTrack))</span><br /> </div>[/code:1v6onso9] [code=fw:1v6onso9]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> MueveBr<span style="color: #000000;">&#40;</span>nMov<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> nLong,nPos,nRango<br /><br />oHScroll:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oHScroll:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   nX1:= nX1 - nMov<br />   nX2:= nX2 + nMov<br />nRango:= oHScroll:<span style="color: #000000;">GetRange</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> nLong:= oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span><br />  nPos:= INT<span style="color: #000000;">&#40;</span>nRango<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> + <span style="color: #000000;">&#40;</span>nMov/<span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br /><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span>:= nLong + nMov<br />oBrw:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span>nX2<span style="color: #000000;">&#41;</span><br />oBrw:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span>,nX1<span style="color: #000000;">&#41;</span><br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />oHScroll:<span style="color: #000000;">SetRange</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>,nPos<span style="color: #000000;">&#41;</span><br />oHScroll:<span style="color: #000000;">SETPOS</span><span style="color: #000000;">&#40;</span>nX2<span style="color: #000000;">&#41;</span><br />oHScroll:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Nil</span></div>[/code:1v6onso9] Funciona, pero solo puedo mover el scroll con el mouse, aqui es donde necesito detectar VK_LEFT y VK_RIGHT dentro de xbrowse que siempre tiene el foco para mover el scroll como si fuera propio de xbrowse, temia que no pudiera detectarse sin modificar el método KeyDown(). ¿ Cómo hacer que evalue un codeblock..?, Hasta ahora así he dejado el método cuando solo es 1 columna, que es lo más lógico para no afectar el funcionamiento normar de la Clase. [code=fw:1v6onso9]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">CASE</span> nKey == VK_LEFT<br /><br />      <span style="color: #00C800;">IF</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />         ::<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ELSE</span><br />          <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span><br />            <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Aki la función"</span>,<span style="color: #ff0000;">"VK_LEFT"</span><span style="color: #000000;">&#41;</span><br />          <span style="color: #00C800;">ELSE</span><br />             ::<span style="color: #000000;">GoLeft</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />          <span style="color: #00C800;">ENDIF</span><br /><br />      <span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #00C800;">CASE</span> nKey == VK_RIGHT<br /><br />      <span style="color: #00C800;">IF</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />         ::<span style="color: #000000;">GoRightMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ELSE</span><br />         <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span><br />            <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Aki la función"</span>,<span style="color: #ff0000;">"VK_RIGHT"</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">ELSE</span> <br />            ::<span style="color: #000000;">GoRight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">ENDIF</span><br />      <span style="color: #00C800;">ENDIF</span></div>[/code:1v6onso9] Aqui dejo un ejemplo autocontenido [url:1v6onso9]http&#58;//www&#46;mediafire&#46;com/download/9b4cwi7cyvbybaf/EXPLORAR&#46;rar[/url:1v6onso9] Gracias Maestro y estare pendiente de la solución..
oBrw:bKeyDown VK_LEFT y VK_RIGHT ( SOLUCIONADO )
Victor, Porque no usas un Tree (arbol) estandard de Windows ? Hay alguna razón en especial ?
oBrw:bKeyDown VK_LEFT y VK_RIGHT ( SOLUCIONADO )
Maestro Antonio: Porque los ejemplos que hay en samples no se adecuaron a lo que necesitaba, excepto xbrwdisk.prg que era lo más próximo por la facilidad que da xbrowse, lo adapte y modifique para lograr el objetivo, no sin antes haber probado con Treeview, pero era todo un lio armar todo el árbol jerarquizado a partir de "X" objetos hijos dependientes de un objeto padre en una DBF, y más aun el obtener los "PROMPTS" en base de los contenedores "CARGO", de hecho tambien me lie con SetTree, pero pude solucionarlo. Probe varias opciones, pocos códigos de ejemplo en el foro y en la carpeta samples del uso de la Clase Treeview ampliamente detallados, o de una clase ya orientada y completa a crear Tree´s, me conducieron a usar XBrowse, en el foro muchos diseñan Tree´s con Xbrowse, para lo que necesito esta casi terminada, excepto este detalle, que el scroll horizontal que tiene por defecto Xbrowse solo trabaja entre multiples columnas y no con la longitud de la única columna que se crea con SetTree(). [url:ktrio42s]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=26932#p149562[/url:ktrio42s] En el ejemplo que le envie puede probar y comprobar lo que le comento, comparandolo con xbrwdisk.prg. //*----------------------------------- Como comentario y sin intención de que suene a reclamo ni mucho menos: Hace algún tiempo atras se nos suguirio que cuando abriermos un post con alguna dificultad o duda que tuvieramos con algún proceso, lo comentaramos tanto posibles ideas como soluciones, muchos aún optan por no compartir como solucionaron sus problemas y cierran sus post con etiqueta de "SOLUCIONADO" dejandonos a muchos sin oportunidad de soluciones, es por eso que en el foro no hay muchos que nos quedamos a medias y lo peor, se esta pediendo información valiosa. *//----------------------------------- De tomas maneras sigo probando a modificar la clase Xbrowse, haber como lo soluciono.. Saludos..
oBrw:bKeyDown VK_LEFT y VK_RIGHT ( SOLUCIONADO )
[quote:2hh0stcu]Victor, Tienes que modificar el método KeyDown() de la Clase TXBrowse para detectar esas teclas y evaluar un codeblock (por ejemplo).[/quote:2hh0stcu] Alguien tiene una idea de como..? Gracias..
oBrw:bKeyDown VK_LEFT y VK_RIGHT ( SOLUCIONADO )
Después de haber investigado y aprendido un poco sobre Clases y Métodos he logrado mi objetivo sin tocar nada en la clase Xbrowse, lo he logrado usando "OVERRIDE METHOD" sobre la clase Xbrowse con Harbour gracias a la ayuda de Carlos Vargas: [url:161cvd1t]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=6317[/url:161cvd1t] Y quedo de la siguiente manera: Incluir en los defines: [code=fw:161cvd1t]<div class="fw" id="{CB}" style="font-family: monospace;"><br /># Include <span style="color: #ff0000;">"FiveWin.ch"</span><br /># Include <span style="color: #ff0000;">"xHbCls.ch"</span></div>[/code:161cvd1t] En la llamada a la Función Principal de Programa, si mi Ingles no me falla aqui establecemos lo siguiente: [color=#0000BF:161cvd1t][b:161cvd1t]Anular Metodo KeyDown en la Clase TXbrowse con MiKeyDown[/b:161cvd1t][/color:161cvd1t] [code=fw:161cvd1t]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br /><br /># Include <span style="color: #ff0000;">"FiveWin.ch"</span><br /># Include <span style="color: #ff0000;">"xHbCls.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> oIco,oBru<br /><br />OVERRIDE <span style="color: #00C800;">METHOD</span> KeyDown IN <span style="color: #00C800;">CLASS</span> TXBrowse WITH MiKeyDown<br /><br />..........</div>[/code:161cvd1t] Y el Procedimiento MiKeyDown() [code=fw:161cvd1t]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MiKeyDown<span style="color: #000000;">&#40;</span>nKey<span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br />      <br />      <span style="color: #00C800;">CASE</span> nKey == VK_LEFT<br />           <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>nX1 <= <span style="color: #000000;">-2</span>, <span style="color: #000000;">&#40;</span>MueveBr<span style="color: #000000;">&#40;</span><span style="color: #000000;">-10</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//Muevo el Browse y el Scroll con el teclado a la Izquierda</span><br />      <br />      <span style="color: #00C800;">CASE</span> nKey == VK_RIGHT<br />           nLong:= oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span><br />           <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>nLong >= <span style="color: #000000;">&#40;</span>nX2<span style="color: #000000;">-5</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>MueveBr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Muevo el Browse y el Scroll con el teclado a la Derecha</span><br />      <br />      <span style="color: #00C800;">CASE</span> nKey == VK_HOME<br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />           oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #B900B9;">//Muevo el Browse y el Scroll con el teclado al Inicio ( nativo de la clase xbrowse)</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">CASE</span> nKey == VK_UP <span style="color: #B900B9;">//Muevo el Browse y el Scroll con el teclado 1 Arriba ( nativo de la clase xbrowse)</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />           oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">CASE</span> nKey == VK_DOWN <span style="color: #B900B9;">//Muevo el Browse y el Scroll con el teclado 1 Abajo ( nativo de la clase xbrowse)</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />           oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />      <br />      <span style="color: #00C800;">CASE</span> nKey == VK_END <span style="color: #B900B9;">//Muevo el Browse y el Scroll con el teclado al Final ( nativo de la clase xbrowse)</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />           oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">CASE</span> nKey == VK_PRIOR <span style="color: #B900B9;">//Muevo el Browse y el Scroll Pagina Arriba ( nativo de la clase xbrowse)</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">IF</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />              oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">ELSE</span><br />              oBrw:<span style="color: #000000;">PageUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">ENDIF</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">CASE</span> nKey == VK_NEXT &nbsp;<span style="color: #B900B9;">//Muevo el Browse y el Scroll Pagina Abajo ( nativo de la clase xbrowse)</span><br />           oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">IF</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />              oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">ELSE</span><br />              oBrw:<span style="color: #000000;">PageDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">ENDIF</span><br />              oBrw:<span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>   <br />      <br />      <span style="color: #00C800;">ENDCASE</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">0</span></div>[/code:161cvd1t] Y con esto doy por cerrado el tema, a mi me funciona de perlas, voy a preparar un ejemplo sencillo para compartirlo. Gracias Maestro Antonio y a todos los que se tomaron la molestia de leer y comentar, seguiremos aprendiendo. <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: --> <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: --> <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: -->
oBrw:cBmpAdjBrush changed in FWH 9.04 ?
Hello, some month ago, we started a function ( Daniel ) for xBrowse [color=#BF0000:1ifirhoc]oBrw:cBmpAdjBrush[/color:1ifirhoc] During testing, i could change the background at runtime. This function is included now in FWH 9.04. Testing this function after the Update I noticed that, selecting a Image with button-action, the background ( adjusted in the browser before ) changes to tiled. I tested with the same image and function. Is there something wrong ( changed : doesn't work at runtime anymore ) ? At start : [img:1ifirhoc]http&#58;//www&#46;pflegeplus&#46;com/pictures/adjust1&#46;jpg[/img:1ifirhoc] With Button-selection ( same Image and function ) [img:1ifirhoc]http&#58;//www&#46;pflegeplus&#46;com/pictures/adjust2&#46;jpg[/img:1ifirhoc] It works only at Startup : [code=fw:1ifirhoc]<div class="fw" id="{CB}" style="font-family: monospace;"><br />....<br />....<br />oBrw:<span style="color: #000000;">l2007</span> := .T.<br /><br />oBrw:<span style="color: #000000;">lHScroll</span> := .T.<br />oBrw:<span style="color: #000000;">lVScroll</span> := .T.<br /><span style="color: #B900B9;">// Image - background  Works !!</span><br /><span style="color: #B900B9;">// ------------------------------------</span><br />GRADBMP1 := c_path + <span style="color: #ff0000;">"IMAGES<span style="color: #000000;">\F</span>antasy1.BMP"</span> <br />NEW_IMAGE<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br />...<br />...<br />oBrw:<span style="color: #000000;">lFastedit</span> := .T.<br />oBrw:<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">110</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// Image - select ( Changes to Tiled works like function < NEW_IMAGE( oBrw ) > )</span><br /><span style="color: #B900B9;">// --------------------------------------------------------------------------------------------</span><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn30 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> oDlg5  <span style="color: #000000;">2007</span> ;<br />FILENAME c_path + <span style="color: #ff0000;">"preview.bmp"</span> ;<br /><span style="color: #0000ff;">LEFT</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"  &Load Image   "</span> ;<br /><span style="color: #0000ff;">FONT</span> oProgFont ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cFilter := <span style="color: #ff0000;">"BMP (*.bmp)|*.bmp|"</span>, ;<br />   GRADBMP1 := cGetFile32<span style="color: #000000;">&#40;</span> cFilter,<span style="color: #ff0000;">"Select a Picture"</span> ,,  <span style="color: #ff0000;">"<span style="color: #000000;">\"</span> + CurDir() + "</span>\<span style="color: #0000ff;">IMAGES</span>\<span style="color: #ff0000;">" ), ;<br />   IIF( Empty( GRADBMP1 ), MsgAlert( "</span>No file selected !<span style="color: #ff0000;">","</span>ATTENTION<span style="color: #ff0000;">") , ;<br />         NEW_IMAGE( oBrw ) ) )   <br /><br />// ------------ DISPLAY Adjusted Image -------------<br /><br />STATIC FUNCTION NEW_IMAGE( oBrw )<br />oBrw:cBmpAdjBrush := ALLTRIM(GRADBMP1) <br />oBrw:SetBackGround( ALLTRIM(GRADBMP1) )<br />aeval( oBrw:aCols, { |o|o:lColTransparent := .t. } ) <br />oBrw:Refresh()<br />GRADBMP1 := "</span><span style="color: #ff0000;">"<br />RETURN NIL<br /><br />// -------------- DISPLAY Tiled Brush  ----------------<br /><br />FUNCTION NEW_BRUSH(oBrw)<br />Local oBrush1<br /><br />DEFINE BRUSH oBrush1 FILENAME ALLTRIM(GRADBMP1)<br />oBrw:SetBackGround( oBrush1 )<br />RELEASE BRUSH oBrush1<br />GRADBMP1 := "</span><span style="color: #ff0000;">"<br /><br />RETURN NIL<br /><br /> </span></div>[/code:1ifirhoc] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
oBrw:cBmpAdjBrush changed in FWH 9.04 ?
By comparing source code of xbrowse 903 and 904 I notice that line number 1014 "DeleteObject( hBmpNew )" is newly inserted in 904.
oBrw:cBmpAdjBrush changed in FWH 9.04 ?
Thank You very much for the information. I deleted the line, but still the same : at button-action, the background changes to tiled. I added a switch button to a other application. IT WORKS THERE. I have to check, where the difference comes from. ( I'm glad, that there is no bug ) The working browser ( switching the background between 2 Images ) inside a Folder [img:3tz3tulb]http&#58;//www&#46;pflegeplus&#46;com/pictures/switch1&#46;jpg[/img:3tz3tulb] [img:3tz3tulb]http&#58;//www&#46;pflegeplus&#46;com/pictures/switch2&#46;jpg[/img:3tz3tulb] [code=fw:3tz3tulb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />lSwitch := .T. <br /><span style="color: #00C800;">PRIVATE</span> aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">9</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 1"</span>, <span style="color: #ff0000;">"Row 1                          "</span> <span style="color: #000000;">&#125;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 2"</span>, <span style="color: #ff0000;">"Row 2                          "</span> <span style="color: #000000;">&#125;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 3"</span>, <span style="color: #ff0000;">"Row 3                          "</span> <span style="color: #000000;">&#125;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 4"</span>, <span style="color: #ff0000;">"Row 4                          "</span> <span style="color: #000000;">&#125;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 5"</span>, <span style="color: #ff0000;">"Row 5                          "</span> <span style="color: #000000;">&#125;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 6"</span>, <span style="color: #ff0000;">"Row 6                          "</span> <span style="color: #000000;">&#125;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 7"</span>, <span style="color: #ff0000;">"Row 7                          "</span> <span style="color: #000000;">&#125;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 8"</span>, <span style="color: #ff0000;">"Row 8                          "</span> <span style="color: #000000;">&#125;</span><br />aText<span style="color: #000000;">&#91;</span><span style="color: #000000;">9</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Row 9"</span>, <span style="color: #ff0000;">"Row 9                          "</span> <span style="color: #000000;">&#125;</span><br /><br />oLbx1 := TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />oLbx1:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br />oLbx1:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_BLACK<br />oLbx1:<span style="color: #000000;">nRecSelColor</span> = <span style="color: #000000;">15512898</span> <br />oLbx1:<span style="color: #000000;">bClrSelFocus</span> = <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> <span style="color: #000000;">16777215</span>, <span style="color: #000000;">15512898</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br />oLbx1:<span style="color: #000000;">bClrStd</span> = <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> <span style="color: #000000;">16777215</span>,  <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br />oLbx1:<span style="color: #000000;">bClrSel</span> = <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> <span style="color: #000000;">16777215</span>, <span style="color: #000000;">15512898</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br />oLbx1:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aTEXT <span style="color: #000000;">&#41;</span><br />oLbx1:<span style="color: #000000;">lHScroll</span> := .T.<br />oLbx1:<span style="color: #000000;">lVScroll</span> := .T.<br />oLbx1:<span style="color: #000000;">lFooter</span> := .T.<br />oLbx1:<span style="color: #000000;">lRecordSelector</span>  := .T.<br /><span style="color: #B900B9;">// -------------------</span><br />oLbx1:<span style="color: #000000;">cBmpAdjBrush</span> := <span style="color: #ff0000;">"Tree.bmp"</span> <br />oLbx1:<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Tree.bmp"</span> <span style="color: #000000;">&#41;</span><br />aeval<span style="color: #000000;">&#40;</span> oLbx1:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |o|o:<span style="color: #000000;">lColTransparent</span> := .t. <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <br /><span style="color: #B900B9;">// -------------------</span><br />oLbx1:<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">140</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// Switch - Button</span><br /><span style="color: #B900B9;">// ------------------</span><br /><span style="color: #0000ff;">REDEFINE</span> BUTTONBMP oBtn2  <span style="color: #0000ff;">ID</span> <span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> IIF<span style="color: #000000;">&#40;</span> lSwitch = .T., ;<br /><span style="color: #000000;">&#40;</span> lSwitch := .F., oLbx1:<span style="color: #000000;">cBmpAdjBrush</span> := <span style="color: #ff0000;">"Fish.bmp"</span> , ;<br />  oLbx1:<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Fish.bmp"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br /><span style="color: #000000;">&#40;</span> lSwitch := .T., oLbx1:<span style="color: #000000;">cBmpAdjBrush</span> := <span style="color: #ff0000;">"Tree.bmp"</span> , ;<br />  oLbx1:<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Tree.bmp"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;          <br />oLbx1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />BITMAP <span style="color: #ff0000;">"quit"</span> <span style="color: #0000ff;">PROMPT</span> SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"&Test Background"</span> TEXTRIGHT<br />oBtn2:<span style="color: #000000;">cToolTip</span> =  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Switch between"</span> + CRLF + ;<br />                             <span style="color: #ff0000;">"two Images"</span>,<span style="color: #ff0000;">"Image-Test"</span>, <span style="color: #000000;">1</span>, CLR_BLACK, <span style="color: #000000;">14089979</span> <span style="color: #000000;">&#125;</span> <br /> </div>[/code:3tz3tulb] Best regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
oBrw:cFilterFld
Compañeros en el foro: Tengo un xBrowse con el cual quiero auditoriar una tabla dbf, con dos indices TEMPORARY Al hacer click en cada una de las columnas que estan indexadas, todo trabaja bien, incluso busqueda incremental, pero cuando uso oBrw::lIncrFilter := .t., el filtro permanece con el de la primer busqueda, indistintamente cambie de columna (click en header). Es decir, si al entrar al browse click una de las columnas indexadas, la condicion de filtro se mantiene por esa columna cuando cambio a la otra. He intentado lo siguiente pero no funciona: [code=fw:1c0keq0m]<div class="fw" id="{CB}" style="font-family: monospace;">...<br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">lIncrFilter</span>      := .t.<br />      :<span style="color: #000000;">lSeekWild</span>        := .t.<br /><br />      :<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br />...<br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bRClickHeader</span> := <span style="color: #000000;">&#123;</span>|| oBrw:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"Cliente"</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>    <span style="color: #B900B9;">//no hace caso</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bRClickHeader</span> := <span style="color: #000000;">&#123;</span>|| oBrw:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"Descrip"</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>   <span style="color: #B900B9;">//no hace caso</span><br /><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"Cliente"</span>   <span style="color: #B900B9;">// da error</span><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"Descrip"</span>   <span style="color: #B900B9;">// da error</span><br /> </div>[/code:1c0keq0m] Hay alguna manera de corregir este comportamiento? Alguien ya lo ha hecho y quiere compartirlo? Muchas gracias.
oBrw:cFilterFld
[code=fw:1suew9wj]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bRClickHeader</span> := <span style="color: #000000;">&#123;</span>|| oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>. oBrw:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"Cliente"</span> <span style="color: #000000;">&#125;</span>   <br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bRClickHeader</span> := <span style="color: #000000;">&#123;</span>|| oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"Descrip"</span> <span style="color: #000000;">&#125;</span>  <br /> </div>[/code:1suew9wj] I personally prefer offering the choice of filter-field to the user in a combobox. That is more clear to the user. Please note filter field has nothing to do with index order.
oBrw:cFilterFld
[quote="nageswaragunupudi":2h43j4uf]oBrw:aCols[6]:bRClickHeader := {|| oBrw:Seek( "" ). oBrw:cFilterFld := "Cliente" }   oBrw:aCols[8]:bRClickHeader := {|| oBrw:Seek( "" ), oBrw:cFilterFld := "Descrip" }    [/quote:2h43j4uf] Mr. Nages, thanks por your reply. The behavior still the same. The incremental filter continues working on the previous column even when you click on the header of the other column. Best regards
oBrw:cFilterFld
[quote:32w10950]I personally prefer offering the choice of filter-field to the user in a combobox. That is more clear to the user. Please note filter field has nothing to do with index order.[/quote:32w10950] I will try your sugestion Regards
oBrw:cFilterFld
Mr. Nages. Sorry... was my mistake!!. It is working now. Thanks for your attention, again. Regards.
oBrw:cFilterFld
Glad to know it is working.
oBrw:cFilterFld 2 campos
lIncrFilter := .t. lSeekWild := .t. oBrw:cFilterFld := "CODE1+CODE2" como hacer? Es posible? []'s
oBrw:cFilterFld 2 campos
In that case please use bFilterExp instead of cFilterFld. Eg: oBrw:bFilterExp := { |cExp| Upper( cExp ) $ FIELD1 + FIELD2 } With bFilterExp we can have any complex filter conditions: Eg: oBrw:bFilterExp := { |cExp| Upper( cExp ) $ FIELD1 .AND. .NOT. ( Upper( cExp ) $ FIELD2 ) }
oBrw:nAt
When using tcbrowse the oBrw:nAt would take me to the proper record number in the data base when lddb clicking on the oBrw line. In xbrowse it seems to take me to the column. Is there something in xbrowse that will function to take me to the record rather then the column.Thanks
oBrw:nAt
I understand you are asking about browsing arrays.oXBrowse:nArrayAt is equivalent to oTCBrowse:nAt
oBrw:nAt
NageswaraRao:I spent soooo much time trying to figure out the answer. You've been a great help. oBrw:nArrayAt worked perfectly. So how does one learn this. Is there any documentation on getting the answer. Or just post and everyone helps each other?
oBrw:nAt
please read the documentation in the .hlp and .chm files in the fwh\manual folder. Also read whatsnew.txt in the fwh folder to read about the changes and improvements made after the documention was prepared.Please take time to study the samples in the fwh\samples folder. Becuase you are working with xbrowse, please study the samples on xbrowse in the samples folder.You will get answers to all your doubts. If you still have any problem then you can post here.
oBrw:report() ... control fonts
oRep:aFont already has two fonts built by the browse object oRep:aFont[ 1 ] is Tahoma size 0,-8 oRep:aFont[ 2 ] is Tahoma size 0,-8 bold I need to have another font I made oFontCopy := TFont():New("TAHOMA",0,-108,.F.,,180,,,,,,,,,,oRep:oDevice) //to print a text nscapment aadd(oRep:aFont, oFontCopy) then oRep:bStartPage := { || oRep:Say(10, cTextCopy, 3,2,1450) } why not run ? the error [code=fw:npz8fi0u]<div class="fw" id="{CB}" style="font-family: monospace;"> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1132</span>  Bound error: <span style="color: #000000;">array</span> access<br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = A   <span style="color: #000000;">&#123;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span> length: <span style="color: #000000;">2</span><br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = N   <span style="color: #000000;">3</span><br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Lib</span>\report.prg => TREPORT:<span style="color: #0000ff;">SAY</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">528</span> <span style="color: #000000;">&#41;</span></div>[/code:npz8fi0u] let say me there are only two element of array aFont but I need N 3 but on aFont there are 3 element ( xbrowse(oRep:afont) ) [img:npz8fi0u]https&#58;//i&#46;postimg&#46;cc/FFp540r3/kkkkk&#46;png[/img:npz8fi0u] How I can resolve ?
oBrw:report() how can you control fonts etc. in the print.
I really like the ability to move browse column around. Biggest problem now is to print the browse after altering it. I'm using oBrw:report() but I need the ability to size the print and cut it off when reaching a particular record.\Any suggestions on how to accomplish this?
oBrw:report() how can you control fonts etc. in the print.
>I'm using oBrw:report() but I need the ability to size the print and cut it off when reaching a particular record.\ I'm not sure what you mean by "size the print." If you mean change the size of the font, then you would either have to modify the xbrowse source or create a subclass because the font size of xBrowse:report() is hardcoded.You can filter or scope the database anyway you want before calling the Report() method.If you want more control of the report then I suggest using TReport instead.Regards,James
oBrw:report() how can you control fonts etc. in the print.
>I'm not sure what you mean by "size the print." If you mean change the size of the font, then you would either have to modify the xbrowse source or create a subclass because the font size of xBrowse:report() is >hardcoded. Yes change the font.> You can filter or scope the database anyway you want before calling the Report() method. Filter and scoping is working fine.Two problems...it is using the size front from the browse which is OK for screen but to font is to large for the print. Goes off the page.And it prints 6 extra pages. Won't stop at the last recored to print.>If you want more control of the report then I suggest using TReport instead. Not sure what treport is. Is that the regulat printing which I currently use or something else?Harvey
oBrw:report() how can you control fonts etc. in the print.
Mr Harvey and Mr James>If you mean change the size of the font, then you would either have to modify the xbrowse source or create a subclass because the font size of xBrowse:report() is hardcoded....If you want more control of the report then I suggest using TReport instead.>We can do with oBrw:Report( ... ) method itself, most of what we can do writing separate report using TReport. oBrw:Report( ... ) puts that flexibility in our hands through its bSetUp parameter. There is no need to change the XBrowse code or subclass the method.Syntax:oBrw:Report( <cTitle>, ; <lPreview>,; <lModal>, ; <bSetUp>, ; // xbrowse calls this codeblock for our setup <aGroupBy> )<aGroupBy> :If we want a grouped report, we need not write separate report program.Just giave an array of coulmns to be grouped on. This is very powerful feature.Reduces a lot of our coding effort.Now what is relevant for this subject is the bSetUp parameterWe can call oBrw:( ctitle, , , { |oRep,oBrw| MyReportSetup( oRep, oBrw ) } )our function:func MyReportSetUp( oRep, oBrw )Here we have the report object that is created by the browse and the browse object. This function is called after creation of the browse object and before creation of the columns. We can do any elaborate settings of the Report object here. oRep:aFont already has two fonts built by the browse object oRep:aFont[ 1 ] is Tahoma size 0,-8 oRep:aFont[ 2 ] is Tahoma size 0,-8 bold we can substitute our own fonts or add fonts We can or reset any properties of the report object. Define our own columns if we want to. Finally return control to the browse to continue printing.return .t. if we do not want xBrowse to creat the columns.return <.f. or nil> if we want xbrowse to create the columns After xbrowse introduced this method, I practically stopped writing separate report modules.
oBrw:report() how can you control fonts etc. in the print.
I have used the bSetUp parameter to great advantage. All my reports linked to browses now use oBrw:Report( ... ) method with my own settings made through bSetUp parameter.I have a suggestion to Mr Antonio. While using this feature I found the need to call the bSetUp block twice at two stages. Now this is called before creation of the columns. Many times I need to modify some of the columns that are created. I have made modification in my variation of xbrowse, to call this method twice. Once before creating the columns and second time before activating the report. I have added a third parameter to indicate if it is the first or second call. With this I have the total control and I am able to do anything that I can do by writing a separate report module.
oBrw:report() how can you control fonts etc. in the print.
Harvey,>And it prints 6 extra pages. Won't stop at the last recored to print. I suspect this is a problem with you browse definition--I am not seeing that problem here. Try creating a very simple browse and see if it works OK for you.James
oBrw:report() how can you control fonts etc. in the print.
Rao and James having a problem with the info sent. See code:In mYreportSetUp() get compile error..."incorrect statement or unbalanced delimiters".If i change it to: Define font oRep:aFont[1] name "arial" size 3.75,7it prints so small can't be read and even though font is so small it still doesnt print all the columns of the browse.What am I doing wrong? [code:25jfvqps] if msgYesNo&#40;"oReport?"&#41; oBrw&#58;report&#40; "Guess who", , , &#123; |oRep,oBrw| MyReportSetup&#40; oRep, oBrw,msize &#41; &#125; &#41; return nil endif func MyReportSetUp&#40;oRep,oBrw&#41; oRep&#58;aFont&#91;1&#93; return nil [/code:25jfvqps]
oBrw:report() how can you control fonts etc. in the print.
>In mYreportSetUp() get compile error..."incorrect statement or unbalanced delimiters".>Please see this line:[code:15vpccu9] oRep&#58;aFont&#91;1&#93; [/code:15vpccu9]This obviously gives a syntax error. First please resolve syntax errors at your end.>If i change it to: Define font oRep:aFont[1] name "arial" size 3.75,7 it prints so small can't be read and even though font is so small it still doesnt print all the columns of the browse.>Naturally.You should print what it fits on the paper. You can also configure the columns of report object to print one value under another value so that in one print column you can print information relating to two or more fields in the database. Please review samples on report how to do this. Then in you setup function you can configure the columns accordingly
oBrw:report() how can you control fonts etc. in the print.
Here is a quick sample for using bSetUp codeblock. This sample uses the customer.dbf in the \fwh\samples folder.Please compile and run this program in the samples directory. Then please go through the code, samples on making reports in the samples folder and then suitably adopt to your needs.[code:2w6x41gy] #include 'fivewin&#46;ch' #include 'xbrowse&#46;ch' #include 'report&#46;ch' REQUEST DBFCDX function Main&#40;&#41; local oWnd, oBrw, oBar, oPrnFont USE CUSTOMER NEW ALIAS CUST SHARED VIA 'DBFCDX' DEFINE WINDOW oWnd @ 0,0 XBROWSE oBrw OF oWnd oBrw&#58;CreateFromCode&#40;&#41; oWnd&#58;oClient &#58;= oBrw DEFINE BUTTONBAR oBar OF oWnd SIZE 80,32 2007 DEFINE BUTTON OF oBar PROMPT 'Print' ; ACTION oBrw&#58;Report&#40; 'TestReport', , , ; &#123; |oRep, oBrw, oFont| MySetUp&#40; oRep, oBrw, @oPrnFont &#41; &#125; &#41; ACTIVATE WINDOW oWnd RELEASE FONT oPrnFont return nil static function MySetUp&#40; oRep, oBrw, oFont &#41; DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oRep&#58;oDevice oRep&#58;aFont&#91; 1 &#93; &#58;= oFont COLUMN DATA CUST->First,CUST->Last,'' ; TITLE 'Name','','' SIZE 20 COLUMN DATA CUST->STREET,CUST->ZIP ; TITLE 'Address','' SIZE 30 COLUMN DATA CUST->City,CUST->State,'' ; TITLE 'City','State','' SIZE 20 COLUMN DATA CUST->HIREDATE, ; If&#40; CUST->Married, 'Married','Single' &#41; ; TITLE 'HireDate','Status' ; SIZE 10 COLUMN DATA CUST->Salary, CUST->Age ; PICTURE '999,999,999' ; TOTAL ; TITLE 'Salary','Age' return &#46;t&#46; [/code:2w6x41gy]
oBrw:report() how can you control fonts etc. in the print.
Harvey,>DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oRep:oDevice > oRep:aFont[ 1 ] := oFont Note how he uses the OF clause. If you don't do this you will get very tiny font sizes. The font needs to be built using the resolution of the print device (the printer in this case).Also, to specify font sizes in points, use 0,-9 where the negative number is the size in points. The first number is always zero.James
oBrw:report() how can you control fonts etc. in the print.
Rao & James.After all of your help its working just great. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Only thing now is to stop it from printing 6 extra pages. <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> Thanks to you both for your help. Harvey
oBrw:report() how can you control fonts etc. in the print.
NageswaraRao,>DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oRep:oDevice > oRep:aFont[ 1 ] := oFont In this case, I think that you need to end the existing font before assigning a new one, or there will be a resource leak. So, it should be:oFont:end()DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oRep:oDevice oRep:aFont[ 1 ] := oFont Regards,James
oBrw:report() how can you control fonts etc. in the print.
Mr James.I agree with you. But please consider this.Should it be oRep:aFont[ 1 ]:End()DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oRep:oDeviceoRep:aFont[ 1 ] := oFont?Then we do not have to release this new font again in our program, because Report object releases all font objects in the DATA aFonts array. Then in my sample above, passing the new font by reference to the main program and releasing the font in the main program is not necessary.Now I have looked at Report method in xbrowse.prg. The method creates two fonts, oFont and oBold, but at the end releases only one oFont. Fix is needed to release oBold also.Do you think I am right ?
oBrw:report() how can you control fonts etc. in the print.
NageswaraRao,>Should it be >oRep:aFont[ 1 ]:End() >DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oRep:oDevice >oRep:aFont[ 1 ] := oFont Since oRep:aFont[ 1 ] is just a pointer to oFont then either way will do the same thing.>Now I have looked at Report method in xbrowse.prg. The method>creates two fonts, oFont and oBold, but at the end releases only one >oFont. Fix is needed to release oBold also. >Do you think I am right ?As you have pointed out, TReport is already releasing both the fonts, so I think that the xbrowse:report method does not need to. Even though it is doing oFont:end(), the font has already been released by TReport. This may even have a negative effect by reducing the font could by one more than it should be.Comments, Antonio?Regards,James
oBrw:report() how can you control fonts etc. in the print.
Mr JamesThe contents of oRep:aFont are not just pointers to the font objects provided by us. Report object creates new font objects afresh, with the identical specs for the "device" and stores them in ::aFont array. So these fonts are different objects. Report object releases only the fonts created by it. So the font objects we provided are to be released by us in the calling program later. You may please go through the New method of report.prg.You may now look at my statement in the light of the above.
oBrw:report() how can you control fonts etc. in the print.
NageswaraRao,>The contents of oRep:aFont are not just pointers to the font objects provided by us.OK, I see what you mean. In that case I think we need to end both font objects.oFont:end()oRep:aFont[ 1 ]:End() DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oRep:oDevice oRep:aFont[ 1 ] := oFont And, as you stated before, the we need to add oBold:end() to the end of the txbrowse:Report method.Regards,James
oBrw:report() how can you control fonts etc. in the print.
>oFont:end() ?where from are you getting thsi oFont?
oBrw:report() how can you control fonts etc. in the print.
NageswaraRao,Well, I admit I was a bit confused by your code:[code:10qjh911] DEFINE BUTTON OF oBar PROMPT 'Print' ; ACTION oBrw&#58;Report&#40; 'TestReport', , , ; &#123; |oRep, oBrw, oFont| MySetUp&#40; oRep, oBrw, @oPrnFont &#41; &#125; &#41;[/code:10qjh911] You specified oFont as the third parameter to be passed to the codeblock, but txbrowse only passes oRep and self (oBrw), so you can't pass oFont.I thought that you were passing the oFont from the Report method and then defining it again. This would have increased the font object counter by one more, and oFont:end() would have only been called once.Since I was mistaken, you don't need to call oFont:end(), but your code should read: { |oRep, oBrw| MySetUp( oRep, oBrw, @oPrnFont ) } )You code as is, works, but the oFont parameter is not of any value and is confusing. Regards,James
oBrw:report() how can you control fonts etc. in the print.
Yes. You are right. Thanks
oBrw:report() prints too much
Using oBrw:report() to print a browse. The print seems to print the entire data base and not stoping where the filter says to stop. It prints 5 extra page headers with no data below the header. The data is filtered out so there shoud be no data but it is printing 5 extra pages all with a header.How do I shut it off at the end of the browse and prevent the extra pages?All ideas appreciated.
oBrw:report() prints too much
Harvey,The problem seems to be that the xbrowse:Report() method is doing this: oRep:bWhile := { || oRep:nCounter < nRows }Where nRows = ordKeyCount(), and this won't work with a filter.I think you are going to have to use the report setup method (that was discussed in another message thread) to change the oRpt:bWhile codeblock. Try using:oRpt:bWhile := {|| ! eof() }Regards,James
oBrw:report() prints too much
James:Couple of questionsYou said> oRpt:bWhile := {|| ! eof() } Are you suggesting modify the xbrowse class?How does the !eof() get the print to stop at end of filter and not print extra pages?[code:2u5p41ez]I think you are going to have to use the report setup method &#40;that was discussed in another message thread&#41; to change the oRpt&#58;bWhile codeblock&#46; Try using&#58; [/code:2u5p41ez]I can't find the thread. Could you send me a link.BTW are you and I the only people on this site from Calif?
oBrw:report() prints too much
Harvey,>Couple of questions >You said >> oRpt:bWhile := {|| ! eof() } >Are you suggesting modify the xbrowse class?No.>How does the !eof() get the print to stop at end of filter and not print extra pages?Because eof() respects filters and ordKeyCount() apparently doesn't. >I think you are going to have to use the report setup method (that was discussed in another message thread) to change the oRpt:bWhile codeblock. Try using: >I can't find the thread. Could you send me a link. Try something like this: DEFINE BUTTON OF oBar PROMPT 'Print' ; ACTION oBrw:Report( 'TestReport', , , ; { |oRep| oRpt:bWhile := {|| ! eof() } } ) >BTW are you and I the only people on this site from Calif?Tim Stone is also up there in the LA area somewhere--I forget exactly. There are only the three of us in CA that I know.Regards,James
oBrw:report() prints too much
Thanks... Be testing when I get home later today.
oBrw:report() prints too much
Its a problem and the above suggestion also does not help for two reasons.1. Report method sets oRep:bWhile after evaluating user codeblock 2. Even if we modify xbrowse source, xbrowse navigation never retults in eof(). ( This report will never stop !!!! )This needs a different kind of fix ( I dont know yet ) in the xbrowse program
oBrw:report() prints too much
My view:XBrowse Report method needs a fix.While the present oRep:bSkip and oRep:bWhile blocks may be retained for non - dbf datasources, if the ::calias is not empty, oRep:bSkip should be { |n| (::cAlias)->( DbSkip( n ) ) } and oRep:bWhile should be { || ! ( ::cAlias)->( Eof () ) }I did not experience this because mostly i use record sets and ADS for DBFs with my own modified RDDADS and my AdsKeyCount respects filters. Thanks for bringing out this issue. Hope Mr Antonion will advise a better fix.Another issue is what is a better way to ascertain the total visible records in DBF when filters are set ?
oBrw:report() prints too much
[quote="James Bott":2wmcmz28]Because eof() respects filters and ordKeyCount() apparently doesn't.[/quote:2wmcmz28]Yes. OrdKeyCount() just count the record in the controlling index.EMG
oBrw:report() prints too much
Harvey,>Report method sets oRep:bWhile after evaluating user codeblock NageswaraRao, has a good point. You cannot use the bWhile that I suggested.I suggest trying his idea about changing the bSkip and bWhile in the TXBrowe:Report method to test if that works for you. If so, perhaps we can get Antonio to make those changes to the FWH source. Put this right before the oRep:Activate() in the TXBrowse:Report() method.[code:1ki04fp3]if ! empty&#40;&#58;&#58;cAlias&#41; oRep&#58;bSkip &#58;= &#123; |n| &#40;&#58;&#58;cAlias&#41;->&#40; DbSkip&#40; n &#41; &#41; &#125; oRep&#58;bWhile &#58;= &#123; || ! &#40; &#58;&#58;cAlias&#41;->&#40; Eof &#40;&#41; &#41; &#125; endif[/code:1ki04fp3]Another option is not to use filters; can you use scopes instead? Scopes might work with xbrowse as it is now.Or, you can just write your own report using TReport instead of using the xBrowse:Report() method.Regards,James
oBrw:report() prints too much
>Another option is not to use filters; can you use scopes instead? Scopes might work with xbrowse as it is now. >Or, you can just write your own report using TReport instead of using the xBrowse:Report() method. >I suggest we better do this temporary fix to xbrowse now and Mr Antonio would do this or a better fix in the next release. When we have xbrowse, no point losing our independence or make our own reports.Again, can any one reflect on my question: How to find the number of visible records after setting a filter in DBFCDX and DBFNTX ?
oBrw:report() prints too much
NageswaraRao,>Again, can any one reflect on my question: How to find the number of visible records after setting a filter in DBFCDX and DBFNTX ?I think you would have to count them by skipping through the database. If you use the eof() you don't have to deal with this.James
oBrw:report() prints too much
AdsGetKeyCount() and AdsGetRecordCount() provide flags ADS_RESPECTFILTERS, ADS_RESPECTSCOPES, etc. Wish DBFCDX also provides similar functionality. When the filters are fully optimized it is just a matter of reading from the filter bitmaps. It would be nice if (x)Harbour development teams provide similar functionality. Till Clipper 5.2 I was using rl_* functions of Comix for this and after that I moved over to ADS ( client-server )ADS local server has same functonality as DBFCDX and appears to be more useful than DBFCDX, and I wonder for what reasons we should prefer DBFCDX over ADS local server ( which is free ).I dont know if other drivers of harbour like SIX, etc provide similar functionality
oBrw:report() prints too much
James, Rao:[code:rjx9wgtx] if ! empty&#40;&#58;&#58;cAlias&#41; oRep&#58;bSkip &#58;= &#123; |n| &#40;&#58;&#58;cAlias&#41;->&#40; DbSkip&#40; n &#41; &#41; &#125; oRep&#58;bWhile &#58;= &#123; || ! &#40; &#58;&#58;cAlias&#41;->&#40; Eof &#40;&#41; &#41; &#125; endif [/code:rjx9wgtx]Where do I put this in the report.prg or xbrowse.prg and where?I'm lostHarvey
oBrw:report() prints too much
In the method Report( ... )After the line : oRep:bEnd := ::bGoTopand before the line oRep:Activate()
oBrw:report() prints too much
Thanks for the help but not working [code:3kfqnupl] oRep&#58;bEnd &#58;= &#58;&#58;bGoTop if !empty&#40;&#58;&#58;cAlias&#41; oRep&#58;bSkip &#58;= &#123; |n| &#40;&#58;&#58;cAlias&#41;->&#40; DbSkip&#40; n &#41; &#41; &#125; oRep&#58;bWhile &#58;= &#123; || ! &#40; &#58;&#58;cAlias&#41;->&#40; Eof &#40;&#41; &#41; &#125; endif oRep&#58;Activate&#40;&#41; [/code:3kfqnupl]Not working...Any other thoughts?
oBrw:report() prints too much
not working means whats happening ?
oBrw:report() prints too much
Harvey,>Not working... Can you give us more information? What is it doing or not doing?James
oBrw:report() prints too much
Adding the new code james posted is not working. I added it to xbrowse i'm still getting a 7 page print. There is only 2 pages of data. The other pages should be filtered out. The data does not appear on the extra pages only the headers. The record count is governing the number of pages to print when it should be the filter as we all concluded. hope you can follow what I said. thanks.Need more suggestions...
oBrw:report() prints too much
Are you seeing the blank lines when you are seeing the browse on the screen ? When you go bottom of the browse?
oBrw:report() prints too much
Rao:No lines just blank pages with the proper header.