topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
xBrowse as record adding tool for data tables | I see that Xbrowse show a blanco line for appending and editing a new record, but when you don't put any data into the row, it is not appended to the database and not shown also into the browse.
I've seen in in combination with :
oRs:lAutoAppend := .t. and MariaDB
and than the xbrowse.
I though that Xbrowse does it on all database platforms (Mariadb, Sql and dbf)
I hope i'm reading this post correct and this can help.
BTW : i'm interested in the code !! |
xBrowse as record adding tool for data tables | It does help. To clarify, I'm not using any additional layer as in ADO. These are .adt/adi tables and I'm simply using RDDADS.
[code=fw:2cbzbhf2]<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;">131</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oDlg</span> ;<br /> HEADER <span style="color: #ff0000;">"LeaseID"</span>, <span style="color: #ff0000;">"PropertyID"</span>, <span style="color: #ff0000;">"LandLordID"</span>, <span style="color: #ff0000;">"ManagerID"</span>, <span style="color: #ff0000;">"StartDate"</span>, <span style="color: #ff0000;">"EndDate"</span>, <span style="color: #ff0000;">"TenantName"</span>, ;<br /> <span style="color: #ff0000;">"Rent"</span>, <span style="color: #ff0000;">"PMagmntFee"</span> ;<span style="color: #B900B9;">//, "Balance", "Expenses", "Net", "Payments" ;</span><br /> COLUMNS <span style="color: #ff0000;">"LeaseID"</span>, <span style="color: #ff0000;">"PropertyID"</span>, <span style="color: #ff0000;">"LandLordID"</span>, <span style="color: #ff0000;">"ManagerID"</span>, <span style="color: #ff0000;">"StartDate"</span>, <span style="color: #ff0000;">"EndDate"</span>, <span style="color: #ff0000;">"TenantName"</span>, ;<br /> <span style="color: #ff0000;">"Rent"</span>, <span style="color: #ff0000;">"PmFee"</span> ;<br /> ;<span style="color: #B900B9;">//FIELDS { || ::LoadBalances(), ::oDbf:Balance }, { || ::oDbf:Expenses }, {|| ::oDbf:Net }, { || ::oDbf:Payments } ;</span><br /> SIZES <span style="color: #000000;">100</span>, <span style="color: #000000;">170</span>, <span style="color: #000000;">140</span>, <span style="color: #000000;">140</span>, <span style="color: #000000;">70</span>, <span style="color: #000000;">70</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">90</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span> ;<br /> PICTURES ,,,,<span style="color: #ff0000;">"@d"</span>,<span style="color: #ff0000;">"@d"</span>,,<span style="color: #ff0000;">"9,999,999.99"</span>, <span style="color: #ff0000;">"9,999.99"</span>, <span style="color: #ff0000;">"9,999,999.99"</span>, <span style="color: #ff0000;">"9,999,999.99"</span>, <span style="color: #ff0000;">"9,999,999.99"</span>, <span style="color: #ff0000;">"9,999,999.99"</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> ::<span style="color: #000000;">oDbf</span>:<span style="color: #000000;">cAlias</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bChange</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ON</span> DBLCLICK Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bEdit</span> <span style="color: #000000;">)</span> ;<br /> FOOTERS ;<br /> <span style="color: #0000ff;">WHEN</span> ! ::<span style="color: #000000;">lEdit</span><br /> </div>[/code:2cbzbhf2]
I'll share the solution when/if I find one.
Thank you all,
Reinaldo. |
xBrowse as record adding tool for data tables | Its just an idea.
All the recordset data will be read into an array initially, then use this Array on xBrowse. So you will be adding a blank array row and the data is validated and if all the data typed in by the user is as per your rules, then append the data to your DBF/Recordset. Of course you will have to manage the EDIT too
Regards
[b:2jib4u1u]Anser[/b:2jib4u1u] |
xBrowse as record adding tool for data tables | Hola Reinaldo,
I think we can't mix data source in xBrowse, maybe with ADS you can use transaction to rollback a not confirm insertion.
Other idea (fast implementation sample) can be
[code=fw:3aax6n3g]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oBrw, oDlg, aData := <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #000000;">7</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">9</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /> <br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">from</span> <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">pixel</span><br /> <br /> @ <span style="color: #000000;">5</span>,<span style="color: #000000;">5</span> <span style="color: #0000ff;">Xbrowse</span> oBrw ;<br /> <span style="color: #0000ff;">OF</span> oDlg ;<br /> columns <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span> ;<br /> header <span style="color: #ff0000;">"A"</span>,<span style="color: #ff0000;">"B"</span>,<span style="color: #ff0000;">"C"</span> ;<br /> sizes <span style="color: #000000;">90</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">90</span>;<br /> ARRAY aData ;<br /> <span style="color: #0000ff;">size</span> <span style="color: #000000;">170</span>,<span style="color: #000000;">170</span> ;<br /> <span style="color: #0000ff;">pixel</span><br /> <br /> oBrw:<span style="color: #000000;">createFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> oBrw:<span style="color: #000000;">bPastEof</span> := <span style="color: #000000;">{</span>|| <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> newRecord<span style="color: #000000;">(</span> aData, oBrw, oDlg <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">setArray</span><span style="color: #000000;">(</span> aData <span style="color: #000000;">)</span>, ;<br /> oBrw:<span style="color: #000000;">goBottom</span><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> <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span>, .T. <span style="color: #000000;">}</span><br /> <br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">center</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">FUNCTION</span> newRecord<span style="color: #000000;">(</span> aData, oBrw, oD <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg, v1 := <span style="color: #000000;">0</span>, v2 := <span style="color: #000000;">0</span>, v3 := <span style="color: #000000;">0</span>, lRet := .F. <br /> <span style="color: #00C800;">LOCAL</span> aRect := GetCoors<span style="color: #000000;">(</span>oD:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nCol := oBrw:<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;">nDisplayCol</span> + aRect<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, ;<br /> nRow := <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nRowSel</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> * oBrw:<span style="color: #000000;">nRowHeight</span> <span style="color: #000000;">)</span> + oBrw:<span style="color: #000000;">HeaderHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + aRect<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <br /> <br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">440</span>,<span style="color: #000000;">780</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">STYLE</span> nOR<span style="color: #000000;">(</span> WS_CHILD, WS_POPUP, WS_VISIBLE <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">5</span>,<span style="color: #000000;">5</span> <span style="color: #0000ff;">GET</span> v1 <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">45</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">pixel</span><br /> @ <span style="color: #000000;">5</span>,<span style="color: #000000;">50</span> <span style="color: #0000ff;">GET</span> v2 <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">45</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">pixel</span><br /> @ <span style="color: #000000;">5</span>,<span style="color: #000000;">95</span> <span style="color: #0000ff;">GET</span> v3 <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">45</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">pixel</span><br /> @ <span style="color: #000000;">5</span>,<span style="color: #000000;">140</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"ADD"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">45</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> AADD<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> v1, v2, v3 <span style="color: #000000;">}</span> <span style="color: #000000;">)</span>, lRet := .T. , oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #0000ff;">move</span><span style="color: #000000;">(</span> nRow + <span style="color: #000000;">60</span>, nCol <span style="color: #000000;">)</span><br /> <br /><span style="color: #00C800;">RETURN</span> lRet</div>[/code:3aax6n3g]
we can put too other xbrowse (1 row) enstead of the of the gets and syncronize both
un abrazo
Marcelo |
xBrowse as record adding tool for data tables | Marcelo
I use the same logic .. however I don't think Reinaldo wants to create a new record and generate the primary keys unless the user confirms all the information ... I understand where Reinaldo is coming from .. when you test for oBrw:bPastEof .. you have to create a new record .. and if the user doesn't confirm the data .. you have a blank record in the table you have to Delete.
Rick Lipkin |
xBrowse as record adding tool for data tables | Rick,
if we want to confirm the data for a single record, the sample code can be a possible solution, but if Reinaldo needs to confirm many record at the same time, it is other thing
saludos
Marcelo |
xBrowse as record adding tool for data tables | I have never used ADS, is it browsing the DBF directly or a recordset? If a recordset, can't you just add a blank record (without a key) and then the key is generated when (and if) the data is saved from the recordset to the DBF?
I always use dialogs for editing, so this issue hasn't come up for me. I just use a blank record object from my TRecord class, then just edit that. It is only saved to the database if the user selects to save it.
James |
xBrowse as record adding tool for data tables | Mr Reinaldo
If you still have sources of Clipper 5.3, see the sources of DBU and SAMPLE\BROWSE.PRG.
There you find the logic to create fantom record, without actually appending a record. Once user modifies any field, you can then insert the new record. |
xBrowse as record adding tool for data tables | Hello Reinaldo,
I am trying to call a MySQL stored procedure but I cannot get it working.
The stored procedure itself is OK and I can call it with PHP:
[code=fw:1dr9fem2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />$sql2 = <span style="color: #ff0000;">"CALL GET_ALL_P0001() "</span>; <br />$res = $mysqli->query<span style="color: #000000;">(</span>$sql2<span style="color: #000000;">)</span>;<br /><br /><span style="color: #00C800;">while</span><span style="color: #000000;">(</span>$row = $res->fetch_assoc<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>:<br /> $FIL_NR = $row<span style="color: #000000;">[</span><span style="color: #ff0000;">"FIL_NR"</span><span style="color: #000000;">]</span> ; <br /> $DATUM = $row<span style="color: #000000;">[</span><span style="color: #ff0000;">"DATUM"</span><span style="color: #000000;">]</span> ; <br /> $table .= <span style="color: #ff0000;">'<tr><td>'</span> . $FIL_NR . <span style="color: #ff0000;">'</td><td>'</span>. $DATUM . <span style="color: #ff0000;">'</td></tr>'</span> ;<br />endwhile; <br /> </div>[/code:1dr9fem2]
But in my PRG I get an error: cannot give result in th is context (or something like that...)
Do you have any idea on how to call and retrieve results from a stored procedure?
Thanks in advance,
Serge |
xBrowse as record adding tool for data tables | ADS stored procedure or MySql stored procedure?
If it is MySql stored procedure, FWH directly provides full mySql functionality.
Calling a stored procedure is as simple as
uResult := oCn:Call( "procedurename", aParams ) |
xBrowse as record adding tool for data tables | Thanks for replying!
I have that instruction in my PRG but how to retrieve all rows in a loop?
Serge |
xBrowse autosort | Hi all,
i have a xBrowse with array as data source and in autosort mode.
When changing the sort order of the browse by clicking the col headers i would like to perform a 'go top'.
Is this possible? If yes, how?
Thanks for all hints.
Regards,
Detlef |
xBrowse autosort | By the method oCol:bRClickHeader, you can do it!
[code:24m9t34j]oCol := oBrw:oCol( cHeader )
oCol:bRClickHeader := {|| TEST->( dbGoTop() ) }[/code:24m9t34j] |
xBrowse autosort | Julio,
thanks for your suggest.
It doesn't work, but you pointed me the way how to do it.
Sort oder is changed with a left click on the header.
And my data source is an array.
So i tried out the following which works as expected.
[code:1e8wrj87]oBrw:aCols[ n ]:bLClickHeader := { || oBrw:GoTop() }[/code:1e8wrj87]
Thanks again Julio,
Detlef |
xBrowse autosort | Detlef,
[code:3pizlnjl]oBrw:aCols[ n ]:bLClickHeader
is the same of
oCol := oBrw:oCol( cHeader )
oCol:bLClickHeader[/code:3pizlnjl]
But your solution is wonderful! It's much more better! |
xBrowse autosort 10.6 with object | Hi, I want to use the xBrowse autosort (for array) but when I use an object as an array the sort just don't work...
I put a debug in ACompare() and xVal and yVal is always numeric and 1, any tips? |
xBrowse autosort 10.6 with object | Please try
[code=fw:389prpuz]<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;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aObj, oDlg, oBrw, oFont<br /><br /> aObj := <span style="color: #000000;">{</span> ;<br /> TTemp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #ff0000;">'One'</span>, Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> TTemp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">5</span>, <span style="color: #ff0000;">'Five'</span>, Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, ;<br /> TTemp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">3</span>, <span style="color: #ff0000;">'Three'</span>, Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> - <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> SET DATE ITALIAN<br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<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 /> FIELDS oBrw:<span style="color: #000000;">aRow</span>:<span style="color: #000000;">nVal</span>, oBrw:<span style="color: #000000;">aRow</span>:<span style="color: #000000;">cVal</span>, oBrw:<span style="color: #000000;">aRow</span>:<span style="color: #000000;">dVal</span> ;<br /> HEADERS <span style="color: #ff0000;">"Number"</span>, <span style="color: #ff0000;">"CharVal"</span>, <span style="color: #ff0000;">"Date"</span> ;<br /> SORT <span style="color: #000000;">{</span> |o| MyColSort<span style="color: #000000;">(</span> o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> |o| MyColSort<span style="color: #000000;">(</span> o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> |o| MyColSort<span style="color: #000000;">(</span> o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ;<br /> COLSIZES <span style="color: #000000;">50</span>,<span style="color: #000000;">100</span>,<span style="color: #000000;">100</span> ;<br /> ARRAY aObj CELL LINES NOBORDER AUTOSORT<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<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 /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MyColSort<span style="color: #000000;">(</span> oCol <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cOrder := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oCol:<span style="color: #000000;">cOrder</span> == <span style="color: #ff0000;">'A'</span>, <span style="color: #ff0000;">'D'</span>, <span style="color: #ff0000;">'A'</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oBrw := oCol:<span style="color: #000000;">oBrw</span><br /> <span style="color: #00C800;">local</span> cData := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"nVal"</span>, <span style="color: #ff0000;">"cVal"</span>, <span style="color: #ff0000;">"dVal"</span> <span style="color: #000000;">}</span><span style="color: #000000;">[</span> oCol:<span style="color: #000000;">nCreationOrder</span> <span style="color: #000000;">]</span><br /><br /> <span style="color: #00C800;">if</span> cOrder == <span style="color: #ff0000;">'D'</span><br /> ASort<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">aArrayData</span>,,,<span style="color: #000000;">{</span> |x,y| OSend<span style="color: #000000;">(</span> x, cData <span style="color: #000000;">)</span> > OSend<span style="color: #000000;">(</span> y, cData <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ASort<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">aArrayData</span>,,,<span style="color: #000000;">{</span> |x,y| OSend<span style="color: #000000;">(</span> x, cData <span style="color: #000000;">)</span> < OSend<span style="color: #000000;">(</span> y, cData <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cOrder<br /><br /><br /><span style="color: #00C800;">CLASS</span> TTemp<br /><br /> <span style="color: #00C800;">DATA</span> nVal, cVal, dVal<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> a, b, c <span style="color: #000000;">)</span> CONSTRUCTOR<br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> a, b, c <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TTemp<br /><br /> ::<span style="color: #000000;">nVal</span> := a<br /> ::<span style="color: #000000;">cVal</span> := b<br /> ::<span style="color: #000000;">dVal</span> := c<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /> </div>[/code:389prpuz] |
xBrowse autosort 10.6 with object | Hi my structure is this:
[code=fw:3jg2giq6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oRecto := TRecebimento<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #B900B9;">//-- xBrowse ----------------------------------------------------------//</span><br /> <br /> oBrx := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlg <span style="color: #000000;">)</span><br /> oBrx:<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">(</span> <span style="color: #000000;">301</span> <span style="color: #000000;">)</span><br /> <br /> oBrx:<span style="color: #000000;">lHScroll</span> := .T. <span style="color: #B900B9;">//-- 4/5/2011 - Aloizio.</span><br /><br /> <span style="color: #B900B9;">//-- Obs - aTitulos is an array of objects</span><br /><br /> oBrx:<span style="color: #000000;">SetArray</span><span style="color: #000000;">(</span> oRecto:<span style="color: #000000;">aTitulos</span>, .T. ,<span style="color: #000000;">6</span>, <span style="color: #000000;">{</span><span style="color: #000000;">5</span>,<span style="color: #000000;">6</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">9</span>,<span style="color: #000000;">10</span>,<span style="color: #000000;">21</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">16</span>,<span style="color: #000000;">23</span>,<span style="color: #000000;">27</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <br /><br /> xBrowseStyle<span style="color: #000000;">(</span>oBrx<span style="color: #000000;">)</span> <br /> oBrx:<span style="color: #000000;">nDataType</span> := DATATYPE_ARRAY<br /> <br /> oBrx:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span>| nKey, nFlags | KeyDownDlg<span style="color: #000000;">(</span>nKey, nFlags<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oBrx:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">{</span> || BtnClickMarcar<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//---------------> Duplo click</span><br /> oBrx:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span> ||<span style="color: #000000;">{</span>CLR_BLACK,ClrPaneBrw<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span> <span style="color: #B900B9;">//---------------> Mudar cor de fundo</span><br /><br /><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">01</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Data emissao"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">01</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_CENTER<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">01</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">02</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Data vencimento"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">02</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_CENTER<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">02</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">03</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Título"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">03</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">03</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_LEFT<br /><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">04</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Valor a pagar"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">04</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">04</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_RIGHT<br /><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">05</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Valor pago"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">05</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">05</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_RIGHT<br /><br /> <span style="color: #B900B9;">//-- valor original</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">06</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Vr. original"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">06</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">06</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_RIGHT<br /><br /> <span style="color: #B900B9;">//-- valor de devolução</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">07</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Vr. devolvido"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">07</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">07</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_RIGHT<br /><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">08</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Retirado"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">08</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">08</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_LEFT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">08</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">170</span> <br /><br /> <span style="color: #B900B9;">//-- histórico.</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">09</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Histórico"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">09</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">09</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_LEFT<br /><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">09</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">200</span> <br /><br /> <span style="color: #B900B9;">//-- valor já recebido</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">10</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Vr. já pago"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">10</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">10</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_RIGHT<br /> <br /> <span style="color: #B900B9;">//-- data do recebimento parcial</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Dt. parcial"</span><br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> oBrx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_RIGHT<br /><br /> </div>[/code:3jg2giq6] |
xBrowse autosort 10.6 with object | You may assign a codeblock for each column
oCol:cSortOrder := { |o| YourSortLogic( o ) }
My sample illustrates the usage. It is upto you whether you like to use data names or data ordinal positions to fetch the values for sorting. |
xBrowse autosort 10.6 with object | If is up to me, it isn't autosort.
8.02 works fine.
I think the error is here:
[code=fw:i6yov2q2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> SortArrayData<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn<br /><br /> <span style="color: #00C800;">local</span> aCols<br /> <span style="color: #00C800;">local</span> cOrder<br /> <span style="color: #00C800;">local</span> nAt, nFor, nLen<br /> <span style="color: #00C800;">local</span> uSave, cType<br /><br /> aCols := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><br /> cOrder := ::<span style="color: #000000;">cOrder</span><br /> nLen := Len<span style="color: #000000;">(</span> aCols <span style="color: #000000;">)</span><br /> nAt := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">cSortOrder</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'N'</span>, ::<span style="color: #000000;">cSortOrder</span>, ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br /> <span style="color: #00C800;">if</span> aCols<span style="color: #000000;">[</span> nFor <span style="color: #000000;">]</span>:<span style="color: #000000;">nArrayCol</span> != ::<span style="color: #000000;">nArrayCol</span><br /> aCols<span style="color: #000000;">[</span> nFor <span style="color: #000000;">]</span>:<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><br /> uSave := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">if</span> cOrder == <span style="color: #ff0000;">'A'</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := Asort<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,, <span style="color: #000000;">{</span>|x,y| ACompare<span style="color: #000000;">(</span> x, y, nAt, ::<span style="color: #000000;">lCaseSensitive</span> <span style="color: #000000;">)</span> < <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">'D'</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := Asort<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,, <span style="color: #000000;">{</span>|x,y| ACompare<span style="color: #000000;">(</span> x, y, nAt, ::<span style="color: #000000;">lCaseSensitive</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">'A'</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> := AScan<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, uSave <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">self</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ACompare<span style="color: #000000;">(</span> x, y, nAt, lCaseSensitive <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> nRet := <span style="color: #000000;">-1</span><br /> <span style="color: #00C800;">local</span> xVal, yVal, xType, yType<br /> <span style="color: #00C800;">local</span> aType := <span style="color: #ff0000;">'ULNPDCHO'</span><br /><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span> != <span style="color: #ff0000;">'A'</span><br /> x := <span style="color: #000000;">{</span> x <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /> xVal := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nAt <= Len<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span>, x<span style="color: #000000;">[</span> nAt <span style="color: #000000;">]</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span><br /> xType := ValType<span style="color: #000000;">(</span> xVal <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> y <span style="color: #000000;">)</span> != <span style="color: #ff0000;">'A'</span><br /> y := <span style="color: #000000;">{</span> y <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /> yVal := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nAt <= Len<span style="color: #000000;">(</span> y <span style="color: #000000;">)</span>, y<span style="color: #000000;">[</span> nAt <span style="color: #000000;">]</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span><br /> yType := ValType<span style="color: #000000;">(</span> yVal <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> xType == yType .and. xType $ <span style="color: #ff0000;">'CDLN'</span><br /> <span style="color: #00C800;">if</span> xType == <span style="color: #ff0000;">'C'</span> .and. ! lCaseSensitive<br /> xVal := Upper<span style="color: #000000;">(</span> xVal <span style="color: #000000;">)</span><br /> yVal := Upper<span style="color: #000000;">(</span> yVal <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> xVal := <span style="color: #00C800;">At</span><span style="color: #000000;">(</span> xType, aType <span style="color: #000000;">)</span><br /> yVal := <span style="color: #00C800;">At</span><span style="color: #000000;">(</span> yType, aType <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> nRet := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> xVal == yVal, <span style="color: #000000;">0</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> xVal < yVal, <span style="color: #000000;">1</span>, <span style="color: #000000;">-1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//-- xVal and yVal is always numeric 1</span><br /><span style="color: #00C800;">return</span> nRet<br /><br /> </div>[/code:i6yov2q2] |
xBrowse autosort 10.6 with object | Any tips? |
xBrowse ayuda | Antonio, he intentado buscar información del xBrowse y en el wiki y apenas hay información y la que hay está en inglés.
[url:alcmiqpz]http://www.fivetechsoft.com/wiki/doku.php?id=xbrowse[/url:alcmiqpz]
Quiero eliminar la columna donde aparece el triángulo del cursor del browse y no se como realizarlo. Es la primera columana que aparece en la izquierda. ¿Cómo?
Me puedes enviar una contraseña para el wiki y ya que me tengo que poner a investigar sobre el xBrowse voy a intentar actualizar la información al respecto? Sé que hace tiempo me la mandaste pero no sé donde la tengo. |
xBrowse ayuda | Andres,
oBrw:lRecordSelector := .f. |
xBrowse ayuda | Gracias, funciona perfecto.
Unos problemas mas. Intento pasar el ejemplo que está en un dialogo a ventana, para poderlo manejar en mis programas. Ver el siguiente código (Antonio buen ejemplo para acompañar al wwonders.dbf).
[url:2wta3qq8]http://forums.fivetechsupport.com/viewtopic.php?f=6&t=22302&p=118743&hilit=loadfrommemory#p118743[/url:2wta3qq8]
En mi caso cambio el campo Nombre por Image y de esta forma consigo tener un browse de las imagenes y el ampliado correspondiente de la imagen seleccionada.
[url=http://imageshack.us/photo/my-images/233/wonders.png/:2wta3qq8][img:2wta3qq8]http://img233.imageshack.us/img233/8485/wonders.th.png[/img:2wta3qq8][/url:2wta3qq8]
Uploaded with [url=http://imageshack.us:2wta3qq8]ImageShack.us[/url:2wta3qq8]
Lo que quiero conseguir es que el browse de las imágenes me las centre o me las ajuste a la celda. ¿Cómo? Me refiero al conjunto total de las imágenes que está en la parte izquierda, el control browse. Ahora si muevo el Splitter me deja siempre la imagen en la izquierda o si amplio el alto de la celda. Quiero conseguir que o bien se centre en la celda o se ajuste. Para ver un ejemplo pongan en la sección de samples ../fwh/samples/wwonders.prg y añadan el siguiente código.
[code=fw:2wta3qq8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Testing FiveWin splitter controls</span><br /><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;">"Splitter.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #00C800;">static</span> oBrw, oImage<br /><br /><span style="color: #00C800;">static</span> oSplit<br /><br />REQUEST DBFCDX<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> cTitle := <span style="color: #ff0000;">"Testing the Splitter controls with image and xBrowse"</span><br /> <span style="color: #00C800;">local</span> cBar<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">MENU</span> BuildMEnu<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">TITLE</span> cTitle<br /><br /> <span style="color: #0000ff;">SELECT</span> <span style="color: #000000;">1</span><br /> USE WWONDERS VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">65</span>,<span style="color: #000000;">65</span> <span style="color: #0000ff;">OF</span> oWnd<span style="color: #B900B9;">//_3d</span><br /> oBar:<span style="color: #000000;">l2007</span>:=.t.<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\R</span>es<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\O</span>pen.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Abrir"</span>;<br /> TOOLTIP <span style="color: #ff0000;">"Abrir esistente"</span>;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> FWVERSION <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Abrir un fichero de imagen..."</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\R</span>es<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\S</span>ave.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Guardar"</span>;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> FWVERSION <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Abrir un fichero de imagen..."</span><br /><br /> <span style="color: #0000ff;">MENU</span> oPopup <span style="color: #0000ff;">POPUP</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Test"</span> <span style="color: #0000ff;">WHEN</span> .f.<br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Test"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Any action"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Another"</span> <span style="color: #0000ff;">WHEN</span> .f.<br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"More..."</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /><br /><br /> @ <span style="color: #000000;">65</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">140</span>,oWnd:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd;<br /> COLUMNS <span style="color: #ff0000;">"IMAGE"</span> COLSIZES <span style="color: #000000;">10</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"WWONDERS"</span> CELL LINES NOBORDER<br /><br /><br /> @ <span style="color: #000000;">65</span>,<span style="color: #000000;">145</span> <span style="color: #0000ff;">IMAGE</span> oImage <span style="color: #0000ff;">SIZE</span> oWnd:<span style="color: #000000;">nWidth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oWnd:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ADJUST</span><br /> oImage:<span style="color: #000000;">LoadFromMemory</span><span style="color: #000000;">(</span> WWONDERS->IMAGE <span style="color: #000000;">)</span><br /><br /> WITH OBJECT oBrw<br /> :<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;">nDataBmpAlign</span> := AL_CENTER <span style="color: #B900B9;">//Centra la imagen (Thanks Mr. Rao)</span><br /> :<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;">nHeadStrAlign</span> := AL_CENTER <span style="color: #B900B9;">//Centra la cabecera (Thanks Mr. Rao)</span><br /> :<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;">lBmpStretch</span> := .t. <span style="color: #B900B9;">//Ajusta a la celda (Thanks Mr. Rao)</span><br /> :<span style="color: #000000;">lRecordSelector</span> := .f.<br /> :<span style="color: #000000;">nStretchCol</span> := <span style="color: #000000;">1</span><br /> :<span style="color: #000000;">lHScroll</span> := .f.<br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oImage:<span style="color: #000000;">LoadFromMemory</span><span style="color: #000000;">(</span> WWONDERS->IMAGE <span style="color: #000000;">)</span>, oImage:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</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: #000000;">65</span>, <span style="color: #000000;">140</span> SPLITTER oSplit ;<br /> <span style="color: #0000ff;">VERTICAL</span> ;<br /> PREVIOUS CONTROLS oBrw ;<br /> HINDS CONTROLS oImage ;<br /> <span style="color: #0000ff;">LEFT</span> MARGIN <span style="color: #000000;">120</span> ;<br /> <span style="color: #0000ff;">RIGHT</span> MARGIN <span style="color: #000000;">440</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">4</span>, oWnd:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">OF</span> oWnd ;<br /> _3DLOOK ;<br /> <span style="color: #0000ff;">UPDATE</span><br /><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span>;<br /> <span style="color: #0000ff;">ON</span> RESIZE oSplit:<span style="color: #000000;">AdjRight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />procedure AppSys <span style="color: #B900B9;">// XBase++ requirement</span><br /><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oMenu<br /><br /> <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #000000;">2007</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Archivo"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Nuevo"</span> + Chr<span style="color: #000000;">(</span><span style="color: #000000;">9</span><span style="color: #000000;">)</span>+ <span style="color: #ff0000;">"Ctrl-N"</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Nuevo fichero en blanco"</span> ;<br /> FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\R</span>es<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\N</span>ew.bmp"</span>;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"any action"</span> <span style="color: #000000;">)</span> ;<br /> ACCELERATOR <span style="color: #000000;">0</span>, VK_F2<br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Abrir"</span> + Chr<span style="color: #000000;">(</span><span style="color: #000000;">9</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"Ctrl-O"</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Abrir fichero existente"</span>;<br /> FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\R</span>es<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\O</span>pen.bmp"</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Guarda"</span> + Chr<span style="color: #000000;">(</span><span style="color: #000000;">9</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"Ctrl-S"</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Abrir fichero existente"</span>;<br /> FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\R</span>es<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\S</span>ave.bmp"</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Guardar como"</span> + Chr<span style="color: #000000;">(</span><span style="color: #000000;">9</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"Shift+Ctrl-S"</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Abrir fichero existente"</span>;<br /> FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\R</span>es<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\S</span>aveas.bmp"</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Cerrar"</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Abrir fichero existente"</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /><br /><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Salir"</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Abandonar el programa"</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oMenu</div>[/code:2wta3qq8]
¿A alguien se le ocurre como hacer zoom al control oImage? necesito poder ampliar y reducir la foto seleccionada. |
xBrowse ayuda | ¿Como centro la cabecera del browse? Donde pone IMAGE necesito que esté centrado. |
xBrowse ayuda | To center the image in the browse cell:
[code=fw:1jt3c2u0]<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;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER</div>[/code:1jt3c2u0]
To center the heading:
[code=fw:1jt3c2u0]<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;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER</div>[/code:1jt3c2u0] |
xBrowse ayuda | Gracias RAO, funciona perfecto.
Más cosas: ¿Como hago para poder mover los registros de posición? En mi caso lo único que quiero hacer en mover una imagen de posición. No sé si tengo que realizar ese movimiento en la base de datos o el xBrowse te posibilita esta acción. ¿Alguna sugerencia? |
xBrowse ayuda | Mr. RAO. is possible ADJUST the BMP to the cell? How? |
xBrowse ayuda | [quote="Andrés González":hp2zrno5]Mr. RAO. is possible ADJUST the BMP to the cell? How?[/quote:hp2zrno5]
oCol:lBmpStretch := .t.
Stretches the image to fit full size of the cell both height and width. |
xBrowse ayuda | Andrés,
Enviada la clave a tu email <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Cualquier ayuda en el wiki se agradece mucho <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
xBrowse ayuda | Gracias Antonio, de todas formas después de revisar el wiki me he dado cuenta que hay más información del xBrowse como txbrowse. Poco a poco vamos haciendo una buena documentación. |
xBrowse ayuda | Más cosas, cómo hago para:
¿Mover registros de posición? Ejemplo pasar la imagen 4 a la 2
¿Marcar varios registros en el browse? Ejemplo marcar los la imagen 3, 4 y 6. Mi intención es luego mandarlas por correo. |
xBrowse ayuda | Ya he visto como se hace el marcar multiples líneas del browse:
[url:3ngnexoj]http://forums.fivetechsupport.com/viewtopic.php?f=3&t=20177&p=106755&hilit=multiple+select#p106755[/url:3ngnexoj]
[code=fw:3ngnexoj]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">nMarqueeStyle</span> = MARQSTYLE_HIGHLROWMS</div>[/code:3ngnexoj]
La cosa va quedando mas clara:
[url=http://imageshack.us/photo/my-images/847/wonders.png/:3ngnexoj][img:3ngnexoj]http://img847.imageshack.us/img847/8485/wonders.png[/img:3ngnexoj][/url:3ngnexoj]
Uploaded with [url=http://imageshack.us:3ngnexoj]ImageShack.us[/url:3ngnexoj]
Le he quitado el ADJUST en el control oImage, hay forma de que se centre en el control en vez de que me aparezca en la parte superior izquierda del control. ¿Cómo? |
xBrowse ayuda | Alguien sabe si es posible meter las imágenes en una array, o sea, una imagen en cada celda para luego poder mostrarlas del mismo modo que se hace en el ejemplo anterior. Quiero hacer algo similar a lo que se hace con el campo MEMO pero para no tener que crear el fichero cada vez, me pregunto si es posible hacerlo en memoria mediante el array. Existe algún inconveniente? Mi idea es pasas unos ficheros multipágina (*.TIF) al array para construir un visor, de ficheros .TIF. Para intentar hacer un ejemplo he cogido una cosa muy simple pero no funciona, leo dos fotos directamente en dos celdas del array, pero se queda colgado. ¿Alguien sabe si es un problema del array?.
[code=fw:21bjjn5c]<div class="fw" id="{CB}" style="font-family: monospace;">unction <span style="color: #00C800;">Edit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBar, oTiffEdit, cTiff := <span style="color: #ff0000;">"Prueba"</span><br /> <span style="color: #00C800;">local</span> aArray := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <br /> <br /><br /> AADD<span style="color: #000000;">(</span>aArray, MEMOREAD<span style="color: #000000;">(</span><span style="color: #ff0000;">"..<span style="color: #000000;">\J</span>PG<span style="color: #000000;">\F</span>1.JPG"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aArray, MEMOREAD<span style="color: #000000;">(</span><span style="color: #ff0000;">"..<span style="color: #000000;">\J</span>PG<span style="color: #000000;">\F</span>2.JPG"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">msgInfo</span><span style="color: #000000;">(</span>len<span style="color: #000000;">(</span>aArray<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//Muestra que hay dos registros.</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oTiffEdit ;<br /> <span style="color: #0000ff;">TITLE</span> cTiff ;<br /> <span style="color: #0000ff;">MDICHILD</span> <br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">65</span>,<span style="color: #000000;">65</span> <span style="color: #0000ff;">OF</span> oTiffEdit<span style="color: #B900B9;">//_3d</span><br /> oBar:<span style="color: #000000;">l2007</span>:=.t.<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\R</span>es<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\E</span>xit.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Salir"</span>;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>oTiffEdit:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Salir..."</span><br /> <br /> <br /> @ <span style="color: #000000;">65</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br /> ARRAY aArray ;<br /> HEADERS <span style="color: #ff0000;">"IMAGENES"</span>;<br /> COLSIZES <span style="color: #000000;">10</span> ;<br /> CELL LINES NOBORDER;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">140</span>,oTiffEdit:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oTiffEdit;<br /> <br /><br /><br /> @ <span style="color: #000000;">65</span>,<span style="color: #000000;">145</span> <span style="color: #0000ff;">IMAGE</span> oImage <span style="color: #0000ff;">SIZE</span> oTiffEdit:<span style="color: #000000;">nWidth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oTiffEdit:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oTiffEdit NOBORDER<br /> <br /> <span style="color: #B900B9;">/*<br /> oImage:LoadFromMemory( WWONDERS->IMAGE )//Leo el registro activo<br /> <br /> ImgAdjust(oImage) <br />*/</span><br /> WITH OBJECT oBrw<br /> :<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;">nDataBmpAlign</span> := AL_CENTER <span style="color: #B900B9;">//Centra el bmp en la celda</span><br /> :<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;">nHeadStrAlign</span> := AL_CENTER <span style="color: #B900B9;">//Centra el texto de cabecera</span><br /> :<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;">lBmpStretch</span> := .t. <span style="color: #B900B9;">//Justifica el bmp en la celda</span><br /> :<span style="color: #000000;">nMarqueeStyle</span> = MARQSTYLE_HIGHLROWMS <span style="color: #B900B9;">//Marca multiples líneas.</span><br /> :<span style="color: #000000;">lRecordSelector</span> := .f.<br /> :<span style="color: #000000;">nStretchCol</span> := <span style="color: #000000;">1</span><br /> :<span style="color: #000000;">lHScroll</span> := .f.<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /> <span style="color: #B900B9;">// :bChange := { || oImage:LoadFromMemory( WWONDERS->IMAGE ), oImage:Refresh() }</span><br /><br /><br /> @ <span style="color: #000000;">65</span>, <span style="color: #000000;">140</span> SPLITTER oSplit ;<br /> <span style="color: #0000ff;">VERTICAL</span> ;<br /> PREVIOUS CONTROLS oBrw ;<br /> HINDS CONTROLS oImage ;<br /> <span style="color: #0000ff;">LEFT</span> MARGIN <span style="color: #000000;">120</span> ;<br /> <span style="color: #0000ff;">RIGHT</span> MARGIN <span style="color: #000000;">440</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">4</span>, oTiffEdit:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">OF</span> oTiffEdit ;<br /> _3DLOOK ;<br /> <span style="color: #0000ff;">UPDATE</span><br /><br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oTiffEdit <span style="color: #0000ff;">MAXIMIZED</span>;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ON</span> RESIZE oSplit:<span style="color: #000000;">AdjRight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:21bjjn5c] |
xBrowse bLClickHeader | Hi all,
I have an issue when double clicking an xBrowse header.
If I run the program below the codeblock bLClickHeader is executeted on start of the dialog. ( no click at all )
But when I click the header the codeblock is not fired.
What could be wrong?
regards, Detlef
[code=fw:3qczqf03]<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;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//-------------</span><br /><span style="color: #00C800;">LOCAL</span> oBrw, oDlg<br /><span style="color: #00C800;">LOCAL</span> aData := <span style="color: #000000;">{</span>;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 1-1"</span>, <span style="color: #ff0000;">"line 1-2"</span>, <span style="color: #ff0000;">"line 1-3"</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 2-1"</span>, <span style="color: #ff0000;">"line 2-2"</span>, <span style="color: #ff0000;">"line 2-3"</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 3-1"</span>, <span style="color: #ff0000;">"line 3-2"</span>, <span style="color: #ff0000;">"line 3-3"</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 4-1"</span>, <span style="color: #ff0000;">"line 4-2"</span>, <span style="color: #ff0000;">"line 4-3"</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 5-1"</span>, <span style="color: #ff0000;">"line 5-2"</span>, <span style="color: #ff0000;">"line 5-3"</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 6-1"</span>, <span style="color: #ff0000;">"line 6-2"</span>, <span style="color: #ff0000;">"line 6-3"</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 7-1"</span>, <span style="color: #ff0000;">"line 7-2"</span>, <span style="color: #ff0000;">"line 7-3"</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 8-1"</span>, <span style="color: #ff0000;">"line 8-2"</span>, <span style="color: #ff0000;">"line 8-3"</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"line 9-1"</span>, <span style="color: #ff0000;">"line 9-2"</span>, <span style="color: #ff0000;">"line 9-3"</span> <span style="color: #000000;">}</span> ;<br /> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">2</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">18</span>, <span style="color: #000000;">62</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dialog for Test"</span><br /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br /> HEADERS <span style="color: #ff0000;">"Elem 1"</span>, <span style="color: #ff0000;">"Elem 2"</span>, <span style="color: #ff0000;">"Elem 3"</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">220</span>, <span style="color: #000000;">100</span> ;<br /> COLSIZES <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span> ;<br /> ARRAY aData <span style="color: #0000ff;">AUTOCOLS</span><br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cSortOrder</span> := <span style="color: #00C800;">NIL</span><br /> :<span style="color: #000000;">cOrder</span> := <span style="color: #00C800;">NIL</span><br /> :<span style="color: #000000;">bLClickHeader</span> := <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nArrayAt</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;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">(</span> oDlg:<span style="color: #0000ff;">center</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3qczqf03] |
xBrowse bLClickHeader | Try
[code=fw:3jg5wtt0]<div class="fw" id="{CB}" style="font-family: monospace;"> :<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">{</span> || <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:3jg5wtt0] |
xBrowse bLClickHeader | Yes, Francisco... that's working fine now!
Many thanks.
After so many years without FWH coding I make a lot of silly mistakes, sorry.
Detlef |
xBrowse bLClickHeader | Do not worry.
We are here to help each other.
Regards. |
xBrowse bPopup does not run when browse is empty. (SOLVED) | Hi,
I use oBrw:bPopup to declare popup screen in xbrowse. If the browse is not empty there is not any problem. Popup shows.
But I have an empty xbrowse and want to show popup for "Paste" option.
How can I do it? |
xBrowse bPopup does not run when browse is empty. (SOLVED) | any solution?? |
xBrowse bPopup does not run when browse is empty. (SOLVED) | <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: --> |
xBrowse bPopup does not run when browse is empty. (SOLVED) | In the present implementation, oBrw:bPopUp is designed to refer to an active cell, i.e., active row and selected column. So this does not work when there are no rows.
If you want a PopUP menu that does not refer to any specific row, then you may implement by displaying a popup with oBrw:bRClicked. |
xBrowse bPopup does not run when browse is empty. (SOLVED) | Thank you Mr. Rao,
I is ok now. |
xBrowse bValid | Dear friends,
i'm still busy to learn all aspects of the xBrowse class and found a new problem.
To see how a valid clause may be used with a xBrowse cell edit I built the sample mallorca.
In this example the valid block gives a message if the entered value is bigger than 6 and returns false.
But after showing the message a wrong value is assigned to the cell.
Is there an other way to get a valid clause working as expected?
Regards,
Detlef |
xBrowse bValid | Detlef,
If you comment out this line in mallorca.prg:
[code:iia4xhk6]
IF nVal>6
// MsgAlert('No puede ser mayor que 6')
lValRet:=.f.
ENDIF
[/code:iia4xhk6]
then it works fine. The problem is that the MsgAlert() causes the GET to loose the focus and then its current value its assigned
We should find a way to accept Msg...() (or similar) calls. |
xBrowse bValid | Antonio,
thanks for your advice. But it still doesn't work for me.
I removed the MsgAlert so that the validating function returns .f. for values > 6 and .t. for all others.
But the example mallorca shows a very strange editing/validating of TxBrowse.
Example:
i enter a '7' and press return.
Nothing happens, the 7 is shown but not accepted. This is ok.
But when now pressing Esc, the 7 is accepted and i can move to an other cell.
I now go back to the cell with the 7 and enter a '2' and press return.
The 2 disappears, the 7 shows up again and after leaving the cell, the 2 is properly displayed.
This is a very confusing kind of editing.
Perhaps its only on my environment or can someone confirm this behaviour?
Thanks and regards,
Detlef |
xBrowse bValid | Dear friends,
is there no one who could confirm or try this strange validating of xBrowse?
I'd be glad for any statement.
Regards,
Detlef |
xBrowse bValid | Detlef,
In mallorca.prg sample, this line seems not to be needed:
oBrw:aCols[1]:bOnPostEdit := {|o,x| aLin[ oBrw:nArrayAt,1] := x }
as such assignment should be done by the GET itself |
xBrowse bValid | Antonio,
sorry, but it still doesn't work.
If i remove the line
[code:1wr69vbv]oBrw:aCols[1]:bOnPostEdit := {|o,x| aLin[ oBrw:nArrayAt,1] := x }[/code:1wr69vbv]
the program complains at runtime that onPostEdit is not defined.
If i set it to NIL, i can not enter new values because they are not assigned.
Regards,
Detlef |
xBrowse bValid | Detlef,
I didn't meant to remove it. My point is that it does not seems to be the right code |
xBrowse bValid | Antonio,
i know, you didn't say to remove this line.
But you said [quote:fj4r35d0]... as such assignment should be done by the GET itself[/quote:fj4r35d0]
But the get doesn't assign the value as expected. <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
Regards,
Detlef |
xBrowse bValid | Hello Detlef,
Do these changes in xbrowse.prg and see functions correctly. Case does not function an example citing problem sends me.
[code:3w3vlcjm]
METHOD PostEdit( xValue, lButton ) CLASS TXBrwColumn
local lGoNext := .f.
If ::lOnPostEdit
return nil
Endif
::lOnPostEdit := .t.
DEFAULT lButton := .f.
if !getkeystate( VK_ESCAPE )
if ::oEditGet != nil && By Rossine 09/06/07
if valtype( ::oEditGet ) = "O" .and. ::oEditGet:bValid != NIL
if !Eval( ::bEditValid, ::oEditGet )
Eval( ::bOnPostEdit, Self, ::oEditTmp )
::oEditGet:varput(::oEditTmp)
::oEditGet:refresh()
::lOnPostEdit := .f.
return .F.
endif
endif
elseif ::oEditLbx != nil && By Rossine 09/06/07
if valtype( ::oEditLbx ) = "O" .and. ::oEditLbx:bValid != NIL
if !Eval( ::bEditValid, ::oEditLbx )
Eval( ::bOnPostEdit, Self, ::oEditTmp )
::oEditLbx:varput(::oEditTmp)
::oEditLbx:refresh()
::lOnPostEdit := .f.
return .F.
endif
endif
endif
endif
[/code:3w3vlcjm]
Regards,
Rossine. |
xBrowse bValid | Hello Rossine,
thanks a lot for your advice.
Now invalid entries combined with Esc key are properly processed.
But unfortunately i can't input valid values.
The sample i'm speaking about is mallorca.prg in the samples folder of FWH.
My intention was to find a replacement for Manuel Mercado's TsBrowse because it has some strange behaviours.
But now i see that xBrowse isn' much more mature <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> .
Anyhow thanks again for your help.
I think i'll try Hernan's TwBrowse instead.
Regards,
Detlef |
xBrowse background color problem | I am reviewing a xBrowse sample (FW\samples\xbrwin7.prg) and I would like to change the background color of the browse to white (it is light gray in the sample). The xBrowse BACKGROUND clause is just defined as a blank string in the example.
@ 10, 10 XBROWSE oBrw...BACKGROUND ""
I have tried BACKGROUND CLR_WHITE and it does not change the color.
I have also tried oBrw:setColor(, CLR_WHITE) (without the BACKGROUND clause) and the background is white, but the previously highlighted record is not redrawn properly when the arrow keys are used to move the current record. And there is also a delayed redraw when the mouse is used to select a new record.
There is no documentation for the BACKGROUND clause in the FW Wiki so I am not sure how to use it.
Does anyone have any ideas?
I am using FWH 10.8 with xHarbour.
Regards,
James |
xBrowse background color problem | Hello James,
BACKGROUND is used usual for Brushes like :
1.
[color=#0040FF:2oeljys3]local aGrad := { { 0.5, RGB( 140, 56, 6 ), RGB( 237, 234, 109 ) }, ;
{ 0.5, RGB( 237, 234, 109 ), RGB( 85, 62, 84 ) } }
@ 10, 10 XBROWSE oBrw OF oDlg BACKGROUND aGrad VERTICAL[/color:2oeljys3]
2.
[color=#0040FF:2oeljys3]@ 10, 10 XBROWSE oBrw OF oDlg BACKGROUND "..\bitmaps\Cartoon.bmp" BCK_TILED[/color:2oeljys3]
// ACTION oBrw:SetBackGround() // Clear
// ACTION oBrw:SetBackGround( nil, BCK_TILED )
// ACTION oBrw:SetBackGround( nil, BCK_STRETCH )
// ACTION oBrw:SetBackGround( nil, BCK_FILL )
But You can use BACKGROUND for a Color as well, just define a Gradient with 2 same Colors
@ 10, 10 XBROWSE oBrw OF oDlg BACKGROUND [color=#FF0000:2oeljys3]{{ 1, 16777215, 16777215 }} [/color:2oeljys3]// White
[img:2oeljys3]http://www.pflegeplus.com/pictures/xbrow1.jpg[/img:2oeljys3]
Best Regard and MERRY CHRISTMAS to You and Your family
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse background color problem | Uwe,
OK, that does it. Thanks.
Looking at the setBackground() method I see that it gets complicated as it will accept an array, character, number or object. Do you have any examples of using the other parameters?
Antonio, I notice the use of the CARGO var in this method. Isn't CARGO supposed to be reserved for programmer use? Wouldn't it be better to create a new DATA element instead of using CARGO within the browse class?
Regards,
James |
xBrowse background color problem | Mr. James
As you already observed, the BACKGROUND clause in turn calls the SetBackGround method with two parameters uBackGround and nBackgroundMode.
uBackGround can be character, array, numeric or object.
Character:
Can be name of an image file on the disk. ( bmp or any image ) or a resource name.
Array:
Valid Gradient Array
Numeric:
Valid bitmap handle
Object:
Valid bitmap or brush object.
It is easier to specify the background mode in command style as "TILED (default)", "STRETCH" or "FILL" for images ( imagefile name, bitmap handle or object) or as "VERTICAL (default)" or "HORIZONTAL" for Gradients.
The setbackground method does not use Cargo of XBrowse. Cargo is totally left for the programmers' use. What this method uses is the Cargo of its internal brush object. This usages does not disturb any of the programmers' objects.
Even if we specify a brush object as the background, XBrowse does not use the same brush object. XBrowse creates its own brush with a clone of the bitmap handle of the brush. The reason is we may create a brush and use it for various controls. The brush inside the xbrowse is susceptible for resizing. The intention of cloning the brush is not to affect our brush object with the changes/resizing that happens within the xbrowse. For this reason, usage of cargo of its own brush object by xbrowse does not in any way affect the brush objects defined in the application program.
It would have been of much help if all this documentation is made available in the Wiki. |
xBrowse background color problem | Rao,
Thanks for the detailed explaination. It was very helpful.
Any ideas on redrawing the bitmap so the original background doesn't show? It seems it would be helpful if this type of highlight bar was a built-in option of the xbrowse class (and that it could automatically handle bitmaps too). If we can figure out how to fix the bitmap, then perhaps we can make this suggestion to Antonio.
Regards,
James |
xBrowse background color problem | [quote="James Bott":5it75xpk]Rao,
Thanks for the detailed explaination. It was very helpful.
Any ideas on redrawing the bitmap so the original background doesn't show? It seems it would be helpful if this type of highlight bar was a built-in option of the xbrowse class (and that it could automatically handle bitmaps too). If we can figure out how to fix the bitmap, then perhaps we can make this suggestion to Antonio.
Regards,
James[/quote:5it75xpk]
The logic that was originally suggested for win7 bar is not suitable for drawing bitmaps over it. Soon we may expect FWH to natively provide this in Xbrowse. |
xBrowse background color problem | Please see the topic
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=20570">viewtopic.php?f=3&t=20570</a><!-- l --> |
xBrowse bar question | Can i switch off the selecting-bar for one ore more columns? |
xBrowse bar question | Yes
Assign same value to both oCol:bClrStd and oCol:bClrSelFocus
[code=fw:3scu4909]<div class="fw" id="{CB}" style="font-family: monospace;">oCol:<span style="color: #000000;">bClrStd</span> := oCol:<span style="color: #000000;">bClrSelFocus</span> := oBrw:<span style="color: #000000;">bClrStd</span></div>[/code:3scu4909]
if you do not set nMarqueeStyle to one of the HIGLROW?? styles. |
xBrowse bar question | THANKS! |
xBrowse blank column showing | I have a strange problem with xBrowse and only with this instance. The code below ends up with a blank column being added before the Code column, and in the first row below the header is has TDIALOG. If I right click on the header I see a checkmark by a blank line above the other column titles. If I uncheck it, the column goes away.
[b:1m4lpawc]So far, I haven't seen this elsewhere. Any ideas ?[/b:1m4lpawc] Thank you.
// Create the browse control for the parts list
REDEFINE XBROWSE oLbp2 ID 1010 oDgp ON CHANGE (... ) UPDATE
// Set to the database object
oLbp2:setoDBF( oGlp )
add to oLbp2 header "Code" data oGlp:pckcod ALIGN LEFT size 120
add to oLbp2 Header "Partnumber" data oGlp:pcknum ALIGN LEFT size 200
add to oLbp2 header "Description" data oGlp:pckdes ALIGN LEFT size 250
add to oLbp2 header "Quantity" data oGlp:pckqun ALIGN RIGHT size 120 |
xBrowse blank column showing | Please insert " OF " between "1010" and "oDbp" in the line "REDEFINE ... etc "
REDEFINE XBROWSE oLbp2 ID 1010 [color=#FF0000:1b70ky47][b:1b70ky47]OF[/b:1b70ky47][/color:1b70ky47] oDgp ON CHANGE (... ) UPDATE |
xBrowse blank column showing | Thanks. I AM getting old ... l looked at that many times and skipped right by it. Perhaps it was because I was thinking columns !
Is there an option to center headers ( horizontal ) while aligning the data left or right ? |
xBrowse blank column showing | Tim:
Try this way
[code=fw:2sqeoeb9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />oCol:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />oCol:<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT<br /> </div>[/code:2sqeoeb9]
Regards |
xBrowse blcklicked | Hi,
I have a problem...I run xBrowsw, open my database table from MySql ... and my search has 50 lines. The first thing you see are rows 1 to 30 and when I click the left mouse for example 30 row, all move to the top so I was the first to see the 30 row and 31,32,33 ... How do you like that does not happen? So, I want that when I click the left mouse to mark a row and nothing more ...
Thanks a lot |
xBrowse blcklicked | Hi nebojsa, I see it's your first post. Welcome to FiveTech's forums support.
I have some mysql-fwh software and I have not noticed that behavior. You may be able to post your code for help you?
Regards. |
xBrowse blcklicked | REDEFINE xBrowse oBrw ID 101 OF oDlgBrows ALIAS 'Trz'
oBrw:nFreeze := 2
oBrw:nRowDividerStyle = LINESTYLE_NOLINES
oBrw:nColDividerStyle := 2
oBrw:nMarqueeStyle := 4
oCol := oBrw:AddCol()
oCol:bStrData := { || str(RB)}
oCol:cHeader := "RB"
oCol:nDataStrAlign := AL_CENTER
oCol:nHeadStrAlign := AL_CENTER
oCol := oBrw:AddCol()
oCol:bStrData := { || TRZ->POZICIJA}
oCol:cHeader := "POZICIJA"
oCol:nHeadStrAlign := AL_CENTER
oCol := oBrw:AddCol()
oCol:bStrData := { || TRZ->REFERENT}
oCol:cHeader := "REF."
oCol:nDataStrAlign := AL_CENTER
oCol:nWidth :=30
oCol := oBrw:AddCol()
oCol:bStrData := { || dtoc(DATUM)}
oCol:cHeader := "DATUM"
oCol:nDataStrAlign := AL_CENTER
oCol:nHeadStrAlign := AL_CENTER
oCol := oBrw:AddCol()
oCol:bStrData := { || TRZ->UVOZNIK}
oCol:cHeader := "UVOZNIK"
oCol:nWidth :=120
oCol:nHeadStrAlign := AL_CENTER
oCol := oBrw:AddCol()
oCol:bStrData := { || TRZ->PROIZVODJ}
oCol:cHeader := "PROIZVO?A?"
oCol:nWidth :=200
oCol:nHeadStrAlign := AL_CENTER
oCol := oBrw:AddCol()
oCol:bStrData := { || TRZ->MESTO5}
oCol:cHeader := "MESTO"
oCol:nDataStrAlign := AL_CENTER
oCol:nWidth :=100
oCol:nHeadStrAlign := AL_CENTER
oCol := oBrw:AddCol()
oCol:bStrData := { || TRZ->NAZPROIZ1}
oCol:cHeader := "NAZIV PROIZVODA"
oCol:nWidth :=350
oBrw:nStretchCol := STRETCHCOL_WIDEST
* oBrw:bLClicked = { | | TraPre(TRZ->RB) }
* oBrw:CreateFromCode()
oFont:End()
oBrw:bLDblClick = { | nRow, nCol | TraPre(TRZ->RB),oDlgBrows:End() }
oBrw:bKeyChar = { | nKey, nFlags | if( nKey==VK_RETURN,(TraPre(TRZ->RB),oDlgBrows:End()),NIL) } |
xBrowse blcklicked | When I click some row in middle, that row go to top, but I want only mark that row...
I want send you a picture to see you how that work but I dont now how... |
xBrowse blcklicked | I see no problem in your code. Maybe you want to display the code of the function TraPre ()?
Meanwhile, I leave these parts of code I use. I hope you serve as an example.
oLbx := TXBrowse():New( oDlg )
oLbx:SetMySql(oCatalogo,.f.)
oCol = oLbx:AddCol()
oCol:bEditValue = { || oCatalogo:Codicont }
oCol:cHeader = "Codigo Contable"
oCol:nWidth = 164
oCol = oLbx:AddCol()
oCol:bEditValue = { || oCatalogo:Nombre }
oCol:nDataStrAlign := 3
oCol:cHeader = "Nombre de la Cuenta"
oCol:nWidth = 350
oLbx:CreateFromResource(181)
oLbx:bLDblClick:={|| if(lGrabacion, (cCodic:=oCatalogo:Codicont, if(oCatalogo:nv="S",oDlg:End(),(cCodic:="",MsgStop("Codigo incompleto","Alto")) )),) }
ACTIVATE DIALOG oDlg CENTERED
oCatalogo:End() |
xBrowse blcklicked | It's nothing help...I tried to run the DBF database and so we work normally ... but when I run the SQL database is not working properly ... I do not know why!
function TraPre(cmm)
DBSelectArea("Trz")
OrdSetFocus("TRZISNO")
oNazPar :Refresh()
if mRat>0
mTxt2=""
mTxt3=""
oTxt3 :refresh()
oTxt4 :refresh()
endif
iNovi=.f.
mRB =Trz->RB
mPoz =Trz->POZICIJA
mRadJed_Id =Trz->RADJED
mRef_Id =Trz->REFERENT
mDat =Trz->DATUM
mJCI =Trz->JCI
mbr =Trz->BR
mPrelaz =Trz->PRELAZ
mNazProiz1 =Trz->NAZPROIZ1
mNazProiz2 =Trz->NAZPROIZ2
mBtto =Trz->BRUTO
mNeto =Trz->NETO
mBrOmo =Trz->BROMOTA
mPakovanje =Trz->PAKOVANJE
mPartner_Id =Trz->Partner_Id
*mNazPar =Trz->UVOZNIK
mKORISNIK =Trz->KORISNIK
mKorAdresa =Trz->ADRESA7
mKorMesto =Trz->MESTO7
mKorTelefon =Trz->TELEFON7
mKorMaticni =Trz->MATICNI7
mKorPIB =Trz->PIB7
mPROIZVODJAC =Trz->PROIZVODJ
mProMesto =Trz->MESTO5
mProDrzava =Trz->DRZAVA5
mDOBAVLJAC =Trz->INODOBAVLJ
mDobMesto =Trz->MESTO6
mDobDrzava =Trz->DRZAVA6
mStanica =Trz->STANICA
mPoreklo =Trz->POREKLO
mUtovarGrad =Trz->MESTUTOGRA
mUtovarDrzava =Trz->MESTUTODRZ
mIzvoznica =Trz->IZVOZNICA
mPrevozVrsta =Trz->VRSTA
mPrevozBroj =Trz->BROJ
mSmestajNaziv =Trz->SMESTAJ
mSmestajAdresa =Trz->ADRESA13
mSmestajGrad =Trz->MESTO13
mSmestajTelefon =Trz->TELEFON13
mVrednost =Trz->VREDNOST
mValuta =Trz->VALUTA
mRat =Trz->RAT
mGotovinski =Trz->GOTOVIN
mTxt2 =space(20)
if mRat>0
* MsgInfo("POSTOJE TAKSE !!!")
mTxt2="TAKSIRANO!!!"
mTxt3="Ako radite NOVI predmet kliknite na KOPIRAJ!!!"
oTxt3 :refresh()
oTxt4 :refresh()
endif
if mGotovinski>0
* MsgInfo("POSTOJE TAKSE !!!")
mTxt2="TAKSIRANO!!!"
mTxt3="Ako radite NOVI predmet kliknite na KOPIRAJ!!!"
oTxt3 :refresh()
oTxt4 :refresh()
endif
mRef_Id =space(3)
mNazRef =space(40)
mNazJed =space(30)
mNazPar =space(30)
oRB :refresh()
oPoz :refresh()
oRef_Id :refresh()
oRadJed_Id :refresh()
oDat :refresh()
oSifCar :refresh()
oBroj :refresh()
oCIULAZ :refresh()
oNazPos1 :refresh()
oNazPos2 :refresh()
oBtto :refresh()
oNeto :refresh()
oBrOmo :refresh()
oPakovanje :refresh()
oPartner_Id :refresh()
oNazPar :refresh()
oKORISNIK :refresh()
oKorAdresa :refresh()
oKorMesto :refresh()
oKorTelefon :refresh()
oKorMaticni :refresh()
oKorPIB :refresh()
oPROIZVODJAC :refresh()
oProMesto :refresh()
oProDrzava :refresh()
oDOBAVLJAC :refresh()
oDobMesto :refresh()
oDobDrzava :refresh()
oStanica :refresh()
oPoreklo :refresh()
oUtovarGrad :refresh()
oUtovarDrzava :refresh()
oIzvoznica :refresh()
oPrevozVrsta :refresh()
oPrevozBroj :refresh()
oSmestajNaziv :refresh()
oSmestajAdresa :refresh()
oSmestajGrad :refresh()
oSmestajTelefon :refresh()
oVrednost :refresh()
oValuta :refresh()
oRat :refresh()
oGotovinski :refresh()
oRef_Id :refresh()
oNazRef :refresh()
oRadJed_Id :refresh()
oNazJed :refresh()
oTxt3 :refresh()
oPoz:SetFocus()
return .t. |
xBrowse blcklicked | Mr Nebojsa
Are you trying to use SQLRDD with xBrowse?
If so what is the version of FWH you are using? |
xBrowse blcklicked | Yes, I use SQLRDD but still dont work... FWH is 12.08 |
xBrowse blcklicked | XBrowse, by design, works with only such RDDs which support functions OrdKeyNo() and OrdKeyGoTo(x) also in addition to others.
Because SQLRDD does not support these two functions, (ordkeyno() returns 0 always) this RDD is not compatible with xBrowse. If xbrowse is used with SQLRDD, the behaviour is unpredictable.
But there are some users who are using xbrowse with sqlrdd in a limited way by tweaking xbrowse. You may search the forums for their postings.
TWBrowse and TCBrowse work with SQLRDD.
However, FWH is trying to provide limited support to SQLRDD from version 13.04 onwards. |
xBrowse bmpsort | Hi all, how can i reach that the little triangle is shown beside a header if i do the sorting with [b:2zc6boqf]oBrw:aCols[ n ]:bLClickHeader[/b:2zc6boqf].I can not use cSortOrder or autosort.Thanks and regards,Detlef |
xBrowse bmpsort | Detlef,Please review samples\TestXBr3.prg function RddBrwSelColsWin().If you use the @ ..., ... XBROWSE command then use AUTOSORT clause.Or if you call to SetRdd():SetRDD( lAddColumns, lAutoSort, aFldNames )Or you can modify a specific column:oCol:cSortOrder = ...indextag or oRs:fieldname or column number of array |
xBrowse bmpsort | Detlef,> I can not use cSortOrder or autosortwhy ? |
xBrowse bmpsort | Detlef, In method PaintHeader() you can see that oBrw:cOrder is checked to paint those arrows |
xBrowse bmpsort | Antonio,thanks for your advices.But using the codes from PaintHeader() is very complex.I do as the following:after clicking a column header i add a '*' to the header's text.I can not use cSortOrder because the sorting is done by values which are different from those who are displayed.Thanks anyhow,Detlef |
xBrowse buffer with Array | A DBF file has selected data records written in an array.
The dialog upper section has two folders. 1) has GET fields for the individual elements of the array 2) has a totals screen
The lower section has an xBrowse of the same array It displays below the folders on the dialog.
As the xBrowse is scrolled, the selected row has it's data displayed in the upper GET fields
If I edit a Get field, above, it will change the value displayed in the xbrowse also.
If I scroll the xbrowse, all seems fine
When I change to folder 2, and then come back to folder 1, the value I modified reverts to the original value when the xbrowse was created.
It would appear the buffer for the array may differ from that used for the xbrowse, Is there a command I can issue which will take the edited GET value and make sure it updates the value stored in the xBrowse buffer ? I suspect there is, and I just don't remember it.
Thanks. |
xBrowse buffer with Array | Must be programming error.
We can suggest correction if we see the source code |
xBrowse buffer with Array | It gets complicated ...
Creating the dialog with the folders and xbrowse:
[code=fw:2vg2hiw5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oSIdlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"STOCKINw"</span> <span style="color: #0000ff;">BRUSH</span> oBrush transparent <span style="color: #0000ff;">OF</span> oWnd <br /> <span style="color: #B900B9;">// Install two folders</span><br /> <span style="color: #0000ff;">REDEFINE</span> FOLDEREX oFldSI <span style="color: #0000ff;">ID</span> <span style="color: #000000;">800</span> <span style="color: #0000ff;">OF</span> oSIdlg <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Stocking Items"</span>, <span style="color: #ff0000;">"&Totals"</span> <span style="color: #0000ff;">DIALOGS</span> <span style="color: #ff0000;">"STOCKINaw"</span>, <span style="color: #ff0000;">"STOCKINbw"</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> oLbx1:<span style="color: #000000;">setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">ROUND</span> <span style="color: #000000;">5</span> TRANSPARENT <span style="color: #B900B9;">// ON CHANGE</span><br /><br /> <span style="color: #B900B9;">// Create the browse</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oLbx1 ;<br /> DATASOURCE oStkSrv:<span style="color: #000000;">aStkPar</span> ;<br /> HEADERS <span style="color: #ff0000;">" Part "</span>, <span style="color: #ff0000;">" Description "</span>, <span style="color: #ff0000;">" Ordered "</span>, <span style="color: #ff0000;">" Received "</span>, <span style="color: #ff0000;">" Cost "</span>, <span style="color: #ff0000;">" Workorder "</span>, <span style="color: #ff0000;">" "</span> ;<br /> COLUMNS <span style="color: #000000;">3</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">14</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">10</span>, <span style="color: #ff0000;">" "</span> ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">7802</span> <span style="color: #0000ff;">OF</span> oSIdlg ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span> oFldSI:<span style="color: #000000;">adialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">update</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span>, oLbx1:<span style="color: #000000;">setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">UPDATE</span> <br /><br /> <span style="color: #B900B9;">// Provide the header gradient</span><br /> oLbx1:<span style="color: #000000;">bClrGrad</span> := aPubGrad <br /> <span style="color: #B900B9;">// Set the styles</span><br /> oLbx1:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> oLbx1:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_RAISED<br /> oLbx1:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_RAISED<br /> oLbx1:<span style="color: #000000;">nHeadStrAligns</span> := AL_CENTER<br /> oLbx1:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br /><br /> </div>[/code:2vg2hiw5]
This field is used to store the value that is modified. It is in the dialog on folder 1
[code=fw:2vg2hiw5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oStkSrv:<span style="color: #000000;">aStkPar</span><span style="color: #000000;">[</span>oLbx1:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">12</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"$99,999.9999"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">823</span> <span style="color: #0000ff;">OF</span> oFldSI:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"The actual cost paid per item"</span> <span style="color: #0000ff;">UPDATE</span><br /> </div>[/code:2vg2hiw5]
This is a "Save" button which actually refreshes the display of the xbrowse with the new value.
[code=fw:2vg2hiw5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBarStk <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HRSAVE"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save"</span> TOOLTIP <span style="color: #ff0000;">"Save part"</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oLbx1:<span style="color: #0000ff;">update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ::<span style="color: #000000;">SumStock</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span>, oLbx1:<span style="color: #000000;">setfocus</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Save the data for the highlighted part"</span><br /> </div>[/code:2vg2hiw5]
[b:2vg2hiw5]Here is why it is complicated:[/b:2vg2hiw5]
oStkSrv is an object of the Purchase Order class
aStkPar is a DATA element of that class which contains the editable elements of the existing order. It is created from a DBF with just the records pertaining to the selected purchase order. After the editing is performed, then a separate method is used to save the array elements back to the database.
::SumStock is a method of the same class that simply multiplies the quantity received * the cost for a total. That total is stored in a memory variable.
A couple of other points.
oFldSI:aDialogs[1] contains the GET fields for the array elements
The oLbx1 xbrowse is attached to the Dialog, not the folders. |
xBrowse buffer with Array | XBrowse and the Get object refer to the same array oStkSrv:aStkPar. This is an array being read and maintained by the class oStkSrv. If for some reason the class oStkSrv refreshes aStkPar from the dbf, the changes made by the Get to the array can be lost.
One suggestion is to use aStkParClone := AClone( oStkSrv:aStkPar ) in the XBrowse and for the Get. After all editing is done, then copy the contents of aStkParClone to oStkSrv:aStkPar and immediately save the changes to the DBF. |
xBrowse buffer with Array | Thank you for the suggestion. Once I thought about REFRESH(), I looked at what might cause it. I actually found a VALID process that had been recently added, and it was actually confirming data against the original DBF record in inventory ...
It's all resolved now.
Thank you. |
xBrowse building image-groups (sorted by color) | Hello,
I created a xBrowse-solution to split a imagebrowser
in colorgroups
maybe something better <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
images splitted / sorted to groups red, blue and gray
The basic images are selected with celledit to build a structure
[img:2b2oqmye]http://www.service-fivewin.de/images/Imgbrowse1.jpg[/img:2b2oqmye]
changing the structure :
a right mouseclick does a copy
moving to the new cell another right mouseclick will paste the image
the old position is cleard
[img:2b2oqmye]http://www.service-fivewin.de/images/Imgbrowse2.jpg[/img:2b2oqmye]
the copy paste-status is shown at the bottom
You can break the paste simply pressing the copybutton
The red copy-status ( because no paste is done ) will turn to green again
[img:2b2oqmye]http://www.service-fivewin.de/images/Imgbrowse3.jpg[/img:2b2oqmye]
best regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
xBrowse building image-groups (sorted by color) | I could see a sollution for a small project of mine.
Having a dbf with many fields, and 1 jpg field.
Your solution should be change (setup) with lets say 4 pics on a row.
Then we change all the positions like we want and in the dbf there need to be a field in order to know the sort order.
That way we have a sorting/positioning module for ranking the products.
If posible, i would like to test and see. |
xBrowse building image-groups (sorted by color) | Marc,
[quote:1v038fhx]
Then we change all the positions like we want and in the dbf there need to be a field
in order to know the sort order.
That way we have a sorting/positioning module for ranking the products.
[/quote:1v038fhx]
showing the ranking on the right upper corner a solution ?
yellow fields will be only visible with a valid number > 0
how many ranking-positions do You want to show -> top 20 , top 50 ?
[img:1v038fhx]http://www.service-fivewin.de/images/Ranking1.jpg[/img:1v038fhx]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse building image-groups (sorted by color) | I would say max 50. If there are more they all may become a number of 100, so they stay lower then the 1-50 range.
So if We would only rank the top 15, we do a 1-15 and the rest has a higher number, so they go below the tot 15 sorted
It is used for sorting my webshop products in the offline version. then I upload them. |
xBrowse building image-groups (sorted by color) | Marc,
do You know if it is possible to build the following xBrowse [color=#FF0000:3lzpf683]without using a array[/color:3lzpf683].
I couldn*t find any tests.
Using only 1 DBF-imagefield ---> 4 records on 4 columns must be displayed in in each row
It means a new row ( break ) after 4 records
[img:3lzpf683]http://www.service-fivewin.de/images/xBrwstruct1.jpg[/img:3lzpf683]
My solution for the moment : 5 DBF-imagefields displayed in 5 columns
[img:3lzpf683]http://www.service-fivewin.de/images/xBrwstruct2.jpg[/img:3lzpf683]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse building image-groups (sorted by color) | I use a temp dbf and create the picture fields that I need. The way you do it also i think.
Mr. Rao made a sample with a Xbrowse gallery... Maybe there ? |
xBrowse c/ADS Problema con Filtro (SOLUCIONADO) | Estimados: FELIZ DIA DEL TRABAJADOR!
Se me plantea un problema de estabilidad en un xBrowse filtrando datos de una DBF ADS
Este sería la vista correcta:
[img:29y8hkbk]http://i795.photobucket.com/albums/yy237/MLimonG/Cheques1.png[/img:29y8hkbk]
Luego, esto ocurrre al mover el puntero con el mouse, o las flechas al llegar al ultimo registro (luego no sube, solo se mueve sobre este ultimo mostrando los distintos registros). En esta vista esta mostrando el de la tercer fila
[img:29y8hkbk]http://i795.photobucket.com/albums/yy237/MLimonG/Cheques2.png[/img:29y8hkbk]
Este es el código
[code=fw:29y8hkbk]<div class="fw" id="{CB}" style="font-family: monospace;"> shSelect := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /> shSelBank:= <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">// DetaCheq23 [DB23] - Bancos [DB21]</span><br /> <span style="color: #000000;">(</span>h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nArea</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> dbSetRelat<span style="color: #000000;">(</span> h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"Bancos"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nArea</span>, <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nArea</span><span style="color: #000000;">)</span>->FBANK01 <span style="color: #000000;">}</span>, <span style="color: #ff0000;">'(h0["DetaCheq23"]:nArea)->FBANK01'</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"FE_VENCE"</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nArea</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> AdsSetAOF<span style="color: #000000;">(</span> <span style="color: #ff0000;">"!FDETCHQ07"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">GoTop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"brw_VerCheques"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Cheques en cartera"</span> ;<br /> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">hFont</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"Tahoma14"</span><span style="color: #000000;">]</span><br /> oDlg:<span style="color: #000000;">lHelpIcon</span>:= <span style="color: #00C800;">FALSE</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oLstChq <span style="color: #0000ff;">ID</span> BRW_XBRW <span style="color: #0000ff;">OF</span> oDlg ;<br /> COLUMNS <span style="color: #ff0000;">"FDETCHQ02"</span>, <span style="color: #ff0000;">"FDETCHQ04"</span>, <span style="color: #ff0000;">"FDETCHQ05"</span>, <span style="color: #00C800;">nil</span> ;<br /> HEADERS <span style="color: #ff0000;">"DocNro"</span>, <span style="color: #ff0000;">"FeVencim"</span>, <span style="color: #ff0000;">"Monto"</span>, <span style="color: #ff0000;">"Check"</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cAlias</span><br /><br /> WITH OBJECT oLstChq<br /> :<span style="color: #000000;">nMarqueeStyle</span>:= MARQSTYLE_HIGHLROW <span style="color: #B900B9;">// linea señaladora</span><br /> :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br /> :<span style="color: #000000;">lFooter</span> := <span style="color: #00C800;">TRUE</span><br /><br /> :<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> CLR_BLACK, CLR_ROWLIMA <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Colorea todo el browse</span><br /> :<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> CLR_BLACK, CLR_ROWLIMA <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// Filas sin foco</span><br /> :<span style="color: #000000;">bClrSelFocus</span>:= <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> CLR_NARANJA, CLR_CELDALIMA <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// Celda con foco</span><br /> :<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> CLR_GRAY, CLR_ROWLIMA <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// Fila siN foco</span><br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span>|| nPosActual := oLstChq:<span style="color: #000000;">BookMark</span>, oLstChq:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #B900B9;">// Seleccion</span><br /> :<span style="color: #000000;">bLDblClick</span>:= <span style="color: #000000;">{</span>|| Eval<span style="color: #000000;">(</span> oLstChq:<span style="color: #000000;">bKeyDown</span>, VK_SPACE<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span>|nK| <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nK==VK_INSERT .or. nK==VK_SPACE, ; <span style="color: #B900B9;">// Aca realizo un proceso de seleccion mediante Hash</span><br /> ... <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">{</span>|| h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> END<br /><br /> WITH OBJECT oLstChq:<span style="color: #000000;">DocNro</span><br /> :<span style="color: #000000;">nWidth</span>:= <span style="color: #000000;">85</span><br /> END<br /> WITH OBJECT oLstChq:<span style="color: #000000;">FeVencim</span><br /> :<span style="color: #000000;">nWidth</span>:= <span style="color: #000000;">90</span><br /> END<br /> WITH OBJECT oLstChq:<span style="color: #000000;">Monto</span><br /> :<span style="color: #000000;">nWidth</span>:= <span style="color: #000000;">105</span><br /> :<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br /> :<span style="color: #000000;">bClrFooter</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_GREEN, CLR_BLACK<span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">oFooterFont</span> := ::<span style="color: #000000;">hFont</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"Tahoma14B"</span><span style="color: #000000;">]</span><br /><br /> :<span style="color: #000000;">bFooter</span>:= <span style="color: #000000;">{</span>|| Trans<span style="color: #000000;">(</span> oLstChq:<span style="color: #000000;">Monto</span>:<span style="color: #000000;">nTotal</span>-nTotSelec, PIC_DIEZCIF2 <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> END<br /> WITH OBJECT oLstChq:<span style="color: #000000;">Check</span><br /> :<span style="color: #000000;">nHeadStrAlign</span>:= AL_CENTER<br /> :<span style="color: #000000;">nFootStrAlign</span>:= AL_RIGHT<br /> :<span style="color: #000000;">bClrFooter</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span>CLR_HRED, CLR_BLACK<span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">oFooterFont</span> := ::<span style="color: #000000;">hFont</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"Tahoma14B"</span><span style="color: #000000;">]</span><br /><br /> :<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|x| x:= HHasKey<span style="color: #000000;">(</span> shSelect, h0<span style="color: #000000;">[</span><span style="color: #ff0000;">"DetaCheq23"</span><span style="color: #000000;">]</span>:<span style="color: #000000;">RecNo</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;">SetCheck</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"bmp_Ok2"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">}</span>, <span style="color: #00C800;">TRUE</span> <span style="color: #000000;">)</span><br /><br /> :<span style="color: #000000;">bFooter</span>:= <span style="color: #000000;">{</span>|| Trans<span style="color: #000000;">(</span> nTotSelec, PIC_DIEZCIF1 <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> END<br /> </div>[/code:29y8hkbk]
No encuentro la forma de resolverlo (salvo pasarlo a array)
Utilizo FWH 12.04
gracias |
xBrowse c/ADS Problema con Filtro (SOLUCIONADO) | Mario: muchas gracias e igualmente para ti.
Creo que lo de la estabilidad del xBrowse se debe a ADS, a mi me pasó lo mismo
hace tiempo y lo solucione con estas 2 lineas en el xBrowse. Me lo dijeron aqui en el foro.
oLstChq:bKeyCount := {|| h0["DetaCheq23"]:cAlias->( AdsKeyCount( , , ADS_RESPECTFILTERS ) ) }
oLstChq:bKeyNo := {| n | IIf( HB_IsNil( n ), h0["DetaCheq23"]:cAlias->( AdsKeyNo( , , ADS_RESPECTFILTERS ) ), h0["DetaCheq23"]:cAlias->( OrdKeyGoto( n ) ) ) }
Saludos.
Ruben Dario Fernandez |
xBrowse c/ADS Problema con Filtro (SOLUCIONADO) | Espectacular! Ruben; solucionado!!
gracias |
xBrowse c/TDolphin | Consultas:
1) Como selecciono la columna de búsqueda (el icono que con una DBF aparece de acuerdo al índice activo)
2) Se puede utilizar la búsqueda incremental de xBrowse, como? |
xBrowse c/TDolphin | Espero que te ajude:
oQry := oServer:Query( "SELECT * FROM clientes ORDER BY nome" )
oData := oQry
REDEFINE XBROWSE oBrw OBJECT oData ID 4000 OF oDlg lines AUTOCOLS AUTOSORT
obrw:lAutoSort := .t.
with object oBrw:oCol(1)
:cHeader := 'Código'
:cEditPicture := '999999'
:nDataStrAlign := AL_CENTER
:nHeadStrAlign := AL_CENTER
:nWidth := 100
:bEditValue := {|| oData:codigo}
end
with object oBrw:oCol(2)
:cHeader := 'Nome'
:cEditPicture := '@!'
:nDataStrAlign := AL_LEFT
:nHeadStrAlign := AL_LEFT
:nWidth := 330
:bEditValue := {|| oData:nome}
end |
xBrowse c/TDolphin | Muchas gracias SGS
Siempre reflexiono, que sobre una consulta, a veces es bueno, que nadie responda inmediatamente ya que de esa manera, uno se obliga a "estudiar" mas sobre el tema.
Y efectivamente , como estoy "verde" en MySQL , TDlphin y xBrowse (bue... casi entodo no? <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> ). Se me olvido de incluir la cláusula AUTOSORT!
Ahora bien. En mi (x)browse tengo, las clásicas columnas ID, Apellido y Nombre. Por las 2 últimas, retorna la búsqueda; aunque por la primera no.
Se debe a que es un campo numérico? |
xBrowse c/TDolphin | Me sigo retractando...
La busqueda incremental por campos numéricos funciona. En mi declaracion de tales campos puse ZEROFILL, lo que impedia la busqueda
disculpen las milestias |
xBrowse c/TDolphin | <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.