topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
xBrowse: Avoid long numbers converted to scientific notation | Hi,
I have a col with long numbers, e.g. 119200075708
After exporting to excel from xbrowser, it ends up as 1.192E+11
How to prevent that from happening?
[img:3kriwdo8]https://i.postimg.cc/FKwqJRjw/xbrowse.png[/img:3kriwdo8]
TIA
p.s. I just noticed all the numbers in "Inv Num." column are converted to 1.192E+11 |
xBrowse: Avoid long numbers converted to scientific notation | Is this a browse from Array or DBF?
For now, please do this.
Have a function like this
[code=fw:31yeqrn8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> myexcel<span style="color: #000000;">(</span> oBrw <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oSheet<br /> oSheet := oBrw:<span style="color: #000000;">ToExcel</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSheet:<span style="color: #000000;">Columns</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">NumberFormat</span> := <span style="color: #ff0000;">"#########"</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:31yeqrn8]
Instead of calling oBrw:ToExcel(), please call myexcel( oBrw ) |
xBrowse: Avoid long numbers converted to scientific notation | [quote="nageswaragunupudi":2z3nw1gk]Is this a browse from Array or DBF?[/quote:2z3nw1gk]
From an array which gets its contents from a csv file
[quote:2z3nw1gk]
For now, please do this.
Have a function like this
[code=fw:2z3nw1gk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> myexcel<span style="color: #000000;">(</span> oBrw <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oSheet<br /> oSheet := oBrw:<span style="color: #000000;">ToExcel</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSheet:<span style="color: #000000;">Columns</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">NumberFormat</span> := <span style="color: #ff0000;">"#########"</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2z3nw1gk]
Instead of calling oBrw:ToExcel(), please call myexcel( oBrw )[/quote:2z3nw1gk]
It works!
Thanks Rao! |
xBrowse: Change :cFilterFld when user click on header | Hi,
My xbrowse has autosort. How can I automatically change :cFilterFld based on which col header user clicks?
TIA |
xBrowse: Colores diferentes para fila y celda seleccionadas | ¿Es posible que la celda seleccionada tenga colores diferentes a los de la fila seleccionada? ¿Cómo?Gracias por adelantado. |
xBrowse: Colores diferentes para fila y celda seleccionadas | Hola Cesar, es importante que nos menciones que Browse utilizas, si es el twbrowse, es facil, pero si me gustaria que nos platicaras..Saludos |
xBrowse: Colores diferentes para fila y celda seleccionadas | Hola, Luis.En el asunto lo puse: xbrowse.Gracias |
xBrowse: Colores diferentes para fila y celda seleccionadas | César,En FWH\samples\testXbrw3.prg tienes un ejemplo:[code:3i3hr9zc]
@ 0,0 XBROWSE oBrw ;
COLUMNS "State", "City", "First", "Married", "HireDate", "Age", "Salary", "Last" ;
JUSTIFY .f., AL_CENTER, .t. ;
OF ownd ;
ALIAS cAlias AUTOSORT FASTEDIT FOOTERS LINES CELL
oBrw:bClrRowFocus := { || { CLR_BLACK, RGB(185,220,255) } }
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
[/code:3i3hr9zc][url=http://imageshack.us:3i3hr9zc][img:3i3hr9zc]http://img217.imageshack.us/img217/764/brwkj0.jpg[/img:3i3hr9zc][/url:3i3hr9zc] |
xBrowse: HEADERLBUTTONUP | Gracias Francisco por tu respuesta a mi pregunta anterior, funcionó.
Me ha surgido otro problema con el xBrowse, al presionar el título de una columna ejecuto una función, pero aleatoriamente me tira este error..
soy yo o la clase ?
Puede que los números de lineas no corresponda a la de la clase original.. agregamos unas datas nada importantes..
Gracias
Sdos
fwhx 13.07
c++ 5.8.2. ( 32 bit )
Application
===========
Path and name: C:\PSPUESTO\UNIRE.exe (32 bits)
Size: 8,614,400 bytes
Error occurred at: 10/12/15, 18:56:05
Error description: Error BASE/1004 Class: 'NIL' has no exported method: HEADERLBUTTONUP
Args:
[ 1] = U
[ 2] = N 13
[ 3] = N 401
[ 4] = N 0
Stack Calls
===========
Called from HEADERLBUTTONUP(0)
Called from TXBROWSE:LBUTTONUP(3506)
Called from TCONTROL:HANDLEEVENT(1719)
Called from TXBROWSE:HANDLEEVENT(12172)
Called from _FWH(3183)
Called from DIALOGBOX(0)
Called from TDIALOG:ACTIVATE(274)
Called from BRWINFGRAL(102)
Called from (b)MENUTRIBUNAL(22)
Called from TMENU:COMMAND(463)
Called from TWINDOW:COMMAND(1043)
Called from TWINDOW:HANDLEEVENT(0)
Called from _FWH(3183)
Called from WINRUN(0)
Called from TWINDOW:ACTIVATE(996)
Called from MENUGRL(301)
Called from MAIN2(187) |
xBrowse: HEADERLBUTTONUP | You might have assigned a codeblock action to header button click.
In that case you need include the following lines at the end of the action
----------
[code=fw:3d2i7cqa]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nCaptured</span> > <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">obrw</span>:<span style="color: #000000;">ncaptured</span> := <span style="color: #000000;">0</span><br /> ReleaseCapture<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oCapCol</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:3d2i7cqa] |
xBrowse: HEADERLBUTTONUP | gracias y saludos
Silvina |
xBrowse: HEADERLBUTTONUP | Gracias Francisco por tu respuesta a mi pregunta anterior, funcionó.
Me ha surgido otro problema con el xBrowse, al presionar el título de una columna ejecuto una función, pero aleatoriamente me tira este error..
soy yo o la clase ?
Puede que los números de lineas no corresponda a la de la clase original.. agregamos unas datas nada importantes..
Gracias
Sdos
fwhx 13.07
c++ 5.8.2. ( 32 bit )
Application
===========
Path and name: C:\PSPUESTO\UNIRE.exe (32 bits)
Size: 8,614,400 bytes
Error occurred at: 10/12/15, 18:56:05
Error description: Error BASE/1004 Class: 'NIL' has no exported method: HEADERLBUTTONUP
Args:
[ 1] = U
[ 2] = N 13
[ 3] = N 401
[ 4] = N 0
Stack Calls
===========
Called from HEADERLBUTTONUP(0)
Called from TXBROWSE:LBUTTONUP(3506)
Called from TCONTROL:HANDLEEVENT(1719)
Called from TXBROWSE:HANDLEEVENT(12172)
Called from _FWH(3183)
Called from DIALOGBOX(0)
Called from TDIALOG:ACTIVATE(274)
Called from BRWINFGRAL(102)
Called from (b)MENUTRIBUNAL(22)
Called from TMENU:COMMAND(463)
Called from TWINDOW:COMMAND(1043)
Called from TWINDOW:HANDLEEVENT(0)
Called from _FWH(3183)
Called from WINRUN(0)
Called from TWINDOW:ACTIVATE(996)
Called from MENUGRL(301)
Called from MAIN2(187)
silvinamazzaro
Mensajes: 10
Registrado: Mar Nov 19, 2013 2:13 pm |
xBrowse: How to detect when value in a SetCheck col changed? | Hi all,
How to detect when a value in a SetCheck col is changed or toggled? I tried with oBrw:bChange and oCol:bEditValid with no success.
Marquee style is set to MARQSTYLE_DOTEDCELL and am browsing an array.
I'm using FWH11.8.
TIA |
xBrowse: How to detect when value in a SetCheck col changed? | oCol:bOnChange := { |oCol, uOldVal| MyFuncOnChange( oCol, uOldVal ) } |
xBrowse: How to detect when value in a SetCheck col changed? | Thanks Rao!
When user checked a row, I want to display a message at the top using a say control. That can now be accomplished using bOnChange.
However once user click somewhere else, in other words the col lost focus, I want to erase that message. Is there such a bLostFocus data?
TIA |
xBrowse: How to detect when value in a SetCheck col changed? | You can use oBrw:bChange.
You must be alrady aware that oBrw:bChange is evaluated when row is changed.
If we set oBrw:lColChangeNotify := .t., then oBrw:bChange is called even when column is changed.
oBrw:lColChangeNotify := .t.
oBrw:bChange := { |oBrw, lRowChange| MyChangeFunc( oBrw, lRowChange ) }
In the MyChangeFunc(....) check the oBrw:SelectedCol() to know which column is selected. |
xBrowse: How to detect when value in a SetCheck col changed? | Thank you so much Rao! |
xBrowse: How to display image from resource based on flag | Hi,
Can someone share a code snippet to view image from resource in a column based on a flag in the dbf currently being viewed?
TIA |
xBrowse: How to display image from resource based on flag | This sample demonstrates 3 alternative ways of doing it.
[code=fw:20wwnzif]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> USE CUSTOMER <span style="color: #00C800;">NEW</span> SHARED <span style="color: #0000ff;">ALIAS</span> CUST VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br /> Sample1<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Sample2<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Sample3<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Sample1<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE <span style="color: #ff0000;">"CUST"</span> ;<br /> COLUMNS <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"CITY"</span>, <span style="color: #ff0000;">"MARRIED"</span> ;<br /> CELL LINES NOBORDER<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">married</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"TWO"</span>, <span style="color: #ff0000;">"ONE"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Sample2<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE <span style="color: #ff0000;">"CUST"</span> ;<br /> COLUMNS <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"CITY"</span>, <span style="color: #ff0000;">""</span> ;<br /> HEADERS <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"MARRIED"</span> ;<br /> CELL LINES NOBORDER<br /><br /> WITH OBJECT oBrw<br /> WITH OBJECT :<span style="color: #000000;">married</span><br /> :<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"ONE"</span>, <span style="color: #ff0000;">"TWO"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">bBmpData</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->MARRIED, <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> END<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Sample3<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE <span style="color: #ff0000;">"CUST"</span> ;<br /> COLUMNS <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"CITY"</span>, <span style="color: #ff0000;">"IF(MARRIED,'TWO','ONE')"</span> ;<br /> HEADERS <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"MARRIED"</span> ;<br /> CELL LINES NOBORDER<br /><br /> WITH OBJECT oBrw<br /> WITH OBJECT :<span style="color: #000000;">married</span><br /> :<span style="color: #000000;">cDataType</span> := <span style="color: #ff0000;">"P"</span><br /> :<span style="color: #000000;">lBmpTransparent</span> := .t.<br /> END<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:20wwnzif]
RC file:
[code=fw:20wwnzif]<div class="fw" id="{CB}" style="font-family: monospace;">ONE <span style="color: #000000;">10</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\u</span>ser.bmp"</span><br />TWO BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\u</span>sers.bmp"</span><br /> </div>[/code:20wwnzif]
In all the 3 cases, the result is :
[url=https://imageshack.com/i/pnnnZPATp:20wwnzif][img:20wwnzif]https://imagizer.imageshack.com/v2/xq90/923/nnZPAT.png[/img:20wwnzif][/url:20wwnzif] |
xBrowse: How to display image from resource based on flag | Thank you very much for the extensive example Rao! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
xBrowse: How to display image from resource based on flag | Rao, excelente, podría decirme como hacer esto con archivo bmp en lugar del RC.
Saludos
Jorge |
xBrowse: How to display image from resource based on flag | [quote="jpcavagnaro":25kh34ix]Rao, excelente, podría decirme como hacer esto con archivo bmp en lugar del RC.
Saludos
Jorge[/quote:25kh34ix]
Substitute resource names with bitmap file names with full path. |
xBrowse: How to display two columns from diferent databases? | Hello,
I need some help with xBrowse and displaying two or more columns from different databases.
Does anyone have simple example or know location in \fwh directory. I saw Mr. James and
Anser posts but I didn't understand how they solved this problem.
regards
Boris |
xBrowse: How to display two columns from diferent databases? | If you are asking about fields from two tables related to each other, here is an example. You can run this in \fwh\samples folder. This example uses two tables from that folder.
[code=fw:1lunxoga]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br />REQUEST DBFCDX<br /><br />FIELD STATE, CODE<br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oBrw<br /><br /> RDDSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">'DBFCDX'</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> File<span style="color: #000000;">(</span> <span style="color: #ff0000;">'states.cdx'</span> <span style="color: #000000;">)</span><br /> FErase<span style="color: #000000;">(</span> <span style="color: #ff0000;">'states.cdx'</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> USE STATES <span style="color: #00C800;">NEW</span> EXCLUSIVE<br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> CODE TAG CODE<br /> SET ORDER <span style="color: #0000ff;">TO</span> TAG CODE<br /><br /> USE CUSTOMER <span style="color: #00C800;">NEW</span><br /> SET RELATION <span style="color: #0000ff;">TO</span> STATE INTO STATES<br /> GO TOP<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd ;<br /> COLUMNS <span style="color: #ff0000;">'First'</span>, <span style="color: #ff0000;">'City'</span>, <span style="color: #ff0000;">'State'</span> ;<br /> FIELDS STATES->NAME ;<br /> HEADERS ,,,<span style="color: #ff0000;">'StateName'</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CUSTOMER'</span> ;<br /> CELL LINES<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /> CLOSE <span style="color: #00C800;">DATA</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------//</span><br /><br /> </div>[/code:1lunxoga]
I have tested this code and it works. This is how it looks.
[url=http://img11.imageshack.us/i/xbrwsample.jpg/:1lunxoga][img:1lunxoga]http://img11.imageshack.us/img11/4818/xbrwsample.jpg[/img:1lunxoga][/url:1lunxoga]
First three columns are from customer.dbf and the last column is from states.dbf |
xBrowse: How to display two columns from diferent databases? | Thank's a lot, your example works great!
Boris |
xBrowse: How to get the column's line drawn until the bottom | [url=https://postimg.org/image/mkm2bqgl1/:3emae1lq][img:3emae1lq]https://s2.postimg.org/sljr8t37d/image.jpg[/img:3emae1lq][/url:3emae1lq][url=https://postimage.org/:3emae1lq]upload pictures online[/url:3emae1lq]
Currently using marquee [i:3emae1lq]MARQSTYLE_HIGHLROW[/i:3emae1lq] |
xBrowse: How to get the column's line drawn until the bottom | [code=fw:14scxt9o]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">lColDividerComplete</span> := .T.</div>[/code:14scxt9o] |
xBrowse: How to get the column's line drawn until the bottom | Thanks Anserk! |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | Hi,
in my program the key VK_F2 has a general function. Generally it works perfectly. But since the upgrade to fwh1005 I get a message "oCol:bOnPostEdit not defined" when a x-browse window is opened an I press the F2-key.
I made following efforts to handle this change of behaviour:
- I found in the TxBrwColumn-class a data lOnPostEdit which doesn't seem to have any effect on this.
- Also I found the method nEditType which I called with oCol:nEditType(0) which doesn't show any effect as well
- Also I found in the xbrowse-class a data lEditMode. If I manually override it to lEditMode := .t., then the message won't be shown again. But the Key F2 is still not being evaluated... Besides, I think this information should not be changed manually.
Has anyone an idea how pressing F2 will evaluate the standard set for the whole program without xbrowse having any effect on it? |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | Gilbert
Since fwh 10.5 Xbrowse is behaving like excel and therefore f2 is assigned to edit a cell
I had the same surprise as my app uses also F2
As a work around, you needd to change the xbrowse.prg
search for keydown method and comment the relevant f2 code
Hth
Richard |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | Richard,
thanks a lot for your answer. I did it like you said and it works.
Antonio,
have you planned to introduce something like a switch, so you can switch on/off excel-like behaviour?
Because in our application F2, SHIFT+F2 and CTRL+F2 are being used for other purposes. |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | Gilbert, Richard,
We could add a new
DATA nEditKey INIT VK_F2
so from your app you could easily set a oBrowse:nEditKey = nAnotherValue
does it seem fine for you ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | I prefer F2 to be disabled by default. Actually I'd prefer any new feature introduced to be off by default to avoid being caught by surprise. It's a lot of work having to recheck all the modules to insert a new line just to be sure whatever was working will still continue to do so every time some new feature is added. |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | Hua,
Yes, you are right and thats the way it should be. It was our mistake to implement that functionality without asking about it in advance. Our apologizes about it.
This is why we want to fix it now and make it fully configurable, optional, etc. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | Thank you <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | Antonio,
thank you very much, your proposal should work fine for me.
Please let us know as soon as you have completed this feature <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
xBrowse: Message ""oCol:bOnPostEdit not defined"" | Gilbert,
We have already implemented it and we will include it in next FWH 10.6 this same month <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
xBrowse: Pintado de lineas (filas) | Hola,
Es posible hacer que el control xBrowser, para un numero de filas que no ocupen toda el area del control, se complete con colores alternos en las filas?
Lo que necesito hacer es algo como se ve en este browser que para una tabla, con solo un record, se complete toda el area del control con colores alternos en las filas:
[img:2dwtm8lx]http://i59.tinypic.com/687eip.jpg[/img:2dwtm8lx]
Saludos,
George |
xBrowse: Pintado de lineas (filas) | Si mal no recuerdo, el xbrowse va mostrando las filas que llevan algun contenido, si hay alguna forma de que se pinte hasta el final creo deberia ser con registros en blanco, pero no tendria sentido, creo alguien solicito una vez algo como lo que quieres, que se pinte todo el xbrowse como si existieran los registros, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
xBrowse: Pintado de lineas (filas) | Prueba asi:
oLbx:bClrStd :={|| IF((cMa_Ctes)->(OrdKeyNo())%2==0,CLR_NADA,CLR_LCELES)} |
xBrowse: Pintado de lineas (filas) | George
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=26334">viewtopic.php?f=3&t=26334</a><!-- l --> |
xBrowse: Pintado de lineas (filas) | Gracias por su ayuda.
Saludos,
George |
xBrowse: Process filtered rows only | Hi Rao,
I have a 'Select All' checkbox. Right now it has this code attach to it
[code=fw:2p7nguhr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oCbxAll:<span style="color: #000000;">bChange</span> := <||<br /> aeval<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">{</span>|h_| h_<span style="color: #000000;">[</span><span style="color: #ff0000;">"select"</span><span style="color: #000000;">]</span> := lAll<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ><br /> </div>[/code:2p7nguhr]
But it has been pointed out to me this logic is not accurate if someone did filtering prior to checking it as it will traverse the whole array, not just filtered ones
[img:2p7nguhr]https://i.postimg.cc/0NbPYxNW/emailer.jpg[/img:2p7nguhr]
As shown in the screen above which is displaying an array of hashes, when user clicks 'Select All' it is expected only the two visible rows should have the select flag toggled.
How should I code oCbxAll:bChange so it updates only filtered rows?
TIA |
xBrowse: Process filtered rows only | I got an idea to do it this way. But seems to be caught in an infinite loop
[code=fw:28zx0b75]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">checkbox</span> oCbxAll <span style="color: #0000ff;">var</span> lAll <span style="color: #0000ff;">id</span> <span style="color: #000000;">109</span> <span style="color: #0000ff;">of</span> oDlg<br /> oCbxAll:<span style="color: #000000;">bChange</span> := <||<br /> <span style="color: #00C800;">local</span> hState := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /> hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"BookMark "</span><span style="color: #000000;">]</span> := oBrw:<span style="color: #000000;">BookMark</span><br /> hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"nRowSel "</span><span style="color: #000000;">]</span> := oBrw:<span style="color: #000000;">nRowSel</span><br /> hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"nColSel "</span><span style="color: #000000;">]</span> := oBrw:<span style="color: #000000;">nColSel</span><br /> hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"nColOffset"</span><span style="color: #000000;">]</span> := oBrw:<span style="color: #000000;">nColOffset</span><br /> oBrw:<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !oBrw:<span style="color: #000000;">eof</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> h_ := oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> h_<span style="color: #000000;">[</span><span style="color: #ff0000;">"select"</span><span style="color: #000000;">]</span> := lAll<br /> oBrw:<span style="color: #000000;">goDown</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">enddo</span><br /> oBrw:<span style="color: #000000;">BookMark</span> := hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"BookMark "</span><span style="color: #000000;">]</span><br /> oBrw:<span style="color: #000000;">nRowSel</span> := hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"nRowSel "</span><span style="color: #000000;">]</span><br /> oBrw:<span style="color: #000000;">nColSel</span> := hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"nColSel "</span><span style="color: #000000;">]</span><br /> oBrw:<span style="color: #000000;">nColOffset</span> := hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"nColOffset"</span><span style="color: #000000;">]</span><br /> oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ></div>[/code:28zx0b75] |
xBrowse: Process filtered rows only | Ok. This version seems to work
[code=fw:28ff1q9x]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oCbxAll:<span style="color: #000000;">bChange</span> := <||<br /> <span style="color: #00C800;">local</span> hState := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /> hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"BookMark "</span><span style="color: #000000;">]</span> := oBrw:<span style="color: #000000;">BookMark</span><br /> oBrw:<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> REPEAT<br /> h_ := oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> h_<span style="color: #000000;">[</span><span style="color: #ff0000;">"select"</span><span style="color: #000000;">]</span> := lAll<br /> UNTIL oBrw:<span style="color: #000000;">Skip</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">1</span><br /><br /> oBrw:<span style="color: #000000;">BookMark</span> := hState<span style="color: #000000;">[</span><span style="color: #ff0000;">"BookMark "</span><span style="color: #000000;">]</span><br /> oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ></div>[/code:28ff1q9x] |
xBrowse: RTE when editing a numeric cell | The error doesn't appear when I try to reproduce it in a reduced-sample. It appear in my app after linking in FWH11.06+Harbour+MSVC 2010 Express though.
When I press Enter on a numeric cell to edit it I get this. Any help is appreciated as I've actually put this particular app in distribution to customers.
[code=fw:2lpi9ufx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1099</span> Argument error: <span style="color: #000000;">STR</span><br /> Args:<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">1</span><span style="color: #000000;">]</span> = U <br /><br />Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: => STR<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: ../../../tget.prg => TCLIPGET:_PICTURE<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TGET.PRG => TGET:<span style="color: #000000;">LOSTFOCUS</span><span style="color: #000000;">(</span><span style="color: #000000;">1234</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TGET:<span style="color: #000000;">KILLFOCUS</span><span style="color: #000000;">(</span><span style="color: #000000;">1025</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">1627</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TGET.PRG => TGET:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">597</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span><span style="color: #000000;">3443</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => DIALOGBOXINDIRECT<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span><span style="color: #000000;">277</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">errsysw</span>.prg => ERRORDIALOG<span style="color: #000000;">(</span><span style="color: #000000;">376</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">errsysw</span>.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>ERRORSYS<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => STR<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: ../../../tget.prg => TCLIPGET:_PICTURE<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TGET.PRG => TGET:<span style="color: #000000;">GOTFOCUS</span><span style="color: #000000;">(</span><span style="color: #000000;">1489</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">1670</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TGET.PRG => TGET:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">597</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span><span style="color: #000000;">3443</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => SETFOCUS<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TGET:<span style="color: #000000;">SETFOCUS</span><span style="color: #000000;">(</span><span style="color: #000000;">414</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBRWCOLUMN:<span style="color: #00C800;">EDIT</span><span style="color: #000000;">(</span><span style="color: #000000;">10219</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBROWSE:<span style="color: #000000;">LDBLCLICK</span><span style="color: #000000;">(</span><span style="color: #000000;">3484</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">1670</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">11232</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span><span style="color: #000000;">3443</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => WINRUN<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span><span style="color: #000000;">995</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">journal</span>.prg => TJOURNAL:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span><span style="color: #000000;">319</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">journal</span>.prg => MAIN<span style="color: #000000;">(</span><span style="color: #000000;">43</span><span style="color: #000000;">)</span><br /> </div>[/code:2lpi9ufx] |
xBrowse: RTE when editing a numeric cell | From the error log, it appears that there is some error with the picture clause.
Please let us see the xbrowse code pertaining the column. |
xBrowse: RTE when editing a numeric cell | Thanks for the help Rao. I know it's not easy to diagnose without a self-contained example. Appreciate it very much <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
[code=fw:leqj66w4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">xbrowse</span> ::<span style="color: #000000;">oBrw</span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">of</span> ::<span style="color: #000000;">oDlg</span> ;<br /> columns LN_ACCN, LN_ACCNDESC, LN_XREF, LN_CNTR, LN_AMOU_DR, LN_AMOU_CR ;<br /> headers <span style="color: #ff0000;">"Account"</span>, <span style="color: #ff0000;">"Description"</span>, <span style="color: #ff0000;">"X-Ref"</span>, <span style="color: #ff0000;">"P/C"</span>, <span style="color: #ff0000;">"Debit"</span>, <span style="color: #ff0000;">"Credit"</span> ;<br /> pictures <span style="color: #ff0000;">"@!"</span>,,,<span style="color: #ff0000;">"@!"</span>,p_amouf<span style="color: #000000;">(</span>JNL_AMT_WID<span style="color: #000000;">)</span>, p_amouf<span style="color: #000000;">(</span>JNL_AMT_WID<span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// p_amouf(JNL_AMT_WID) returns "@Z 999,999,999.99"</span><br /> array ::<span style="color: #000000;">aFiledbf</span> ;<br /> footers fastedit lines cell <span style="color: #0000ff;">update</span> ;<br /> <span style="color: #0000ff;">when</span> ::<span style="color: #000000;">cStat</span> != STAT_DISP<br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lUpdate</span> := .t.<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_BLACK, bckClr<span style="color: #000000;">(</span><span style="color: #00C800;">self</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_NOLINES<br /> aeval<span style="color: #000000;">(</span>::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>,<span style="color: #000000;">{</span>|o| o:<span style="color: #000000;">lAutoSave</span> := .t., o:<span style="color: #000000;">nEditType</span> := EDIT_GET<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> aeval<span style="color: #000000;">(</span>::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>,<span style="color: #000000;">{</span>|o| o:<span style="color: #000000;">bClrEdit</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_BLACK, CLR_WHITE<span style="color: #000000;">}</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lAllowColSwapping</span> := .f.<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lAllowColHiding</span> := .f.<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lAllowRowSizing</span> := .f.<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span>|| lValidated := .f.<span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_WHITE, CLR_CYAN<span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lHScroll</span> := .f.<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">1</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nStretchCol</span> := <span style="color: #000000;">2</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span>| nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_DELETE, DelRow<span style="color: #000000;">(</span> <span style="color: #00C800;">self</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>nKey==VK_F2, CallColPick<span style="color: #000000;">(</span><span style="color: #00C800;">self</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lAutoAppend</span> := .t.<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bPastEof</span> := <span style="color: #000000;">{</span>|| aadd<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, aclone<span style="color: #000000;">(</span>::<span style="color: #000000;">blk_arr</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> assignColorCode<span style="color: #000000;">(</span><span style="color: #00C800;">self</span><span style="color: #000000;">)</span> , ;<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">GoDown</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">addResource</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"down"</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nBtnBmp</span> := <span style="color: #000000;">1</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span>|row, col, oCol| picklist<span style="color: #000000;">(</span><span style="color: #ff0000;">"evechart"</span>, <span style="color: #ff0000;">"accn"</span>, <span style="color: #00C800;">self</span>, LN_ACCN<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|oCol| lValidated := .f., .t.<span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">{</span>|oGet, oCol| Jnl_ChkAccn<span style="color: #000000;">(</span>oGet, oCol, <span style="color: #00C800;">self</span>, @lValidated<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">(</span>::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oFont</span>:<span style="color: #000000;">nWidth*</span><span style="color: #000000;">7</span><span style="color: #000000;">)</span> + ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aBitMaps</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span>, BITMAP_WIDTH <span style="color: #000000;">]</span> + <span style="color: #000000;">1</span><br /><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">addResource</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"down"</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nBtnBmp</span> := <span style="color: #000000;">1</span><br /> <span style="color: #B900B9;">// if value is returned, bEditBlock is gonna stuff it into get object, if one was active at the time.</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span>|row, col, oCol| picklist<span style="color: #000000;">(</span><span style="color: #ff0000;">"profit"</span>, <span style="color: #ff0000;">"cntr"</span>, <span style="color: #00C800;">self</span>, LN_CNTR<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">{</span>|oGet, oCol| IsValidPC<span style="color: #000000;">(</span>oGet, <span style="color: #00C800;">self</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">(</span>::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oFont</span>:<span style="color: #000000;">nWidth*</span><span style="color: #000000;">5</span><span style="color: #000000;">)</span> + ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aBitMaps</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span>, BITMAP_WIDTH <span style="color: #000000;">]</span> + <span style="color: #000000;">1</span><br /><br /> with object ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">Debit</span><br /> :<span style="color: #000000;">lTotal</span> := .t.<br /> :<span style="color: #000000;">bFooter</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">IsBalanced</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ::<span style="color: #000000;">nDrTotal</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span> <span style="color: #B900B9;">//::nCrTotal</span><br /> <span style="color: #B900B9;">// can only enter amt if an accn is specified</span><br /> :<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|oCol| CanEnterAmt<span style="color: #000000;">(</span>oCol<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">{</span>|oGet, oCol| ::<span style="color: #000000;">VerifyDrCr</span><span style="color: #000000;">(</span>oCol:<span style="color: #000000;">value</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,, oCol<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> end<br /><br /> with object ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">Credit</span><br /> :<span style="color: #000000;">lTotal</span> := .t.<br /> :<span style="color: #000000;">bFooter</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">IsBalanced</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ::<span style="color: #000000;">nCrTotal</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|oCol| CanEnterAmt<span style="color: #000000;">(</span>oCol<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">{</span>|oGet, oCol| ::<span style="color: #000000;">VerifyDrCr</span><span style="color: #000000;">(</span><span style="color: #00C800;">nil</span>, oCol:<span style="color: #000000;">value</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oCol<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> end</div>[/code:leqj66w4] |
xBrowse: RTE when editing a numeric cell | Rao, I think you can ignore it for now and just use it as a mental exercise <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->. Everything seems to be ok again once I changed to BCC instead of MSVC |
xBrowse: Se borran los headers | Utilizo un xBrowse con base de datos (FWH 2.6). Funciona muy bien, excepto en que al desplazar la barra de scroll verticalmente y, a veces, al moverse de un registro a otro desaparecen los headers. Generalmente vuelven a pintarse si se fuerza un "Ir a inicio" o "ir a final" pero resulta incómodo.
¿Alguien sabe la solución a esta anomalía?
Gracias
Rafael |
xBrowse: Se borran los headers | Hola Rafael
Hace un par de meses, tambien puse un post sobre algo parecido a tu problema, desafortunadamente no he podido encontrar la causa o solucion.
Lo que estoy casi seguro es que, sucede cuando agregamos alguna clase que pudiera tener algun tipo de conflicto con alguna otra, ya sea nativa o extra.
Por que usando la misma plataforma, clases, etc, a mi me aparece solo en las apps mayores, mientras que las mas "peques", muestran todo sin ningun problema.
Espero que podamos encontrar alguna luz pronto, por que como dices, es molesto estar haciendo un "refresh manual" cada vez que se muestra dicho browse.
Saludos |
xBrowse: Se borran los headers | Acabo de llegar de vacaciones, y me estoy poniendo al dia. Referente al tema que comentais creo que el problema era debido a
::lRefreshOnlyData := .T.
en el metodo seek de xBrowse, si comentais esa linea creo que se solucionaba lo del refresco de la cabecera. Espero haberos puesto sobre la pista, sino con mas tranquilidat y tiempo revisare y ya os dirira. |
xBrowse: Se borran los headers | Biel:
No sé si tu solución funciona (yo no utilizo el método Seek), pero siguiendo tu sugerencia, he hecho unas cuantas prueba y creo que el problema se soluciona comentando la linea lRefreshOnlyData := .T. en el método VScroll
Muchas gracias por tu idea, que creo que les puede servir a otros.
Rafael |
xBrowse: Se borran los headers | Rafael,
perfecto, me alegro que te haya valido para ponerte sobre la pista, y hayas podido solucionar el problema. |
xBrowse: Vertical Merge | Hi,
Trying to set up vertical merge on Col 1 and Col 2. But doesn't seem to work.
Am using Harbour+FWH1912 for this.
What seems to be wrong:
1. Despite merging, horizontol lines are still painted in col 1
2. Only one checkbox appeared in col 2. Col 2 should have 2 check boxes. One for item 1 the other for item 2
Any help is appreciated TIA
[code=fw:3tbzlrjn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">xbrowse</span> ::<span style="color: #000000;">oBrw</span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">of</span> ::<span style="color: #000000;">oDlg</span> ;<br /> columns LN_CARGO, LN_SELECT, LN_REMA, LN_ACCN, LN_ACCNDESC, LN_AMOU ;<br /> headers <span style="color: #ff0000;">"No"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"Remarks"</span>, <span style="color: #ff0000;">"Code"</span>, <span style="color: #ff0000;">"Account"</span>, <span style="color: #ff0000;">"Amount ("</span> + TRIM<span style="color: #000000;">(</span> zCurr <span style="color: #000000;">)</span> + <span style="color: #ff0000;">") "</span> ;<br /> lines ;<br /> array ::<span style="color: #000000;">aFiledbf</span> ;<br /> <span style="color: #0000ff;">update</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span> | nKey | ::<span style="color: #000000;">FC_ONCHG</span><span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_BLACK, CLR_HGRAY<span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_BLACK, bckClr<span style="color: #000000;">(</span>::<span style="color: #000000;">oBrw</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /> aeval<span style="color: #000000;">(</span>::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>,<span style="color: #000000;">{</span>|o| o:<span style="color: #000000;">bLDClickData</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">FC_ONCHG</span><span style="color: #000000;">(</span> VK_RETURN<span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, o:<span style="color: #000000;">nEditType</span> := EDIT_GET<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">setCheck</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">No</span>:<span style="color: #000000;">lMergeVert</span> := .t.<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">lMergeVert</span> := .t.<br /><br /> </div>[/code:3tbzlrjn]
[url=https://postimages.org/:3tbzlrjn][img:3tbzlrjn]https://i.postimg.cc/Dz449Lk5/recurring.jpg[/img:3tbzlrjn][/url:3tbzlrjn] |
xBrowse: Vertical Merge | if you not give us a test sample we cannot help you |
xBrowse: Vertical Merge | Mui bién Silvio. Asi és. |
xBrowse: Vertical Merge | Here's a reduced, self-contained sample.
1. recur.rc
[code=fw:1kn91qd0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />recur <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">15</span>, <span style="color: #000000;">19</span>, <span style="color: #000000;">440</span>, <span style="color: #000000;">303</span><br />EXSTYLE WS_EX_DLGMODALFRAME<br /><span style="color: #0000ff;">STYLE</span> DS_ABSALIGN | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION<br />CAPTION <span style="color: #ff0000;">"Insert Recurring Items"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">10</span>, <span style="color: #ff0000;">"System"</span><br /><span style="color: #000000;">{</span><br /> CONTROL <span style="color: #ff0000;">"&Ok"</span>, <span style="color: #000000;">102</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">165</span>, <span style="color: #000000;">283</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">16</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">101</span>, <span style="color: #ff0000;">"TXBrowse"</span>, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, <span style="color: #000000;">5</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">431</span>, <span style="color: #000000;">251</span><br /><span style="color: #000000;">}</span><br /> </div>[/code:1kn91qd0]
2. recur.prg
[code=fw:1kn91qd0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> PIC <span style="color: #ff0000;">"@Z 999,999.99"</span><br /><span style="color: #00D7D7;">#define</span> LN_NO <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> LN_SELECT <span style="color: #000000;">2</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> aFiledbf := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #000000;">1</span>, .f., <span style="color: #ff0000;">"PAY A"</span>, <span style="color: #ff0000;">"CL601"</span>, <span style="color: #ff0000;">"ACCRUALS - AUDIT FEE"</span>, transform<span style="color: #000000;">(</span><span style="color: #000000;">100</span>, PIC<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span><span style="color: #000000;">1</span>, .f., <span style="color: #ff0000;">"PAY B"</span>, <span style="color: #ff0000;">"CL600"</span>, <span style="color: #ff0000;">"ACCRUALS - OTHERS"</span> , transform<span style="color: #000000;">(</span><span style="color: #000000;">200</span>, PIC<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span><span style="color: #000000;">1</span>, .f., <span style="color: #ff0000;">"Payee: PAYEE"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, transform<span style="color: #000000;">(</span><span style="color: #000000;">0</span>, PIC<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span><span style="color: #000000;">2</span>, .f., <span style="color: #ff0000;">"PAY C"</span>, <span style="color: #ff0000;">"PD004"</span>, <span style="color: #ff0000;">"ACCUM DEPRN. - MOTOR VEHICLE"</span>, transform<span style="color: #000000;">(</span><span style="color: #000000;">500</span>, PIC<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span><span style="color: #000000;">2</span>, .f., <span style="color: #ff0000;">"PAY D"</span>, <span style="color: #ff0000;">"E0079"</span>, <span style="color: #ff0000;">"ADT ALARM"</span>, transform<span style="color: #000000;">(</span><span style="color: #000000;">300</span>, PIC<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span><span style="color: #000000;">2</span>, .f., <span style="color: #ff0000;">"Payee: ADT ALARM"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, transform<span style="color: #000000;">(</span><span style="color: #000000;">0</span>, PIC<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span><span style="color: #000000;">3</span>, .f., <span style="color: #ff0000;">"PAY E"</span>, <span style="color: #ff0000;">"PD001"</span>, <span style="color: #ff0000;">"ACCUM DEPRN."</span>, transform<span style="color: #000000;">(</span><span style="color: #000000;">150</span>, PIC<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span><span style="color: #000000;">3</span>, .f., <span style="color: #ff0000;">"Payee: SMITH"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, transform<span style="color: #000000;">(</span><span style="color: #000000;">0</span>, PIC<span style="color: #000000;">)</span><span style="color: #000000;">}</span> ;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> oDlg, oBrw<br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"recur"</span> <span style="color: #B900B9;">//font ofont</span><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">xbrowse</span> oBrw <span style="color: #0000ff;">id</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">of</span> oDlg ;<br /> columns LN_NO, LN_SELECT, <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span> ;<br /> headers <span style="color: #ff0000;">"No"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"Remarks"</span>, <span style="color: #ff0000;">"Code"</span>, <span style="color: #ff0000;">"Account"</span>, <span style="color: #ff0000;">"Amount"</span> ;<br /> cell lines noborder ;<br /> array aFiledbf ;<br /> <span style="color: #0000ff;">update</span><br /><br /> oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> oBrw:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span> | nKey | FC_ONCHG<span style="color: #000000;">(</span> nKey, oBrw <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_BLACK, CLR_HGRAY<span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_BLACK, bckClr<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /> aeval<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">aCols</span>,<span style="color: #000000;">{</span>|o| o:<span style="color: #000000;">bLDClickData</span> := <span style="color: #000000;">{</span> || FC_ONCHG<span style="color: #000000;">(</span> VK_RETURN, oBrw<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">setCheck</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">No</span>:<span style="color: #000000;">lMergeVert</span> := .t.<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">lMergeVert</span> := .t.<br /><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">action</span> oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">centered</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------</span><br /><span style="color: #00C800;">function</span> bckClr<span style="color: #000000;">(</span>oXbrw<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> aRow := oXbrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, nRet := CLR_WHITE<br /><br /> <span style="color: #00C800;">if</span> aRow<span style="color: #000000;">[</span>LN_SELECT<span style="color: #000000;">]</span><br /> nRet := nRGB<span style="color: #000000;">(</span><span style="color: #000000;">216</span>, <span style="color: #000000;">76</span>, <span style="color: #000000;">216</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> aRow<span style="color: #000000;">[</span>LN_NO<span style="color: #000000;">]</span> != <span style="color: #00C800;">nil</span><br /> nRet := <span style="color: #00C800;">if</span><span style="color: #000000;">(</span><span style="color: #00C800;">mod</span><span style="color: #000000;">(</span>aRow<span style="color: #000000;">[</span>LN_NO<span style="color: #000000;">]</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">12706303</span>, <span style="color: #000000;">16772310</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> nRet<br /><span style="color: #B900B9;">//----------------------------------------------------------------------</span><br />procedure fc_onchg<span style="color: #000000;">(</span>nKey, oBrw<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> no, i<br /><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> nKey == VK_RETURN .or. nKey == VK_SPACE<br /> no := oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">[</span>LN_NO<span style="color: #000000;">]</span><br /> <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>i, LN_NO<span style="color: #000000;">]</span> == no<br /> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>i, LN_SELECT<span style="color: #000000;">]</span> := !oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>i, LN_SELECT<span style="color: #000000;">]</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>i, LN_NO<span style="color: #000000;">]</span> > no<br /> exit<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDCASE</span><br /><span style="color: #00C800;">return</span><br /> </div>[/code:1kn91qd0] |
xBrowse: Vertical Merge | Hi Rao,
Could you offer some insight? TIA |
xBrowse: Vertical Merge | In the present implementation, we see the horizontal lines if the back color of bClrStd is not the same as oBrw:nClrPane (by default CLR_WHITE).
So, if you choose CLR_WHITE as the back color in bClrStd, you will not see these lines.
We improved this in the version FWH2004 to be released soon. With this improvement, your example will look fine. |
xBrowse: Vertical Merge | This is how your program will look like from FWH2004 onwards.
[url=https://imageshack.com/i/pmqKI7Djp:26dv2a6g][img:26dv2a6g]https://imagizer.imageshack.com/v2/xq90/922/qKI7Dj.png[/img:26dv2a6g][/url:26dv2a6g] |
xBrowse: Vertical Merge | Thank you for solving the line issue Rao. Great work!
Can you advice me on the 2nd column? It is also merged. I expected to see 3 check boxes. One for each No but only one is shown.
The checkbox will be toggled when user double click on any of the row to indicate which sets are selected by user
TIA |
xBrowse: Vertical Merge | After the line
[code=fw:17y5579d]<div class="fw" id="{CB}" style="font-family: monospace;"> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">lMergeVert</span> := .t.<br /> </div>[/code:17y5579d]
Add this line of code:
[code=fw:17y5579d]<div class="fw" id="{CB}" style="font-family: monospace;"> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bMergeValue</span> := <span style="color: #000000;">{</span> |oCol| oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aRow</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /> </div>[/code:17y5579d] |
xBrowse: Vertical Merge | Hi Rao,
[quote="nageswaragunupudi":335inlmp]
Add this line of code:
[code=fw:335inlmp]<div class="fw" id="{CB}" style="font-family: monospace;"> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bMergeValue</span> := <span style="color: #000000;">{</span> |oCol| oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aRow</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /> </div>[/code:335inlmp][/quote:335inlmp]
The above works in my reduced self-contained sample but in my actual program it causes the checkbox to appear on each row of items.
Both were linked with FWH1912.
1. Any idea on what can I do to start finding why the different behaviour?
2. Can you share what need to be changed in xbrowse source to eliminate the white lines?
TIA |
xBrowse: Vertical Merge | 1) Please try
[code=fw:y7fu4hwu]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bMergeValue</span> := <span style="color: #000000;">{</span> |oCol| oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">}</span><br /> </div>[/code:y7fu4hwu]
2) Please keep back color in all bClrStd as CLR_WHITE and see. |
xBrowse: Vertical Merge | Thanks for the prompt reply Rao!
All your suggestions works. Thanks! |
xBrowse: Vertical Merge | Hi Rao,
Can I have zebra effect by playing with fonts for each set of No.?
If it's possible can you share the snippet to do it?
TIA |
xBrowse: Vertical Merge | Please try:
[code=fw:1a5ozvsv]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">oDataFonts</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <cond>, oFont1, oFont2 <span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:1a5ozvsv] |
xBrowse: Vertical Merge | [quote="nageswaragunupudi":3b24rlys]Please try:
[code=fw:3b24rlys]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">oDataFonts</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <cond>, oFont1, oFont2 <span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:3b24rlys][/quote:3b24rlys]
Thanks Rao! It works! |
xBrowse: bOnRowLeave | I want to get the data of the row which user just left.
I can't use :bChange as :aRow() will show the data of current row I'm at.
I saw and tried :bOnRowLeave but my test seems to indicate it also doesn't give the result I'm looking for.
What else can I try?
TIA
p.s. How to get oBrw:report() to print logical field as Yes or No instead of .t., .f.? |
xBrowse: bOnRowLeave | Try with bLButtonUp |
xBrowse: bOnRowLeave | [quote="cnavarro":179u0pf0]Try with bLButtonUp[/quote:179u0pf0]
Doesn't work when navigating with keyboard. If navigate with mouse it'll also return the current row not the previous active row |
xBrowse: bOnRowLeave | Tried :bEditValid but seems checkbox won't trigger it |
xBrowse: bOnRowLeave | [quote:3905vbrt]I saw and tried :bOnRowLeave but my test seems to indicate it also doesn't give the result I'm looking for.
[/quote:3905vbrt]
:bOnRowLeave was actually intended for this purpose only, but it is not working reliably <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> |
xBrowse: bOnRowLeave | Rao,
I can do a workaround using bEditValid for Gets but has no solution for checkboxes.
Any idea? |
xBrowse: bOnRowLeave | We need to improve on the usage of bOnRowLeave.
Will you be able to do some tests? |
xBrowse: bOnRowLeave | Sure Rao. What do you need ? |
xBrowse: error in SameArrayStruct(..) function | Hi,
line 9380 "if nLen<=len(aNew)" has to be replaced with "if nLen<=len(aNew[1])" otherwise that function return .f. incorrectly |
xBrowse: error in SameArrayStruct(..) function | It was not an error. I think it was intentional. If the new array that is being substituted has more columns than the present array, it does not affect the browse in any way. |
xBrowse: error in SameArrayStruct(..) function | Hi Marco, Rao:
I agree with Marco, that sentence is comparing number of columns with number of rows.
Regards.
Manuel Mercado |
xBrowse: error in SameArrayStruct(..) function | Marco ,
See also <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=14046#p72232">viewtopic.php?f=3&t=14046#p72232</a><!-- l -->
From FWH 8.12 it should be corrected |
xBrowse: error in SameArrayStruct(..) function | Sorry. Yes. You are all right.
Hope this will be fixed in the next version.
Meanwhile we can correct our copies as Mr Marco suggested |
xBrowse: grabar dato al salir de celda con el mouse | Amigos del foro:
Varios de los usuarios de mis programas se quejan de que al salir del editor de celda con el mouse, se pierde el dato.
Lo resolví de la siguiente manera:
Modifique el METHOD PostEdit( xValue, lButton, lDirectAssign ) CLASS TXBrwColumn, de la siguiente forma:
[code=fw:31o889h2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">case</span> ::<span style="color: #000000;">nEditType</span> == EDIT_GET .or. ::<span style="color: #000000;">nEditType</span> >= EDIT_DATE<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oEditGet</span> != <span style="color: #00C800;">nil</span><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">Assign</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #B900B9;">//<--- Aniadir esta linea. Resuelve el problema de salir de la edicion con el mouse. si se lo coloca en ::oEditGet:bLostFocus no funciona</span><br /><br /> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPostEdit</span>, <span style="color: #00C800;">Self</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bSetGet</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> <span style="color: #000000;">)</span><br /> nLastKey := ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span><br /> lGoNext := <span style="color: #000000;">(</span> AScan<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> VK_RETURN, VK_DOWN, VK_UP, VK_TAB <span style="color: #000000;">}</span>, ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:31o889h2]
y mas abajo
[code=fw:31o889h2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">case</span> ::<span style="color: #000000;">nEditType</span> == EDIT_GET_LISTBOX<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oEditLbx</span> != <span style="color: #00C800;">nil</span> .and. IsWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditLbx</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditLbx</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditLbx</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ! lButton<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oEditGet</span> != <span style="color: #00C800;">nil</span><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">Assign</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #B900B9;">//<--- Aniadir esta linea. Resuelve el problema de salir de la edicion con el mouse. si se lo coloca en ::oEditGet:bLostFocus no funciona</span><br /><br /> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPostEdit</span>, <span style="color: #00C800;">Self</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bSetGet</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> <span style="color: #000000;">)</span><br /> lGoNext := <span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> == VK_RETURN <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /> elseif xValue != <span style="color: #00C800;">nil</span><br /> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPostEdit</span>, <span style="color: #00C800;">Self</span>, xValue, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">case</span> ::<span style="color: #000000;">nEditType</span> == EDIT_GET_BUTTON<br /> <span style="color: #00C800;">if</span> ! lButton<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oEditGet</span> != <span style="color: #00C800;">nil</span><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">Assign</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #B900B9;">//<--- Aniadir esta linea. Resuelve el problema de salir de la edicion con el mouse. si se lo coloca en ::oEditGet:bLostFocus no funciona</span><br /><br /> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPostEdit</span>, <span style="color: #00C800;">Self</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bSetGet</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> <span style="color: #000000;">)</span><br /> lGoNext := <span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> == VK_RETURN <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /> elseif xValue != <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bOnPostEdit</span> != <span style="color: #00C800;">nil</span><br /> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPostEdit</span>, <span style="color: #00C800;">Self</span>, xValue, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:31o889h2]
Con estas modificaciones, al salir del la celda con el mouse, el dato permanece.
Si alguien ya resolvió el problema, por favor indicar cual es la mejor forma (busque en el foro y no lo encontré)
El problema ahora es que:[b:31o889h2] NO se ejecuta[/b:31o889h2] el ::oEditGet:bValid.
Como hago para que se ejecute el ::oEditGet:bValid al salir del editor de celda con el mouse??
De antemano, gracias por la ayuda.
Atentamente,
Rolando
Cochabamba - Bolivia |
xBrowse: grabar dato al salir de celda con el mouse | Rolando,
probaste con
[code=fw:3ve56068]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><coln><span style="color: #000000;">]</span>:<span style="color: #000000;">lAutoSave</span> := .T.</div>[/code:3ve56068]
saludos
Marcelo |
xBrowse: grabar dato al salir de celda con el mouse | Rolando,
Como indica Marcelo con lAutoSave es suficiente sin hacer ningún cambio
[code=fw:3d3mc7qv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>|o, v, n| oEMPL:<span style="color: #000000;">TFAC</span>:=v,oEMPL:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bEditValid</span>:=<span style="color: #000000;">{</span>| oGet, oCol| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span>oGet:<span style="color: #000000;">Value</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><<span style="color: #000000;">50</span>,<span style="color: #000000;">(</span>MsgStop<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,.F.<span style="color: #000000;">)</span>,.T. <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">lAutoSave</span>:= .T.<br /> </div>[/code:3d3mc7qv]
Con validación
Saludos,
Adhemar |
xBrowse: grabar dato al salir de celda con el mouse | Marcelo, Ademar:
Gracias, funciona perfecto |
xBrowse: how to retrieve field names... | Can I with oBrw:aCols[ x ]... class tXbrowse (FWH 11.07) retrieve field names, like I retrieve header (oBrw:aCols[i]:aHeaders)?
I work with tDolphin and MySQL. Here is small example.
I try to get "first","last","city" fields in array, but without success.
[code=fw:1vrsmmae]<div class="fw" id="{CB}" style="font-family: monospace;"> aadd<span style="color: #000000;">(</span> aFields, <span style="color: #ff0000;">"first"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aHead, <span style="color: #ff0000;">"Head 1"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aFormat, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aFields, <span style="color: #ff0000;">"last"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aHead, <span style="color: #ff0000;">"Head 2"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aFormat, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aFields, <span style="color: #ff0000;">"city"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aHead, <span style="color: #ff0000;">"Head 3"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aFormat, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd OBJECT oQry COLUMNS aFields HEADERS aHead LINES CELL FASTEDIT<br /> <span style="color: #B900B9;">//----------------------------------------------------------------------------------------</span><br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">oClient</span> = oBrw</div>[/code:1vrsmmae]
Best regards |
xBrowse: how to retrieve field names... | Try this:
[code=fw:1gsnqob3]<div class="fw" id="{CB}" style="font-family: monospace;">MyArrayOfFields := ArrTranspose<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">oMySql</span>:<span style="color: #000000;">aStructure</span> <span style="color: #000000;">)</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span></div>[/code:1gsnqob3] |
xBrowse: how to retrieve field names... | I try this this command earlier,but this give me all fields from database table, not those that I choose for my xBrowse.
Thanks |
xBrowse: how to retrieve field names... | I don´t understand what you are trying to do. The fields already are in the array you used to build the browse. Field in column n is aFields[ n ] or am I missing something? |
xBrowse: how to retrieve field names... | Boris
This should work if you want to get the value of a header from a clicked cell ..
[code=fw:6bq64sa9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cText := oLbxA:<span style="color: #000000;">SelectedCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">cHeader</span><br /> </div>[/code:6bq64sa9]
Rick Lipkin |
xBrowse: how to retrieve field names... | I put the actual field name in :cargo when i need to know later.
The header does not contain the field name and data is generally a code block. |
xBrowse: how to retrieve field names... | I use two ways to add fields/headers/format array for xBrowse, something like this:
[code=fw:10s6uglm]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aadd<span style="color: #000000;">(</span> aFields, <span style="color: #ff0000;">"sifr"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aHead, <span style="color: #ff0000;">"Šifra"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aFormat, <span style="color: #ff0000;">"@!"</span> <span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span> aFields, <span style="color: #ff0000;">"bar"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aHead, <span style="color: #ff0000;">"Bar-kod"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aFormat, <span style="color: #ff0000;">"@!"</span> <span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span> aFields, <span style="color: #ff0000;">"naziv"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aHead, <span style="color: #ff0000;">"Naziv robe"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aFormat, <span style="color: #ff0000;">"@!"</span> <span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span> aFields, <span style="color: #ff0000;">"mc"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aHead, <span style="color: #ff0000;">"Mc"</span> <span style="color: #000000;">)</span>; aadd<span style="color: #000000;">(</span> aFormat, <span style="color: #ff0000;">"@Z 9999,999.99"</span> <span style="color: #000000;">)</span><br />...<br />ADD FIELDS <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #00C800;">AT</span> <span style="color: #000000;">01</span> <span style="color: #00C800;">DATA</span> storno HEADER <span style="color: #ff0000;">"Storno"</span><br />ADD FIELDS <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #00C800;">AT</span> <span style="color: #000000;">02</span> <span style="color: #00C800;">DATA</span> matc->grupa+<span style="color: #ff0000;">' '</span>+grup->konto HEADER <span style="color: #ff0000;">"Grupa/Konto"</span><br />ADD FIELDS <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #00C800;">AT</span> <span style="color: #000000;">05</span> <span style="color: #00C800;">DATA</span> matc->naziv HEADER <span style="color: #ff0000;">"Naziv robe"</span><br />...<br />? <span style="color: #ff0000;">"result: -> "</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">aHeaders</span> <span style="color: #000000;">(</span>result: -> Grupa/Konto<span style="color: #000000;">)</span></div>[/code:10s6uglm]
In one moment I saw solution in "cargo" method, but I think, if there is way to retrieve header (like this example), must be a way to retrieve field name.
Best regards |
xBrowse: how to retrieve field names... | Has the command ADD FIELDS TO XBROWSE been introduced after FWH 13.04? I cant find it in my ch files. |
xBrowse: how to retrieve field names... | I have version 11.07 and this command works fine[code=fw:19hpew0t]<div class="fw" id="{CB}" style="font-family: monospace;"> ADD FIELDS <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #00C800;">AT</span> <span style="color: #000000;">01</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">(</span><span style="color: #00C800;">if</span><span style="color: #000000;">(</span> empty<span style="color: #000000;">(</span>oQry:<span style="color: #000000;">jsf</span><span style="color: #000000;">)</span>,.f.,.t.<span style="color: #000000;">)</span><span style="color: #000000;">)</span> HEADER <span style="color: #ff0000;">"I"</span><br /> oCol:=oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> oCol:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"ON"</span>, <span style="color: #ff0000;">"OFF"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cSortOrder</span> := <span style="color: #00C800;">nil</span><br /> </div>[/code:19hpew0t] |
xBrowse: how to retrieve field names... | Boris,
Do you mean to retrieve the column DATA description ?
ADD FIELDS TO XBROWSE oBrw AT 02 DATA matc->grupa+' '+grup->konto HEADER "Grupa/Konto"
from the above it would be:
"matc->grupa+' '+grup->konto"
is this what you mean ? |
xBrowse: how to retrieve field names... | Antonio,
thanks for your time. Yes, char/strigs what are in array for xBrw field name (in above examlpe aFields array { "sifr","bar" ,"naziv","mc","storno","matc->grupa+' '+grup->konto" } or { "oQry:sifr","oQry:bar" ,"oQry:naziv" } ). I have some idea ho to solve this, but if exist something like ... [b:2e4lhmqc]oBrw:aCols[count]:aField[/b:2e4lhmqc] ..., it will simplify my job.
Best regards |
xBrowse: how to retrieve field names... | Using your example
ADD FIELDS TO XBROWSE oBrw AT 01 DATA storno HEADER "Storno"
ADD FIELDS TO XBROWSE oBrw AT 02 DATA matc->grupa+' '+grup->konto HEADER "Grupa/Konto"
ADD FIELDS TO XBROWSE oBrw AT 05 DATA matc->naziv HEADER "Naziv robe"
oBrw:aCols[1]:cargo := [storno]
oBrw:aCols[2]:cargo := [Grupa/Konto]
oBrw:aCols[3]:cargo := [naziv]
Then later you can retrieve the char value
? "result: -> ", oBrw:aCols[2]:cargo (result: -> Grupa/Konto) |
xBrowse: how to retrieve field names... | Gale,
I alredy try your code with my aplication. Works fine.
Thanks |
xBrowse: how to retrieve field names... | Mr Bosibila
I do not remember from which version we introduced this, but now oCol:cExpr returns the field name for you.
Please check if this DATA ( oCol:cExpr ) is in your version. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.