topic
stringlengths
1
63
text
stringlengths
1
577k
xbrowse -Unselect line
Other way: oBrw:nMarqueeStyle := 0
xbrowse -Unselect line
Francisco; Thanks for your reply. If I understand correctly, I'm afraid this won't work. The problem is a bit more complicated. The xbrowse is displayed so that the user may pick multiple lines. They achieve this by clicking on the record while pressing cntrl. But the problem is that the first record is already selected. Unless the users unselects the record, it comes back on the ::aSelection data of the xbrowse. Since upgrading my fwh, my users are not happy about having to Un-select the first record before selecting the ones they really want selected. So painting the first record on another color, will not remove it from aSelection. nMarqueestyle =0, will not work, since you can not do multiple selections with value zero on nmarqueestyle. With Regards, Reinaldo.
xbrowse -Unselect line
I see now. But users can select the first line they want, by clicking without pressing ctrl, and then to do click on the next record while pressing ctrl. I know ... customer is always right. On the other hand, I think it's interesting that you post. I'll do some tests, and if I get something positive, I'll let you know. Regards.
xbrowse -Unselect line
Francisco; Yes. You are correct. The user may click on any other line, and that removes the 1st record from aSelection. But, most times my users don't want any record selected. My previous xbrowse does NOT autoselects a record when nMarqueeStyle = 5. It makes no sense to auto-select a row when you are showing a multiple-selection xbrowse. Reinaldo.
xbrowse -Unselect line
Reinaldo, test this code, please. oBrw2:CreateFromResource(181) oBrw2:SetRDD() [b:3qyodq1c] oBrw2:bKeyDown := { |nKey| if(oBrw2:nMarqueeStyle==0,oBrw2:nMarqueeStyle := MARQSTYLE_HIGHLROWMS,) }[/b:3qyodq1c] ... ACTIVATE DIALOG oDlg CENTERED ; [b:3qyodq1c] ON INIT ( if(oBrw2:nMarqueeStyle == MARQSTYLE_HIGHLROWMS,; //Multiselect (oBrw2:aSelected:={},oBrw2:Select(0),oBrw2:nMarqueeStyle:=0),) ) [/b:3qyodq1c] Francisco
xbrowse -Unselect line
[quote="reinaldocrespo":17laqpd3]Hi. Is there a way to open an xbrowsed array with NO record selected? Thank you, Reinaldo.[/quote:17laqpd3] I can think of this workaround for the time being: [code=fw:17laqpd3]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span>/<span style="color: #0000ff;">DIALOG</span> ....... <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aSelected</span> := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:17laqpd3] OR [code=fw:17laqpd3]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #B900B9;">/* or 2 */</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:17laqpd3] Can you also please indicate which older version the first record was NOT selected initially? This would help trace changes between the present and the older version. To the best of my knowledge, there was no intentional change in the multi-select behavior but it is possible that there was some change in the code at sometime inadvertantly.
xbrowse -Unselect line
Modification to XBrowse: Please locate these three lines in the METHOD Adjust() of XBrowse calss: [code=fw:uqatuwsw]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nMarqueeStyle</span> == MARQSTYLE_HIGHLROWMS<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;</div>[/code:uqatuwsw] Comment out these three lines. Then initially no row will be selected. But were these lines of code not there in the older version?
xbrowse -get date - resolved
Nages, here not run ok I have an array ( aItems) [code=fw:s9qgni08]<div class="fw" id="{CB}" style="font-family: monospace;"> <br />@ <span style="color: #000000;">120</span>, <span style="color: #000000;">02</span> <span style="color: #0000ff;">XBROWSE</span>  oBrowse <span style="color: #0000ff;">OF</span> oFolder:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> ;<br />        COLUMNS <span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span>,<span style="color: #000000;">7</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">9</span>,<span style="color: #000000;">10</span>,<span style="color: #000000;">11</span>,<span style="color: #000000;">12</span>,<span style="color: #000000;">13</span>;<br />        HEADERS    <span style="color: #ff0000;">"Ico"</span>,<span style="color: #ff0000;">"Tipo"</span>,<span style="color: #ff0000;">"Servizio"</span>,<span style="color: #ff0000;">"Q.tà"</span>,<span style="color: #ff0000;">"Costo"</span>,<span style="color: #ff0000;">"Tot p q.tà"</span>,<span style="color: #ff0000;">"Dal"</span>,<span style="color: #ff0000;">"al"</span>,<span style="color: #ff0000;">"Giorni"</span>,<span style="color: #ff0000;">"Sconto"</span>,<span style="color: #ff0000;">"Totale"</span>   ;<br />        COLSIZES <span style="color: #000000;">30</span>, <span style="color: #000000;">30</span>,<span style="color: #000000;">100</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">90</span> ;<br />        PICTURES <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"@!"</span>,<span style="color: #ff0000;">"9999"</span>,<span style="color: #ff0000;">"999,999,999"</span>,<span style="color: #ff0000;">"999,999,999"</span>, <span style="color: #ff0000;">"dd-mmmm-yyyy"</span>,<span style="color: #ff0000;">"dd-mmmm-yyyy"</span>,<span style="color: #ff0000;">"999"</span>,<span style="color: #ff0000;">"999,99"</span>,<span style="color: #ff0000;">"999,999,999"</span>;<br />        ARRAY aItems       ;<br />        <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">82</span> <span style="color: #0000ff;">PIXEL</span> NOBORDER<br /><br /> ADD COLUMN <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">XBROWSE</span> oBrowse<br /><br />         bCalcRow := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span>oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> * oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>,;<br />                           oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">11</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span> oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">value</span> * oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">value</span><span style="color: #000000;">&#41;</span>-oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">value</span><span style="color: #000000;">&#41;</span>,;<br />                             CalcoloTotali<span style="color: #000000;">&#40;</span>oBrowse,aGet<span style="color: #000000;">&#41;</span>     <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><br /><br />     WITH OBJECT oBrowse<br />        :<span style="color: #000000;">nRowHeight</span>    := <span style="color: #000000;">30</span><br /><br />       WITH OBJECT oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />          :<span style="color: #000000;">bFooter</span>   := <span style="color: #000000;">&#123;</span> || Ltrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oBrowse:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oBrowse:<span style="color: #000000;">KeyCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" servizi"</span> <span style="color: #000000;">&#125;</span><br />          :<span style="color: #000000;">lBmpStretch</span>     := .F.<br />          :<span style="color: #000000;">lBmpTransparent</span> := .T.<br />          :<span style="color: #000000;">nwidth</span> := <span style="color: #000000;">30</span><br />          :<span style="color: #000000;">bStrImage</span>       := <span style="color: #000000;">&#123;</span>|| oBrowse:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrowse:<span style="color: #000000;">narrayat</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br /><br />       END<br /><br />       WITH OBJECT oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />          :<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"INVOICE_ELEMENTO"</span>,;<br />                      <span style="color: #ff0000;">"INVOICE_SERVIZIO"</span>,;<br />                      <span style="color: #ff0000;">"INVOICE_PACCHETTO"</span>,;<br />                      <span style="color: #ff0000;">"INVOICE_LISTINO"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />            :<span style="color: #000000;">lBtnTransparent</span> := .t.<br />           :<span style="color: #000000;">bStrImage</span>       := <span style="color: #000000;">&#123;</span>|| GiveType<span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span>oBrowse:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrowse:<span style="color: #000000;">narrayat</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#125;</span><br />       END<br /><br /><br /><br />          WITH OBJECT oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />          :<span style="color: #000000;">nWidth</span>        := <span style="color: #000000;">100</span><br />          :<span style="color: #000000;">nDataStrAlign</span> := AL_CENTER<br />          :<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> FW_BmpPlus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, FW_BmpMinus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />          <span style="color: #B900B9;">// Right Button</span><br />         :<span style="color: #000000;">nEditType</span>     := EDIT_BUTTON<br />         :<span style="color: #000000;">bEditBlock</span>    := <span style="color: #000000;">&#123;</span> |r,c,oCol| oCol:<span style="color: #000000;">Value</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span><br />         :<span style="color: #000000;">nBtnBmp</span>       := <span style="color: #000000;">1</span><br />         :<span style="color: #000000;">lBtnTransparent</span>  := .t.<br /><br />         <span style="color: #B900B9;">// Left Button</span><br />         :<span style="color: #000000;">bBmpData</span>      := <span style="color: #000000;">&#123;</span> |v,lSel| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lSel, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />         :<span style="color: #000000;">bBmpAction</span>    := <span style="color: #000000;">&#123;</span> |oCol| IIF<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">Value</span>><span style="color: #000000;">0</span>,oCol:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">Value</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />         :<span style="color: #000000;">bOnChange</span> := bCalcRow<br /><br />      END<br /><br /><br />     <span style="color: #B900B9;">// colona per totale x qut  riga</span><br />                    WITH OBJECT  oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span><br />                         :<span style="color: #000000;">nFooterType</span>      := AGGR_SUM<br />                         :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@ €99,999.99'</span><br />                      END<br /><br /><br /><br /><br />         WITH OBJECT oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span><br />         :<span style="color: #000000;">nEditType</span>  := EDIT_BUTTON<br />         :<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\w</span>ork<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>alendar.bmp"</span> <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">nBtnBmp</span>    := <span style="color: #000000;">1</span><br />         :<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">&#123;</span> |r,c,o,k| XbrGetDate<span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />         END<br /><br /> WITH OBJECT oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span><br />         :<span style="color: #000000;">nEditType</span>  := EDIT_BUTTON<br />         :<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\w</span>ork<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>alendar.bmp"</span> <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">nBtnBmp</span>    := <span style="color: #000000;">1</span><br />         :<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">&#123;</span> |r,c,o,k| XbrGetDate<span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />         END<br />   WITH OBJECT  oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">10</span><span style="color: #000000;">&#93;</span><br />                  :<span style="color: #000000;">nEditType</span>     := EDIT_GET<br />                  :<span style="color: #000000;">bOnChange</span> := bCalcRow<br />               END<br /><br /><br />       <span style="color: #B900B9;">// colona per totale riga</span><br />                    WITH OBJECT  oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">11</span><span style="color: #000000;">&#93;</span><br />                         :<span style="color: #000000;">nFooterType</span>      := AGGR_SUM<br />                         :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@ €99,999.99'</span><br />                      END<br /><br />      WITH OBJECT oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">12</span><span style="color: #000000;">&#93;</span><br />                       :<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"INVOICE_CANCELLA"</span>,<span style="color: #ff0000;">"INVOICE_INCOLLA"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />                       :<span style="color: #000000;">nBtnBmp</span> := <span style="color: #000000;">1</span><br />                       :<span style="color: #000000;">lBmpStretch</span>     := .F.<br />                       :<span style="color: #000000;">lBmpTransparent</span> := .T.<br />                       :<span style="color: #000000;">nwidth</span> := <span style="color: #000000;">30</span><br />                       :<span style="color: #000000;">nEditType</span> := EDIT_BUTTON<br />                       :<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">&#123;</span> ||DeleteRow<span style="color: #000000;">&#40;</span>oBrowse,aGet<span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#125;</span><br />                       :<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">2</span><br />                       :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">""</span><br />                       :<span style="color: #000000;">bLClickHeader</span>  := <span style="color: #000000;">&#123;</span> ||DeleteAllRows<span style="color: #000000;">&#40;</span>oBrowse,aGet<span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#125;</span><br />                      END<br /><br /><br />                      :<span style="color: #000000;">lHscroll</span>         := .F.<br />                      :<span style="color: #000000;">l2007</span>            := .F.<br />                      :<span style="color: #000000;">l2015</span>            := .T.<br />                      :<span style="color: #000000;">nStretchCol</span>      := STRETCHCOL_WIDEST<br />                      :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_LIGHTGRAY<br />                      :<span style="color: #000000;">lAllowRowSizing</span>     := .F.<br />                      :<span style="color: #000000;">lAllowColSwapping</span>   := .F.<br />                      :<span style="color: #000000;">lAllowColHiding</span>     := .F.<br />                      :<span style="color: #000000;">nMarqueeStyle</span>       := MARQSTYLE_HIGHLROWMS<br />                      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    END<br /><br /><br /><br /> </div>[/code:s9qgni08]
xbrowse -get date - resolved
to inser on a column a calenda I made WITH OBJECT oBrowse:aCols[ 7] :AddBitmap( "INVOICE_CALENDARIO") :nBtnBmp := 1 :lBtnTransparent := .t. * :lBmpStretch := .f. :nwidth := 120 :nDataStrAlign := AL_CENTER :nHeadStrAlign := AL_CENTER :nDataStrAlign := oBrowse:aCols[ 7]:DefStyle(AL_LEFT,.f.) :nEditType := EDIT_BUTTON :bEditBlock := { |r,c,o,k|(XbrGetDate( o,"Seleziona una data",,1 ),oBrowse:refresh()) } END But it make error , how I can resolve please ?
xbrowse -get date - resolved
[code=fw:1x0bm1gc]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oFont, oBrw<br /><br />&nbsp; &nbsp;USE CUSTOMER SHARED<br /><br />&nbsp; &nbsp;<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 />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"FIRST"</span>,<span style="color: #ff0000;">"CITY"</span>,<span style="color: #ff0000;">"HIREDATE"</span>,<span style="color: #ff0000;">"AGE"</span>, <span style="color: #ff0000;">"SALARY"</span> ;<br />&nbsp; &nbsp; &nbsp; PICTURES <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"dd-mmmm-yyyy"</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditTypes</span> &nbsp; &nbsp;:= EDIT_GET<br />&nbsp; &nbsp; &nbsp; WITH OBJECT :<span style="color: #000000;">HireDate</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nEditType</span> &nbsp;:= EDIT_BUTTON<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>alendar.bmp"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nBtnBmp</span> &nbsp; &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">&#123;</span> |r,c,o,k| XbrGetDate<span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<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 />&nbsp;</div>[/code:1x0bm1gc] [url=https&#58;//imageshack&#46;com/i/poe7tDlnp:1x0bm1gc][img:1x0bm1gc]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq90/924/e7tDln&#46;png[/img:1x0bm1gc][/url:1x0bm1gc]
xbrowse -get date - resolved
Sorry, now t it run ok , there was also the oldest datepick compiled!!!! only i have no transparent bitmap also tried with pngs
xbrowse / ADS failure
In another thread, we identified there is still a continuing problem with xBrowse and ADS. When we open a browse and the dbf does not have an index opened, when going towards the end of the file, the pointer has an error. We have shown this consistently and it has also been previously reported by at least one other person. If an index is open, the error does not occur. The previous threads on this topic were specific and the error was noted, but no fix has yet taken place. The specific build uses FWH 15.09 xBrowse, Harbour, MSVC 2013, and ADS Server mode. Can we please go back and get this resolved correctly ? Thank you. Although the temporary work around is to set the index before browsing the file, often we want to go to the last records added and natural order ( no index ) is the fastest way.
xbrowse / ADS failure
All these navigation problems xbrowse already decided to put runs on TADs class, The Linear Sr could study and add in xBrowse class. In xbrowse.prg method SetRdd() change: [code=fw:34hlbck6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #00C800;">If</span> <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADS"</span>$<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RddName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .or. <span style="color: #ff0000;">'ADT'</span> $ <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RddName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//.and. ;</span><br />      <span style="color: #B900B9;">//( ::cAlias )->( LastRec() ) > 200</span><br /><br />      <span style="color: #B900B9;">// Modified in FWH 9.06</span><br />      <span style="color: #B900B9;">// AdsGetRelKeyPos() returns approximate position as % and when multipilied by 100 and rounded off</span><br />      <span style="color: #B900B9;">// returns incorrect values occassionally on smaller  tables. OrdKeyNo() mapped to AdsKeyNo() gives reliable</span><br />      <span style="color: #B900B9;">// result in such cases. For large tables OrdKeyNo() is unacceptably slow. Limit of 200 is chosen because</span><br />      <span style="color: #B900B9;">// 0.5% is 1/200.</span><br /><br />      cAdsKeyNo    := <span style="color: #ff0000;">"{| n, Self | iif( n == nil, "</span> +;<br />                         <span style="color: #ff0000;">"nCalcRelPos( "</span> + cAlias + <span style="color: #ff0000;">"->( ADSGetRelKeyPos() ) * Self:nLen, Self ), "</span>+;<br />                         cAlias + <span style="color: #ff0000;">"->( ADSSetRelKeyPos( n / Self:nLen ) ) ) }"</span><br /><br />      cAdsKeyCount := <span style="color: #ff0000;">"{|| "</span> + cAlias + <span style="color: #ff0000;">"->( ADSKeyCount(,,1) )}"</span> <br /><br />      <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bKeyNo</span>    := &cAdsKeyNo ,;<br />              ::<span style="color: #000000;">bKeyCount</span> := &cAdsKeyCount<br /><br /> </div>[/code:34hlbck6] Function nCalcRalPos() [code=fw:34hlbck6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> nCalcRelPos<span style="color: #000000;">&#40;</span>f_nVal,f_oXBrw<span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Local</span> nLenRegs := f_oXBrw:<span style="color: #000000;">nLen</span>, nRowPos := f_oXBrw:<span style="color: #000000;">nRowSel</span><br />  <span style="color: #00C800;">Local</span> nRetorno := <span style="color: #000000;">0</span><br />  <br />  nRetorno := <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span>f_nVal,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><br />  <br />  <span style="color: #00C800;">If</span> nRetorno == <span style="color: #000000;">0</span><br />    nRetorno := <span style="color: #000000;">1</span><br />  <span style="color: #00C800;">EndIf</span><br /><br />  <span style="color: #00C800;">If</span> nRetorno < nRowPos<br />    nRetorno := nRowPos<br />  <span style="color: #00C800;">EndIf</span>  <br /><br />  nRetorno := Int<span style="color: #000000;">&#40;</span>nRetorno<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> nRetorno<br /> </div>[/code:34hlbck6] When I use the TADS class I use the tCtrlxBrw class () here is the class, most only works with TADS (). Class tCtrlxbrw: [code=fw:34hlbck6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"xBrowse.ch"</span><br /><br /><span style="color: #00D7D7;">#Define</span> df_BaseMySql    <span style="color: #000000;">1</span><br /><br /><span style="color: #00C800;">Class</span> tCtrlxBrw <br /><br />  <span style="color: #00C800;">Data</span> oXBrwCtrl, oDbDs_DataBaseAds<br />  <span style="color: #00C800;">Data</span> bStrData<br />  <span style="color: #00C800;">Data</span> oGetDsFilter, nTpCampoFilter, cCampoFilter, lLastRecZero<br />  <span style="color: #00C800;">Data</span> bChangeBrw<br />  <br />  <span style="color: #00C800;">Method</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>f_oXBrowse,f_oDbDs_DataBaseAds<span style="color: #000000;">&#41;</span> Constructor<br />  <span style="color: #00C800;">Method</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">Method</span> SetTAds<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <br />  <span style="color: #00C800;">Method</span> tCtrlxBrw_Skip<span style="color: #000000;">&#40;</span>f_nKip<span style="color: #000000;">&#41;</span><br />  <br />  <span style="color: #00C800;">Method</span> tCtrlxBrw_Seek<span style="color: #000000;">&#40;</span>f_oBjCol,f_uVar<span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Method</span> tCtrlxBrw_EditFilterRdd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Method</span> tCtrlxBrw_EditFilterSql<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Method</span> tCtrlxBrw_EditChange<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Method</span> tCtrlxBrw_EditClearChar<span style="color: #000000;">&#40;</span>f_cTxt, f_nTipo<span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">Endclass</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>f_oXBrowse,f_oDbDs_DataBaseAds,f_aGetFilter<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br />  <span style="color: #00C800;">Local</span> oSelf<br /><br />  <span style="color: #B900B9;">// f_aGetFilter[1] > oBjeto Get</span><br />  <span style="color: #B900B9;">// f_aGetFilter[2] > Tipo Filtro 1=SetAof contains / 2=Sql select Contains</span><br />  <span style="color: #B900B9;">// f_aGetFilter[3] > Nome do campo a pesquisar</span><br />   <br />  <span style="color: #B900B9;">///Override Method Skip In Class Txbrowse With oSelf:tCtrlxBrw_Skip</span><br /><br />  ::<span style="color: #000000;">lLastRecZero</span> := .F.<br /><br />  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>     := f_oDbDs_DataBaseAds<br />  ::<span style="color: #000000;">oXBrwCtrl</span>             := f_oXBrowse<br />  <br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">cAlias</span>      := ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">cAlias</span><br />  <br />  <span style="color: #00C800;">If</span> !Hb_IsNil<span style="color: #000000;">&#40;</span>f_aGetFilter<span style="color: #000000;">&#41;</span><br /><br />    ::<span style="color: #000000;">oGetDsFilter</span>    := f_aGetFilter<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />    ::<span style="color: #000000;">nTpCampoFilter</span>  := f_aGetFilter<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />    ::<span style="color: #000000;">cCampoFilter</span>    := f_aGetFilter<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />    <br />    <span style="color: #00C800;">If</span> f_aGetFilter<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> == <span style="color: #000000;">2</span> <span style="color: #B900B9;">// Sql Contains</span><br />      ::<span style="color: #000000;">oGetDsFilter</span>:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">&#123;</span>||::<span style="color: #000000;">tCtrlxBrw_EditFilterSql</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />    <br />    ElseIf f_aGetFilter<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> == <span style="color: #000000;">1</span> <span style="color: #B900B9;">// Rdd set aof</span><br /><br />      ::<span style="color: #000000;">oGetDsFilter</span>:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">&#123;</span>||::<span style="color: #000000;">tCtrlxBrw_EditFilterRdd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />      <br />    <span style="color: #00C800;">EndIf</span><br /><br />    ::<span style="color: #000000;">bChangeBrw</span> := ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bChange</span><br />    ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bChange</span>    := <span style="color: #000000;">&#123;</span>||::<span style="color: #000000;">tCtrlxBrw_EditChange</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />    ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bGotFocus</span>  := <span style="color: #000000;">&#123;</span>||::<span style="color: #000000;">tCtrlxBrw_EditChange</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />    <br />  <span style="color: #00C800;">EndIf</span>  <br /><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_HGRAY<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// Giovany</span><br />  ::<span style="color: #000000;">SetTAds</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Self</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br /><br /><span style="color: #00C800;">Self</span> := <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> SetTAds<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br />  <span style="color: #00C800;">Local</span> nTpGetRelPos := <span style="color: #000000;">1</span>, cTmpQry := <span style="color: #ff0000;">""</span>, nTmp := <span style="color: #000000;">0</span><br /><br />  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">lBufferOnSkip</span> := .T.<br />  <br />  <span style="color: #00C800;">If</span> ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">nOpenType</span> == <span style="color: #000000;">3</span> <span style="color: #B900B9;">// Open via Dataset</span><br />    cTmpQry := Upper<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">cQrySql</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">If</span> <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"{STATIC}"</span>,cTmpQry<span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span> <br />      nTpGetRelPos := <span style="color: #000000;">2</span><br />    <span style="color: #00C800;">Else</span><br />      nTpGetRelPos := <span style="color: #000000;">1</span> <br />    <span style="color: #00C800;">EndIf</span><br />  <span style="color: #00C800;">Else</span><br />    nTpGetRelPos := <span style="color: #000000;">1</span><br />  <span style="color: #00C800;">EndIf</span><br /><br />  <span style="color: #00C800;">If</span> nTpGetRelPos == <span style="color: #000000;">2</span> <span style="color: #B900B9;">// Open via Sql Dataset cursor vivo </span><br /><br />    ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bKeyNo</span>    := <span style="color: #000000;">&#123;</span>| n, _Self | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #00C800;">nil</span>, ;<br />                                   nCalcRelPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">GetRelKeyPos</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> * _Self:<span style="color: #000000;">nLen</span><span style="color: #000000;">&#41;</span> /<span style="color: #000000;">10</span>,::<span style="color: #000000;">oXBrwCtrl</span><span style="color: #000000;">&#41;</span> , ;<br />                                   ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">SetRelKeyPos</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span>n / _Self:<span style="color: #000000;">nLen</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />  <span style="color: #00C800;">Else</span> <span style="color: #B900B9;">// Viao Rdd ou Static Cursor</span><br /><br />    ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bKeyNo</span>    := <span style="color: #000000;">&#123;</span>| n, _Self | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #00C800;">nil</span>, ;<br />                                 nCalcRelPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">GetRelKeyPos</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> * _Self:<span style="color: #000000;">nLen</span><span style="color: #000000;">&#41;</span>,::<span style="color: #000000;">oXBrwCtrl</span> <span style="color: #000000;">&#41;</span> , ;<br />                                 ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">SetRelKeyPos</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span>n / _Self:<span style="color: #000000;">nLen</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />  <span style="color: #00C800;">EndIf</span><br /><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bBookMark</span> := <span style="color: #000000;">&#123;</span>| n | iif<span style="color: #000000;">&#40;</span> n == <span style="color: #00C800;">nil</span>,;<br />                               ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">Recno</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , ;<br />                               ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bKeyCount</span> := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">KeyCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#125;</span><br />  <br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bBof</span>      := <span style="color: #000000;">&#123;</span> ||  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">Bof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bEof</span>      := <span style="color: #000000;">&#123;</span> ||  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bSkip</span>     := <span style="color: #000000;">&#123;</span> |n| Iif<span style="color: #000000;">&#40;</span> n == <span style="color: #00C800;">Nil</span>, n := <span style="color: #000000;">1</span>, <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">tCtrlxBrw_Skip</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bGoTop</span>    := <span style="color: #000000;">&#123;</span> ||  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">&#123;</span> ||  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">OnSkip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> tCtrlxBrw_Skip<span style="color: #000000;">&#40;</span>f_nSkip<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br />  <span style="color: #00C800;">Local</span> nSkipper := <span style="color: #000000;">0</span><br />  <br />  <span style="color: #00C800;">Default</span> f_nSkip := <span style="color: #000000;">1</span> <br /><br />  nSkipper := <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DbSkipper<span style="color: #000000;">&#40;</span>f_nSkip<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">OnSkip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <br /><span style="color: #00C800;">Return</span> nSkipper  <br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> tCtrlxBrw_Seek<span style="color: #000000;">&#40;</span>f_oBjCol,f_uVar,f_lTpSeek<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br /><span style="color: #00C800;">LOCAL</span> nRecMarca := ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">Recno</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, cTpData := <span style="color: #ff0000;">""</span><br /><br />  cTpData := VALTYPE<span style="color: #000000;">&#40;</span>f_uVar<span style="color: #000000;">&#41;</span><br />  <br />  <span style="color: #00C800;">IF</span> cTpData == <span style="color: #ff0000;">"N"</span><br />     f_lTpSeek := .F.<br />  ELSEIF cTpData == <span style="color: #ff0000;">"D"</span><br />     f_lTpSeek := .F.<br />  ELSEIF cTpData == <span style="color: #ff0000;">"C"</span><br />     f_lTpSeek := .T.<br />  <span style="color: #00C800;">ENDIF</span><br />  <br />  <span style="color: #B900B9;">//If ::oDbDs_DataBaseAds:nOpenType == 1</span><br />    f_oBjCol:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span>f_uVar,f_oBjCol:<span style="color: #000000;">cSortOrder</span>,f_lTpSeek<span style="color: #000000;">&#41;</span><br />  <span style="color: #B900B9;">//EndIf</span><br />  <br />  <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <br />     ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span>nRecMarca<span style="color: #000000;">&#41;</span><br />     <br />     MSGSTOP<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"A ocorrencia solicitada não foi encontrada."</span>,;<br />             <span style="color: #ff0000;">"Procedimento abortado..."</span><span style="color: #000000;">&#41;</span><br />  <br />  <span style="color: #00C800;">ENDIF</span><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br />  <br />  <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bChange</span> != <span style="color: #00C800;">nil</span><br />     EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #000000;">bChange</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> tCtrlxBrw_EditFilterRdd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br />  <span style="color: #00C800;">Local</span> cTxtDigitacao := <span style="color: #ff0000;">""</span>, cAof := <span style="color: #ff0000;">""</span><br /><br />  <span style="color: #B900B9;">//::oGetDsFilter:Save()</span><br />  cTxtDigitacao := Alltrim<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">tCtrlxBrw_EditClearChar</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oGetDsFilter</span>:<span style="color: #000000;">cText</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>cTxtDigitacao<span style="color: #000000;">&#41;</span> < <span style="color: #000000;">5</span><br />    cTxtDigitacao := <span style="color: #ff0000;">""</span><br />  <span style="color: #00C800;">Else</span><br />    ::<span style="color: #000000;">lLastRecZero</span> := .F.<br />  <span style="color: #00C800;">EndIf</span><br />  <br />  <span style="color: #00C800;">If</span> ::<span style="color: #000000;">lLastRecZero</span><br />    <span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />  <span style="color: #00C800;">EndIf</span><br />  <span style="color: #B900B9;">///? cTxtDigitacao</span><br /><br />  cAof := <span style="color: #ff0000;">"CONTAINS("</span>+::<span style="color: #000000;">cCampoFilter</span>+<span style="color: #ff0000;">","</span>+cTxtDigitacao+<span style="color: #ff0000;">")"</span><br /><br />    ::<span style="color: #000000;">oGetDsFilter</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">cTitle</span> := cAof<br />    ::<span style="color: #000000;">oGetDsFilter</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #B900B9;">///msginfo(cAof)</span><br />    <br />    ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">Filter</span><span style="color: #000000;">&#40;</span>cAof<span style="color: #000000;">&#41;</span><br />    ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>cTxtDigitacao<span style="color: #000000;">&#41;</span> < <span style="color: #000000;">5</span><br />    ::<span style="color: #000000;">lLastRecZero</span> := .T.<br />  <span style="color: #00C800;">EndIf</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> tCtrlxBrw_EditFilterSql<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br />  <span style="color: #00C800;">Local</span> cTxtDigitacao := <span style="color: #ff0000;">""</span><br /><br />  <span style="color: #B900B9;">//::oGetDsFilter:Save()</span><br />  cTxtDigitacao := Alltrim<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">tCtrlxBrw_EditClearChar</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oGetDsFilter</span>:<span style="color: #000000;">cText</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>cTxtDigitacao<span style="color: #000000;">&#41;</span> < <span style="color: #000000;">5</span><br />    cTxtDigitacao := <span style="color: #ff0000;">""</span><br />  <span style="color: #00C800;">Else</span><br />    ::<span style="color: #000000;">lLastRecZero</span> := .F.<br />  <span style="color: #00C800;">EndIf</span><br />  <br />  <span style="color: #00C800;">If</span> ::<span style="color: #000000;">lLastRecZero</span><br />    <span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />  <span style="color: #00C800;">EndIf</span><br />  <span style="color: #B900B9;">///? cTxtDigitacao</span><br /><br />  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">aVarsSql</span> := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"_TxtDigitacao_"</span>,cTxtDigitacao<span style="color: #000000;">&#125;</span>,;<br />                                   <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"_Campo_"</span>,::<span style="color: #000000;">cCampoFilter</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />  <br />  ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">DsExecute</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oXBrwCtrl</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>cTxtDigitacao<span style="color: #000000;">&#41;</span> < <span style="color: #000000;">5</span><br />    ::<span style="color: #000000;">lLastRecZero</span> := .T.<br />  <span style="color: #00C800;">EndIf</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> tCtrlxBrw_EditChange<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br /><br />  <span style="color: #00C800;">If</span> ::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">LastRec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />    <span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />  <span style="color: #00C800;">EndIf</span><br />  <br />  ::<span style="color: #000000;">oGetDsFilter</span>:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDbDs_DataBaseAds</span>:<span style="color: #000000;">VarGet</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">cCampoFilter</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oGetDsFilter</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <br />  <span style="color: #00C800;">If</span> !Hb_IsNil<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bChangeBrw</span><span style="color: #000000;">&#41;</span><br />    Eval<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bChangeBrw</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">EndIf</span><br />  <br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Method</span> tCtrlxBrw_EditClearChar<span style="color: #000000;">&#40;</span>f_cTxt<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> tCtrlxBrw<br />  <span style="color: #00C800;">Local</span> cRetTxt := f_cTxt<br />  <span style="color: #00C800;">Local</span> iFor := <span style="color: #000000;">0</span>, cAnd := <span style="color: #ff0000;">""</span><br />  <span style="color: #00C800;">Local</span> aCharDeletes := <span style="color: #000000;">&#123;</span> chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">"-"</span>,<span style="color: #ff0000;">"."</span>,<span style="color: #ff0000;">"+"</span>,<span style="color: #ff0000;">"="</span>,<span style="color: #ff0000;">"&"</span>,<span style="color: #ff0000;">"'"</span>,<span style="color: #ff0000;">"´"</span><span style="color: #000000;">&#125;</span><br />  <span style="color: #00C800;">Local</span> aPalavras := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />  <br />  cRetTxt := _CHAR_CLEAN<span style="color: #000000;">&#40;</span>cRetTxt,<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">" AND "</span>,;<br />                                      <span style="color: #ff0000;">" NEAR "</span>,;<br />                                      <span style="color: #ff0000;">" ANY "</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">For</span> iFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> Len<span style="color: #000000;">&#40;</span>aCharDeletes<span style="color: #000000;">&#41;</span><br />    cRetTxt := StrTran<span style="color: #000000;">&#40;</span>cRetTxt,aCharDeletes<span style="color: #000000;">&#91;</span>iFor<span style="color: #000000;">&#93;</span>,<span style="color: #ff0000;">" "</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Next</span><br /><br />  aPalavras := Hb_aTokens<span style="color: #000000;">&#40;</span>cRetTxt<span style="color: #000000;">&#41;</span><br /><br />  cRetTxt := <span style="color: #ff0000;">""</span><br />  <span style="color: #00C800;">For</span> iFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> Len<span style="color: #000000;">&#40;</span>aPalavras<span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>aPalavras<span style="color: #000000;">&#91;</span>iFor<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> > <span style="color: #000000;">3</span><br />      cRetTxt += <span style="color: #000000;">&#40;</span>cAnd + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span>+aPalavras<span style="color: #000000;">&#91;</span>iFor<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//+ " "</span><br />      cAnd := <span style="color: #ff0000;">" and "</span><br />    <span style="color: #00C800;">Endif</span><br />  <span style="color: #00C800;">Next</span><br /><br /><span style="color: #00C800;">Return</span> cRetTxt<br /><span style="color: #B900B9;">///////////////////////////////////////////////////////////////////////////////</span><br /><span style="color: #00C800;">FUNCTION</span> nCalcRelPos<span style="color: #000000;">&#40;</span>f_nVal,f_oXBrw<span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Local</span> nLenRegs := f_oXBrw:<span style="color: #000000;">nLen</span>, nRowPos := f_oXBrw:<span style="color: #000000;">nRowSel</span><br />  <span style="color: #00C800;">Local</span> nRetorno := <span style="color: #000000;">0</span><br />  <br />  nRetorno := <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span>f_nVal,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><br />  <br />  <span style="color: #00C800;">If</span> nRetorno == <span style="color: #000000;">0</span><br />    nRetorno := <span style="color: #000000;">1</span><br />  <span style="color: #00C800;">EndIf</span><br /><br />  <span style="color: #00C800;">If</span> nRetorno < nRowPos<br />    nRetorno := nRowPos<br />  <span style="color: #00C800;">EndIf</span>  <br /><br />  nRetorno := Int<span style="color: #000000;">&#40;</span>nRetorno<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> nRetorno<br /><span style="color: #B900B9;">///////////////////////////////////////////////////////////////////////////////</span><br /><span style="color: #00C800;">FUNCTION</span> _CHAR_CLEAN<span style="color: #000000;">&#40;</span>f_cTxt,f_aCaracteresRetira<span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">Local</span> cTxtRetorno := f_cTxt, iFor := <span style="color: #000000;">0</span><br />    <br />    <span style="color: #00C800;">For</span> iFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> Len<span style="color: #000000;">&#40;</span>f_aCaracteresRetira<span style="color: #000000;">&#41;</span><br />    cTxtRetorno := StrTran<span style="color: #000000;">&#40;</span>cTxtRetorno,f_aCaracteresRetira<span style="color: #000000;">&#91;</span>iFor<span style="color: #000000;">&#93;</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Next</span><br />   <br /><span style="color: #00C800;">RETURN</span> cTxtRetorno<br /><br /> </div>[/code:34hlbck6] Exemplo com tAds [code=fw:34hlbck6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />  ::<span style="color: #000000;">oDb_BoletoNucleo</span>  := DB_BOLNUCL<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">OpenRdd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>                     := tXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlgBoletosGeral</span> <span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">cAlias</span>              := ::<span style="color: #000000;">oDb_BoletoNucleo</span>:<span style="color: #000000;">cAlias</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">nMarqueeStyle</span>       := MARQSTYLE_HIGHLROW<br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">nRowDividerStyle</span>    := LINESTYLE_BLACK<br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">nColDividerStyle</span>    := LINESTYLE_BLACK<br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">nColSel</span>             := <span style="color: #000000;">1</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">l2007</span>               := .T.<br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">nRowHeight</span>          := <span style="color: #000000;">24</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">nHeaderHeight</span>       := <span style="color: #000000;">24</span> <br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">bClrRowFocus</span>        := <span style="color: #000000;">&#123;</span>||<span style="color: #000000;">&#123;</span> GetSysColor<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span>, GetSysColor<span style="color: #000000;">&#40;</span> <span style="color: #000000;">16</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">lFooter</span>             := .F.<br /><br />  aadd<span style="color: #000000;">&#40;</span>aColunas,<span style="color: #00C800;">Nil</span><span style="color: #000000;">&#41;</span><br />  nColTmp := Len<span style="color: #000000;">&#40;</span>aColunas<span style="color: #000000;">&#41;</span><br />  aColunas<span style="color: #000000;">&#91;</span>nColTmp<span style="color: #000000;">&#93;</span> := ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    With Object aColunas<span style="color: #000000;">&#91;</span>nColTmp<span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">bStrData</span>         := <span style="color: #000000;">&#123;</span>||::<span style="color: #000000;">oDb_BoletoNucleo</span>:<span style="color: #000000;">dProcesso</span><span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">cHeader</span>          := <span style="color: #ff0000;">"Dt. Imp. "</span><br />      :<span style="color: #000000;">nWidth</span>           := <span style="color: #000000;">90</span><br />      :<span style="color: #000000;">nDataStrAlign</span>    := AL_RIGHT<br />      :<span style="color: #000000;">nHeadStrAlign</span>    := AL_RIGHT<br />      :<span style="color: #000000;">cSortOrder</span>       := <span style="color: #ff0000;">"dProcesso"</span><br />      :<span style="color: #000000;">nEditType</span>        := EDIT_GET<br />      <span style="color: #B900B9;">//:cEditPicture     := "!"</span><br />      <span style="color: #B900B9;">//:bEditValue       := {||}</span><br />      <span style="color: #B900B9;">//:bEditWhen        := {||}</span><br />      <span style="color: #B900B9;">//:bEditValid       := {||}</span><br />      <span style="color: #B900B9;">//:aEditListTxt     := {}</span><br />      :<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"B16_BRWSEEK"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Bitmaps</span><br />      :<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"B16_LED_RED_1"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Bitmaps</span><br />      :<span style="color: #000000;">nHeadBmpNo</span>       := <span style="color: #000000;">1</span> <br />      <span style="color: #B900B9;">//:bBmpData         := {||}</span><br />      <span style="color: #B900B9;">//:nBtnBmp          := 2</span><br />      <span style="color: #B900B9;">//:bEditBlock       := {|oSelf|::Fun_Menus(01,oSelf)}</span><br />      :<span style="color: #000000;">bOnPostEdit</span>      := <span style="color: #000000;">&#123;</span>|ooBj,vVar,nKey|::<span style="color: #000000;">oCtrl361_Remessas</span>:<span style="color: #000000;">tCtrlxBrw_Seek</span><span style="color: #000000;">&#40;</span>ooBj,vVar<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// Automatic seek on Presskey</span><br />      <span style="color: #B900B9;">//:cFooter          := "Total"</span><br />      <span style="color: #B900B9;">//:bFooter          := {||20+20}</span><br />      <span style="color: #B900B9;">//:nFootStrAlign    := 1</span><br />    <span style="color: #B900B9;">//:nTotal           := 0</span><br />    <span style="color: #B900B9;">//:lTotal           := .T.</span><br />      <span style="color: #B900B9;">//:nFootStrAlign    := 1 </span><br />  <br />    End With <br /><br />  aadd<span style="color: #000000;">&#40;</span>aColunas,<span style="color: #00C800;">Nil</span><span style="color: #000000;">&#41;</span><br />  nColTmp := Len<span style="color: #000000;">&#40;</span>aColunas<span style="color: #000000;">&#41;</span><br />  aColunas<span style="color: #000000;">&#91;</span>nColTmp<span style="color: #000000;">&#93;</span> := ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    With Object aColunas<span style="color: #000000;">&#91;</span>nColTmp<span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">bStrData</span>         := <span style="color: #000000;">&#123;</span>||::<span style="color: #000000;">oDb_BoletoNucleo</span>:<span style="color: #000000;">nOcorrencias</span><span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">cHeader</span>          := <span style="color: #ff0000;">"Qta "</span><br />      :<span style="color: #000000;">nWidth</span>           := <span style="color: #000000;">30</span><br />      :<span style="color: #000000;">nDataStrAlign</span>    := AL_RIGHT<br />      :<span style="color: #000000;">nHeadStrAlign</span>    := AL_RIGHT<br />  <br />    End With <br /><br /><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">361</span><span style="color: #000000;">&#41;</span><br />    <br />  aColunas<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  ::<span style="color: #000000;">oBrw361_Remessas</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />  ::<span style="color: #000000;">oCtrl361_Remessas</span>  := tCtrlxBrw<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oBrw361_Remessas</span>,::<span style="color: #000000;">oDb_BoletoNucleo</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Class tCtrlxBrw control xbrowse</span><br /><br /><br /> </div>[/code:34hlbck6]
xbrowse / ADS failure
I appreciate the alternative, but I really think the most appropriate solution is to get a fix for the bug ! Antonio ? Did you receive a response to your inquiries ? The problem does not exist with xHarbour ( .com ) builds, or DBFCDX, only ADS with Harbour ... so surely we can get the error fixed.
xbrowse / ADS failure
Tim, Could you prepare a small and self contained example without using FWH that reproduces the error ?
xbrowse / ADS failure
Antonio, This has been discussed in another thread, and Rao identified the exact lines in the xBrowse code that creates the error. In addition, others had the exact same result. He indicated he knew what was causing the error, but then the topic was never resolved. [quote:19v8hfyt]Thanks for testing. From the result of your tests we understand that OrdKeyGoTo() works with dbfcdx RDD even when there is no index and with ADS RDD it fails. When I made this change in 2009 I am sure it was working and at that time most of my applications were using ADSCDX. If you are using Harbour we need to check with xHarbour version also. Surprisingly it appears these functions are working: AdsGetRelKeyPos AdsSetRelKeyPos AdsGetKeyCount Theoretically, these functions also should depend on the index still they work. Interestingly there is AdsGetKeyPos() function in ACE but no comparable function to OrdKeyGoTo() I suggest you please continue with the change we proposed earlier. I study both xHarbour and Harbour versions of the RDD source and also Advantage documentation and implement a dependable solution. [/quote:19v8hfyt] That dependable solution was never provided. Tim
xbrowse / ADS failure
We need Rao help on this
xbrowse / ADS failure
Did you get in touch with him ?
xbrowse / ADS failure
Mr Tim I'll get back on this very soon
xbrowse / ADS failure
Resolved in FWH 15.10 Please see <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=31485&p=184767#p184767">viewtopic.php?f=3&t=31485&p=184767#p184767</a><!-- l -->
xbrowse / problemas con checkbox
Buenos dias, Tengo un array con uno de los campos declarados como logico. a:= { { "","",0, .f.}} al arrancar el programa me lo muestra bien como lo defino aca: [code=fw:3ms5212u]<div class="fw" id="{CB}" style="font-family: monospace;">    WITH OBJECT :<span style="color: #000000;">acols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span><br />         :<span style="color: #000000;">cHeader</span>      := <span style="color: #ff0000;">""</span><br />         :<span style="color: #000000;">oheaderfont</span>   := oFont<br />         :<span style="color: #000000;">addresource</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"BMPSI"</span> <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">addresource</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"BMPNO"</span> <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">setcheck</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ON"</span>, <span style="color: #ff0000;">"OFF"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">bBmpdata</span>     := <span style="color: #000000;">&#123;</span> ||  <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aarraydata</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      END WITH</div>[/code:3ms5212u] [url:3ms5212u]https&#58;//drive&#46;google&#46;com/file/d/1OfIntZ176WnO_a6vpqyDPBC7Q_co78TG/view?usp=sharing[/url:3ms5212u] pero cuando RECARGO el array y hago un refresh del xbrowse me muestra de esta manera (.f. mas el cuadradito del checkbox) [url:3ms5212u]https&#58;//drive&#46;google&#46;com/file/d/1nGVIEgt6BIdNgM_C5nxvRZXInkCazWbd/view?usp=sharing[/url:3ms5212u] que puede estar pasando? ya verifique y el array contiene un dato logico. Gracias.
xbrowse / problemas con checkbox
Hola Probaste con: [code=fw:2glc7wm2]<div class="fw" id="{CB}" style="font-family: monospace;">:<span style="color: #000000;">bStrData</span>   := <span style="color: #000000;">&#123;</span>|| <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span></div>[/code:2glc7wm2]
xbrowse / problemas con checkbox
[quote="MarioG":3lgv6dcp]Hola Probaste con: [code=fw:3lgv6dcp]<div class="fw" id="{CB}" style="font-family: monospace;">:<span style="color: #000000;">bStrData</span>   := <span style="color: #000000;">&#123;</span>|| <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span></div>[/code:3lgv6dcp][/quote:3lgv6dcp] si, pero me muestra un espacio (asi no tenga nada entre " " ) de todas maneras dejo de programar con el xbrowse, pierdo el hilo de las cosas cuando me topo con estos problemas. ahora en el xbrowser despues de hacer una lectura: define query oQry "select * from tbdatos" al hacer un oQry:refresh() y luego un obrw:refresh() no veo los cambios hasta que no haga click en alguno de los encabezados...
xbrowse / problemas con checkbox
Please do not change the array with oBrw:SetArray( aNewArray ) Change the array like this: [code=fw:ly97cvpq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">aArrayData</span> := aNewArray<br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:ly97cvpq]
xbrowse / problemas con checkbox
hola. Tampoco me funciono de esa forma.
xbrowse / problemas con checkbox
Gracias por tu información me ha sido de mucha ayuda
xbrowse 2010/12
Hi, The xbrowse class from 2010/12 refers to a TMySqlQuery WSeekplus method. Where can I find this? Thanks, Alex
xbrowse 2010/12
I have never used TMySql personally. But I know that XBrowse uses :WSeekPlus method. This is there since many versions of FWH. I also did not find this method in the TMySql class of either Harbour or xHarbour. I understand there are different versions of TMySql that are available and original contributor of this method could be using a version having this method. My personal advice is to override oBrw:bseek by your own codeblock using the methods available in your version of TMySql.
xbrowse 2010/12
Hi, I don't find any tmysql.prg or lib, anyone an idea what or where it is?
xbrowse 2010/12
According to my notes: You can download TMySQL library from <!-- m --><a class="postlink" href="http://wmormar.blogspot.com/">http://wmormar.blogspot.com/</a><!-- m --> Regards, James
xbrowse 2010/12
Hello you can find a tmysql inside contrib [x]Harbour folder Harbour contrib\hbmysql xHarbour contrib\mysql
xbrowse : Keydown()
Hello, In mine aplication , i have : oBrw:bkeyDown := {||....} So , i try to trigger an action for nkey 32 or 13 The problem is that in method keydown , this action is executed twice : [code:17rxjvyv] METHOD KeyDown&#40; nKey, nFlags &#41; CLASS TXBrowse if &#58;&#58;bKeyDown != nil Eval&#40; &#58;&#58;bKeyDown, nKey, nFlags &#41; endif do case case nKey == VK_UP // and other keys &#46;&#46;&#46;&#46;&#46;&#46;&#46; otherwise return Super&#58;KeyDown&#40; nKey, nFlags &#41; endcase return 0 [/code:17rxjvyv] Super:Keydown() executes also ::bKeydown I had to change it if ::bKeyDown = nil return Super:KeyDown( nKey, nFlags ) end Am i missing something ? Frank
xbrowse : Keydown()
I am sorry , but i saw : * Fix: Class TXBrowse Method KeyDown() was evaluating bKeyDown twice. Now it is ok. How is the method changed ? Frank
xbrowse : Keydown()
Frank, Please remove these three lines: [code:30szy9kr] if &#58;&#58;bKeyDown != nil Eval&#40; &#58;&#58;bKeyDown, nKey, nFlags &#41; endif [/code:30szy9kr]
xbrowse : Order column with color
Hello,Working with xbrowse , i try to give the column with order (ocol:corder is 'A' or 'D') a color to make it more visible.[code:3rrtfjkv] #include "FiveWin&#46;ch" #include "xbrowse&#46;ch" #define CLR_1 nRGB&#40; 190, 215, 190 &#41; #define CLR_2 nRGB&#40; 230, 230, 230 &#41; function Main&#40;&#41; local oDlg, oBrw , oCol DEFINE DIALOG oDlg SIZE 300, 200 @ 0, 0 XBROWSE oBrw OF oDlg ARRAY &#123; &#123; "one","two","three" &#125; , &#123;"aOne","ztwo","bthree"&#125;&#125; AUTOCOLS AUTOSORT FOR EACH oCol IN oBrw&#58;aCols oCol&#58;bClrStd &#58;= &#123;||&#123;CLR_BLACK, iif&#40; oBrw&#58;nArrayAt % 2 = 0, CLR_1, CLR_2 &#41; + IIF&#40;oCol&#58;cOrder="A",2000,IIF&#40;oCol&#58;cOrder="D",-1000,0&#41;&#41;&#125;&#125; NEXT //oBrw&#58;Swapcols&#40;1,2,&#46;T&#46;&#41; oBrw&#58;CreateFromCode&#40;&#41; oBrw&#58;bKeyDown = &#123; || oDlg&#58;SetText&#40; Str&#40; oBrw&#58;nColSel &#41; &#41; &#125; ACTIVATE DIALOG oDlg CENTER ON INIT &#40; oDlg&#58;oClient &#58;= oBrw, oDlg&#58;Resize&#40;&#41; &#41; return nil [/code:3rrtfjkv]This works , BUT the code is wrong when tho columns are swapped or when a column is moved (clicking and dragging in the header)What is wrong ? maybe something in the code from fivewin ?Frank
xbrowse : Order column with color
Hello Frank,To show the active indexed Column, I only changed the Header-color ( also you can show a symbol ),because inside the data, there can be a cell-color change.With this solution, you can change the col-position without problems.If you need a sample, i can make a copy of the application-xbrowse-partbelongs to the color-change.RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xbrowse : Order column with color
[quote="ukoenig":3u3u2iey]Hello Frank, To show the active indexed Column, I only changed the Header-color ( also you can show a symbol ), because inside the data, there can be a cell-color change. With this solution, you can change the col-position without problems. If you need a sample, i can make a copy of the application-xbrowse-part belongs to the color-change. Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->[/quote:3u3u2iey]UweMy main concern is : why does this code doesn't work , wrong code or wrong code from fivewin ?Maybe you could test to confirm the problem ?Frank
xbrowse : Order column with color
Hello Frank,I got your source and will check it with a sample of mine.RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xbrowse : Order column with color
Hello Frank, the promised source. Because it is possible to change the Col-position, you have to find the new position with < oBrw:nAt >for the col-painting and action. How it works : You can click on the Data and the Col changes the color. Inside the function : PAINT_COL(oBrw, nPos), You can define any action ( Changing Index ... ) belongs to the column-title. In this sample i moved col 3 to position 2 and changed the color.I hope it helps. [img:2t7kf6t4]http&#58;//www&#46;pflegeplus&#46;com/pictures/colmove&#46;jpg[/img:2t7kf6t4][code:2t7kf6t4] #include "FiveWin&#46;ch" #include "xbrowse&#46;ch" #define WID 300 #define HGT 150 REQUEST DBFCDX function Main&#40;&#41; local oDlg, oBrw , oCol, nFor DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-18 DEFINE DIALOG oDlg SIZE 2*WID,2*HGT PIXEL FONT oFont aValues &#58;= &#123; &#123; "one","two","three" &#125; , &#123;"aOne","ztwo","bthree"&#125; &#125; oBrw &#58;= TXBrowse&#40;&#41;&#58;new&#40; oDlg &#41; WITH OBJECT oBrw &#58;nTop &#58;= INT&#40;HGT/2&#41;+5 &#58;nLeft &#58;= 10 &#58;nBottom &#58;= HGT-10 &#58;nRight &#58;= WID-10 &#58;SetArray&#40; aValues, &#46;f&#46; &#41; END FOR nFor &#58;= 1 to LEN&#40; oBrw&#58;aCols &#41; // set the basic-color // ------------------------- oBrw&#58;aCols&#91;nFor&#93;&#58;bClrStd &#58;= &#123; || &#123; 0, 16054371 &#125; &#125; oBrw&#58;aCols&#91; nFor &#93;&#58;blDClickData &#58;= ; &#123;|r,c,f,o| &#40; Msginfo&#40; o&#58;cHeader &#41;, PAINT_COL&#40;oBrw,oBrw&#58;nAt&#41;&#41; &#125; NEXT oBrw&#58;CreateFromCode&#40;&#41; ACTIVATE DIALOG oDlg CENTER ON INIT &#40; oDlg&#58;oClient &#58;= oBrw, oDlg&#58;Resize&#40;&#41; &#41; RETURN NIL // ------------------------ FUNCTION PAINT_COL&#40;oBrw, nCol&#41; LOCAL nFor FOR nFor &#58;= 1 to LEN&#40; oBrw&#58;aCols &#41; // refresh the basic-color // -------------------------- oBrw&#58;aCols&#91;nFor&#93;&#58;bClrStd &#58;= &#123; || &#123; 0, 16054371 &#125; &#125; // paint new Col-color // ---------------------- IF nCol = 1 oBrw&#58;aCols&#91;1&#93;&#58;bClrStd &#58;= &#123; || &#123; 16054371,128 &#125; &#125; // Your action ENDIF IF nCol = 2 oBrw&#58;aCols&#91;2&#93;&#58;bClrStd &#58;= &#123; || &#123; 16054371,128 &#125; &#125; // Your action ENDIF IF nCol = 3 oBrw&#58;aCols&#91;3&#93;&#58;bClrStd &#58;= &#123; || &#123; 16054371,128 &#125; &#125; // Your action ENDIF NEXT RETURN NIL [/code:2t7kf6t4]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xbrowse : Order column with color
Uwe ,Ok , it is an intresting example how to change a column color on clicking on the data. It works also when columns are moved. But mine goal is to give in a array (AUTOSORT , incrimental search) the order column (oCol:cOrder = 'A' or 'D') a color , trying to use :[code:xtnvurcr] FOR EACH oCol IN oBrw&#58;aCols oCol&#58;bClrStd &#58;= &#123;||&#123;CLR_BLACK, iif&#40; oBrw&#58;nArrayAt % 2 = 0, CLR_1, CLR_2 &#41; + &#58; IIF&#40;oCol&#58;cOrder="A",2000,IIF&#40;oCol&#58;cOrder="D",-1000,0&#41;&#41;&#125;&#125; NEXT [/code:xtnvurcr]I don't understand why this code doesn't work when two columns are swapped (uncomment line oBrw:Swapcols(1,2,.T.) ) or moved (clicking and draging in the header). You will see that a wrong column has the color for ordered column.I will try to test using a function like your paint_Col()Frank
xbrowse : Order column with color Partialy solved
Hello,Sorry , i did not had the intention to start a new thread , see also the previous one[code:2qo1scdv] #include "FiveWin&#46;ch" #include "xbrowse&#46;ch" #define CLR_1 nRGB&#40; 190, 215, 190 &#41; #define CLR_2 nRGB&#40; 230, 230, 230 &#41; function Main&#40;&#41; local oDlg, oBrw , oCol DEFINE DIALOG oDlg SIZE 300, 200 @ 0, 0 XBROWSE oBrw OF oDlg ARRAY &#123; &#123; "one","two","three" &#125; , &#123;"aOne","ztwo","bthree"&#125;&#125; AUTOCOLS AUTOSORT oBrw&#58;Swapcols&#40;1,2,&#46;T&#46;&#41; FOR EACH oCol IN oBrw&#58;aCols oCol&#58;bClrStd &#58;= &#123;||&#123;CLR_BLACK, iif&#40; oBrw&#58;nArrayAt % 2 = 0, CLR_1, CLR_2 &#41; + ; IIF&#40;oCol&#58;cOrder="A",2001,IIF&#40;oCol&#58;cOrder="D",-1000,0&#41;&#41;&#125;&#125; NEXT oBrw&#58;CreateFromCode&#40;&#41; oBrw&#58;bKeyDown = &#123; || oDlg&#58;SetText&#40; Str&#40; oBrw&#58;nColSel &#41; &#41; &#125; ACTIVATE DIALOG oDlg CENTER ON INIT &#40; oDlg&#58;oClient &#58;= oBrw, oDlg&#58;Resize&#40;&#41; &#41; return nil [/code:2qo1scdv]Note that Swapcol comes before giving oCol:bClrStd his value.IT IS NOT SOLVED WHEN THE USER MOVES COLUMNS (Clicking and dragging on the header).I hope somone can explain why this doesn't work in this case , or in the case oBrw:Swapcols() comes after asigning oCol:bClrStd.Frank
xbrowse : Order column with color Partialy solved
Hello Frank,I wanted to compile your sample, but there are errors.I couldn't test it ( FWH 8.09 ).[code:3toreypl] Error occurred at&#58; 11/02/08, 12&#58;42&#58;13 Error description&#58; Error BASE/1084 Argument error&#58; / Args&#58; &#91; 1&#93; = N 82 &#91; 2&#93; = U Stack Calls =========== Called from&#58; &#46;\source\classes\XBROWSE&#46;PRG => &#40;b&#41;TXBROWSE&#58;TXBROWSE&#40;0&#41; Called from&#58; => TXBROWSE&#58;ROWCOUNT&#40;0&#41; Called from&#58; &#46;\source\classes\XBROWSE&#46;PRG => TXBROWSE&#58;REFRESH&#40;0&#41; Called from&#58; &#46;\source\classes\XBROWSE&#46;PRG => TXBRWCOLUMN&#58;SORTARRAYDATA&#40;0&#41; Called from&#58; &#46;\source\classes\XBROWSE&#46;PRG => &#40;b&#41;TXBROWSE&#58;SETARRAY&#40;0&#41; Called from&#58; => AEVAL&#40;0&#41; Called from&#58; &#46;\source\classes\XBROWSE&#46;PRG => TXBROWSE&#58;SETARRAY&#40;0&#41; Called from&#58; &#46;\source\classes\XBROWSE&#46;PRG => XBRWSETDATASOURCE&#40;0&#41; Called from&#58; &#46;\source\classes\XBROWSE&#46;PRG => XBROWSENEW&#40;0&#41; Called from&#58; &#46;\backgrd&#46;PRG => MAIN&#40;8&#41; // Line 8 // ------- @ 0, 0 XBROWSE oBrw OF oDlg ARRAY &#123; &#123; "one","two","three" &#125; , &#123;"aOne","ztwo","bthree"&#125;&#125; AUTOCOLS AUTOSORT [/code:3toreypl]It seems you want to change the col-colors like the screeshot ?[img:3toreypl]http&#58;//www&#46;pflegeplus&#46;com/pictures/colmove1&#46;jpg[/img:3toreypl]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xbrowse : Order column with color Partialy solved
Uwe ,I am using fwh8.10 , and indeed there where changes in the code from xbrowse , as a result from some errors i reported.You can follow up the discussion between me and antonio in the forum , but i suppose only one change must be made in xbrowse , method refresh :if nKeyNo >= ::nLen .and. ::nLen > 1 .AND. ::lCreated ::nRowSel := Min( nKeyNo, ::RowCount() )endifFrank
xbrowse : Preventing hScrolling
HelloI have a xbrowse , the browse fit the area which is defined in the rc-file (all columns are visible)Navigating with right arrow , and reaching the last column , the browse scrolls horizontal to left , creating a blanco column to the right. The fist column becomes not visibleCan it be prevented ? oBrw:lHscroll is .F. , there is no horizontal scrollbar Frank
xbrowse : Preventing hScrolling
Demont:Try withoBrw:nFreeze := LastColumnVisibleNumberRegards
xbrowse : Preventing hScrolling
Frank,Have you tested it with FWH 8.05 ?It should work fine.
xbrowse : SeekOnArray
Hello, When in a array autosort is on (incrimental search !) and two colums(search column) are swapped nAt := Ascan( aData, {|v| Upper( cValToChar( v[ nFor ] ) ) = cSeek } ) must be changed in : nAt := Ascan( aData, {|v| Upper( cValToChar( v[ aCols[ nFor ]:nCreationOrder ] ) ) = cSeek } ) Frank
xbrowse : SeekOnArray
Frank, Fixed. Thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xbrowse : bchange is executed twice in lButtondown
Hello,I have a problem with wbrose , using bChangeIn this version bChange is executed twice , after linking in i can see that bChange is executed in lButtondown 1) on line 2645if nRowPos > 0 ::Skip( nRowPos - ::nRowSel ) // Eval( ::bSkip, nRowPos - ::nRowSel ) ::nRowSel := nRowPos ::Change( .t. ) <----------- 2645endif2) on line 2669This error was already present in 8.01. Looking in the source i can see the changes i made already (but was forgotten)I introduced a local var # ifdef FRANKDEMONT local lChangExecuted := .F. # endifWhich is changed when bChange is executed (line 2646)The ::change(.T.) on line 2669 is only executed when lChangeExecuted is .F.Maybe there is a better solution ????
xbrowse : bchange is executed twice in lButtondown
Frank,It is simpler if we remove the call to ::Change( .t. ) from line 2669 as it is already called from line 2645.Thanks for your feedback! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xbrowse : bchange is executed twice in lButtondown
[quote="Antonio Linares":1y470i5x]Frank, It is simpler if we remove the call to ::Change( .t. ) from line 2669 as it is already called from line 2645. Thanks for your feedback! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:1y470i5x]What if NOT nRowpos > 0 ? Change() would not be executed !Frank
xbrowse : bchange is executed twice in lButtondown
Will this be okay?[code:11p83k6k] if nRowPos > 0 &#46;and&#46; nRowPos != &#58;&#58;nRowSel &#58;&#58;Skip&#40; nRowPos - &#58;&#58;nRowSel &#41; &#58;&#58;nRowSel &#58;= nRowPos if nColPos > 0 &#58;&#58;nColSel &#58;= nColPos endif &#58;&#58;Change&#40; &#46;t&#46; &#41; else if nColPos > 0 &#46;and&#46; nColPos != &#58;&#58;nColSel &#58;&#58;nColSel &#58;= nColPos &#58;&#58;Change&#40; &#46;f&#46; &#41; endif endif [/code:11p83k6k]And remove the ::Change( .t. ) at the end ( just before oVSroll present line 2669 )
xbrowse : bchange is executed twice in lButtondown
nRowPos is only zero for the header, and the header will not change for skipping records.So IMO it is fine if we simply remove the extra call to ::Change(). Unless I am missing something <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xbrowse : enhancement inline editing
Hello,Using the in line editing possibility's from fw , i see some problems :1) In all mine dialog's i use a self made comboclass (xbrowse , btnget)In xbrowse i have to use the fwh combo class . Only get and listbox are possible NO CHECKBOX ,BTNGET , DTEPICKER , BUTTON .........2) bWhen ???????3) Editing one cell , this must be written in the dbf. So we have one cyclus from rlock / append , dbunlock.This cyclus is designed for : lock one record , edit all the fields and then write , not for one field.3) ESCAPE works only on the current cell , not on the cells edited on the same rowEach from this points can be avoided :1) The columns from the obrowse which should be edited :Define the obj's as all the others from the dialog , checkbox , button , ... is possible . Also VALID , WHEN , FONT , ......Last column : a checkbox or button as OK button (write the data)ON INIT , hide this object's2) oBrw:bKeydown and oBrw:lDoubleClick are set to activate this objects , and to deasactivate all the othersThe column objects are moved and resized as needed3) Activating the OK button (or checkbox) write the data in the browse and dbf . Pressing escape before this button cancel the operation.The column objects are hidden , others enabledMaybe the code must be better designed , but i have a working example.Works also when columns are scrolled , or when columns are changed.Can be send on demand , or when someone is intrested , published here (only 400 lines off code + rc.file and some bmp-file (from fw directory) ).Frank
xbrowse : enhancement inline editing
Frank,Will you be so kind to publish your code here ? many thanksAlso a download url for a working EXE would be of a great help. Thanks!
xbrowse : enhancement inline editing
XBROWSE : INLINE EDITING1) For each column which must be edited , add this control to your dialog with the same syntax from the other controls oCol:bOnPostEdit can be set. If not it receives a default value (only browse is updated) Can also be set with SetPostEdit(oBrw,Arrayindex,Fieldindex) In your browse add a column (Logical value , set on .T.) and define a checkbox and ON CHANGE as in EditDbf (line 122) Not tested , but a button should also be possible2) Set oBrw:bPastEof() , oBrw:lDblClick and obrw:bKeydown (see EditDbf.prg , prg-file , line +/- 130)3) On init hide the controls from the browseEditing a row can be interupted with EscapeChanges are only written with the OK checkboxThat is allFrank DemontNotesFastedit mode is only activated when also oCol:nEdittype is setFrom all other data used to edit the column is only bPostEdit used[code:1nyzi7qm] # include "fivewin&#46;ch" # include "xbrowse&#46;ch" # include "Common&#46;ch" # include "dtpicker&#46;ch" # define CLR_1 nRGB&#40; 190, 215, 190 &#41; # define CLR_2 nRGB&#40; 230, 230, 230 &#41; FUNCTION MAIN&#40;cDbfFile&#41; *********************** LOCAL aStruct , lTest &#58;= &#46;F&#46; LOCAL i , j LOCAL aCountry LOCAL oWnd , oBmp IF IsNil&#40;cDbfFile&#41; cDbfFile &#58;= "Demo&#46;Dbf" lTest &#58;= &#46;T&#46; END IF ! "&#46;" IN cDbfFile cDbfFile += "&#46;dbf" END IF ! File&#40;cDbfFile&#41; aStruct &#58;= &#123;&#123;"Name","C",25,0&#125;,&#123;"Number","N",10,2&#125;,&#123;"Country","C",3,0&#125;,&#123;"Maried","L",1,0&#125;,&#123;"Date","D",8,0&#125;&#125; DbCreate&#40;cDbfFile,aStruct&#41; USE &#40;cDbfFile&#41; aCountry &#58;= &#123;"BE ","NL ","FR "&#125; j &#58;= 1 FOR i &#58;= 1 TO 20 APPEND BLANK REPL FIELD->Name WITH PAD&#40;"Name " + LTRIM&#40;STR&#40;i&#41;&#41;,25&#41; REPL FIELD->Number WITH i*1000 REPL FIELD->Country WITH aCountry&#91;j++&#93; REPL FIELD->Maried WITH &#40; i%2 == 0 &#41; REPL FIELD->Date WITH Date&#40;&#41; + i IF j > 3 j &#58;= 1 END NEXT USE END USE &#40;cDbfFile&#41; SHARED DEFINE WINDOW oWnd TITLE "Edit Dbf" ; MENU BuildMenu&#40; oWnd &#41; MDI ; MENUINFO 3 DEFINE BITMAP oBmp RESOURCE "Background" SET MESSAGE OF oWnd TO FWVERSION + ", " + FWCOPYRIGHT CENTERED TIME DATE oWnd&#58;bPainted = &#123; | hDC | BmpTiled&#40; hDC, oWnd, oBmp &#41; &#125; ACTIVATE WINDOW oWnd return nil //----------------------------------------------------------------------------// function BuildMenu&#40; oWnd &#41; local oMenu MENU oMenu MENUITEM "Edit Dbf"; ACTION EditDbf&#40; oWnd &#41; ENDMENU return oMenu CLOS ALL RETURN ******************************************************************************************************************************** PROC EditDbf&#40;oWnd&#41; ************** LOCAL Arr&#91;0&#93; LOCAL oDlg , oBrw , oBut LOCAL aObj&#91;3&#93; LOCAL i LOCAL el &#58;= &#123;SPACE&#40;25&#41;,1000,"BE ", &#46;T&#46; , Date&#40;&#41; , &#46;T&#46; &#125; LOCAL aCountry &#58;= &#123;"BE ","NL ","FR "&#125; LOCAL lNieuw &#58;= &#46;F&#46; ReadDbfData&#40;Arr&#41; DEFINE DIALOG oDlg RESOURCE "TEST" OF oWnd oBrw &#58;= TXBrowse&#40;&#41;&#58;New&#40; oDlg &#41; //oBrw &#58;= TXBrowse&#40;&#41;&#58;New&#40; oWnd &#41; oBrw&#58;CreateFromResource&#40; 101 &#41; oBrw&#58;nMarqueeStyle &#58;= 3 //Highlight row //MARQSTYLE_HIGHLCELL oBrw&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;lHScroll &#58;= &#46;F&#46; ////oBrw&#58;lColDividerComplete &#58;= &#46;t&#46; oBrw&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLACK, iif&#40; oBrw&#58;nArrayAt&#40;&#41; % 2 = 0, CLR_1, CLR_2 &#41; &#125; &#125; oBrw&#58;bClrSelFocus &#58;= &#123;||&#123;CLR_WHITE, CLR_GREEN&#125;&#125; oBrw&#58;nArrayAt &#58;= 1 oBrw&#58;nRowSel &#58;= 1 oBrw&#58;nRowHeight &#58;= 25 //oBrw&#58;nRowHeight*1&#46;2 oBrw&#58;lFastEdit &#58;= &#46;T&#46; oBrw&#58;SetArray&#40; Arr &#41; FOR i &#58;= 1 TO LEN&#40;Arr&#91;1&#93;&#41; oBrw&#58;aCols&#91; i &#93;&#58;cHeader = Field&#40;i&#41; IF IsLogical&#40;Arr&#91;1,i&#93;&#41; oBrw&#58;aCols&#91; i &#93;&#58;nWidth = 20 MakeBitmapCol&#40;oBrw,i&#41; END NEXT ATAIL&#40;oBrw&#58;aCols&#41;&#58;Hide&#40;&#41; IF ! __ObjHasData&#40;oBrw&#58;aCols&#91;1&#93;,"OBRWOBJ"&#41; __OBJADDDATA&#40;oBrw&#58;aCols&#91;1&#93;,"oBrwObj"&#41; END __objModMethod&#40;oBrw&#58;aCols&#91;1&#93;,"Edit",@ActivateoBrwDlg&#40;oBrw , oDlg&#41;&#41; REDEFINE GET oBrw&#58;aCols&#91;1&#93;&#58;oBrwObj VAR el&#91;1&#93; ID 100 OF oDlg VALID ! EMPTY&#40;el&#91;1&#93;&#41; oBrw&#58;aCols&#91; 1 &#93;&#58;nEditType &#58;= 1 // Fastedit works only when set!!! REDEFINE GET oBrw&#58;aCols&#91;2&#93;&#58;oBrwObj VAR el&#91;2&#93; ID 105 OF oDlg PICTURE "9999999&#46;99" oBrw&#58;aCols&#91; 2 &#93;&#58;nWidth = 80 oBrw&#58;aCols&#91; 2 &#93;&#58;nEditType &#58;= 1 // Fastedit !!! REDEFINE COMBOBOX oBrw&#58;aCols&#91;3&#93;&#58;oBrwObj VAR el&#91;3&#93; ITEMS aCountry; ID 110 OF oDlg REDEFINE CHECKBOX oBrw&#58;aCols&#91;4&#93;&#58;oBrwObj VAR el&#91;4&#93; ID 120 OF oDlg oBrw&#58;aCols&#91; 5 &#93;&#58;nWidth = 100 REDEFINE DTPICKER oBrw&#58;aCols&#91;5&#93;&#58;oBrwObj VAR el&#91;5&#93; ID 130 OF oDlg oBrw&#58;aCols&#91; 6 &#93;&#58;cHeader = "OK" oBrw&#58;aCols&#91; 6 &#93;&#58;nWidth = 38 REDEFINE CHECKBOX oBrw&#58;aCols&#91;6&#93;&#58;oBrwObj VAR el&#91;6&#93; ID 140 OF oDlg; ON CHANGE &#123;||IIF&#40;oBrw&#58;aCols&#91;6&#93;&#58;oBrwObj&#58;Varget&#40;&#41;,SaveoBrwDlg&#40;oBrw,@lNieuw,oDlg,oBut&#41;,&#41;&#125; oBrw&#58;aCols&#91;6&#93;&#58;Hide&#40;&#41; FOR i &#58;= 1 TO FCOUNT&#40;&#41; SetPostEdit&#40;oBrw,i,i&#41; NEXT OBrw&#58;bPastEof&#40;&#41; &#58;= &#123;|| IIF&#40; NewoBrwDlg&#40;oBrw , @lNieuw&#41; , &#40;Sysrefresh&#40;&#41; , ActivateoBrwDlg&#40;oBrw , oDlg&#41;&#41; , &#41; &#125; oBrw&#58;bLDblClick &#58;= &#123;||ActivateoBrwDlg&#40;oBrw , oDlg&#41;&#125; oBrw&#58;bkeyDown &#58;= &#123; | nkey |IIF&#40;nkey==13 , ActivateoBrwDlg&#40;oBrw , oDlg&#41; , IIF&#40;nKey==VK_DELETE , WisoBrwDlg&#40;oBrw , @lNieuw&#41; , &#41; &#41; &#125; REDEFINE BUTTON oBut ID 300 OF oDlg ACTION oDlg&#58;End&#40;&#41;// WHEN ! lNieuw ACTIVATE DIALOG oDlg ; ON INIT &#40; AEVAL&#40;oBrw&#58;aCols,&#123;|oCol|IIF&#40;IsObJect&#40;oCol&#58;oBrwObj&#41;,oCol&#58;oBrwObj&#58;Hide&#40;&#41;,&#41; &#125;&#41; &#41;; VALID IIF&#40;GETKEYSTATE&#40;VK_ESCAPE&#41; , &#40; ActivateDlg&#40;oDlg,oBrw,oBut,@lNieuw&#41; , &#46;F&#46;&#41; , &#46;T&#46; &#41; RETURN ******************************************************************************************************************************** PROC ReadDbfData&#40;Arr&#41; ********************* LOCAL b , i GO TOP DO WHIL ! EOF&#40;&#41; b &#58;= &#123;&#125; FOR i &#58;= 1 TO FCOUNT&#40;&#41; AADD&#40;b,Fieldget&#40;i&#41;&#41; NEXT AADD&#40;b,&#46;T&#46;&#41; AADD&#40;b,Recno&#40;&#41;&#41; AADD&#40;Arr,b&#41; SKIP END RETURN ******************************************************************************************************************************** PROC SetPostEdit&#40;oBrw,i,j&#41; ************************** // i &#58; Arrayindex , j &#58; Field Index oBrw&#58;aCols&#91;i&#93;&#58;bOnPostEdit &#58;= &#123;|o | x &#58;= o&#58;oBrwObj&#58;Varget&#40;&#41; , oBrw&#58;aArrayData&#91; oBrw&#58;nArrayAt, i &#93; &#58;= x , IIF&#40;IsNil&#40;j&#41;,,FieldPut&#40;j,x&#41;&#41; &#125; RETURN ***************************************************************************************************** PROC MakeBitmapCol&#40;oBrw,i&#41; *************************** LOCAL oCol LOCAL x oCol &#58;= oBrw&#58;aCols&#91;i&#93; oCol&#58;AddResource&#40;"CHECKON"&#41; oCol&#58;AddResource&#40;"CHECKOFF"&#41; x &#58;= LEN&#40;oCol&#58;aBitMaps&#41; oCol&#58;bBmpData &#58;= &#123;||IIF&#40;IsLogical&#40;oBrw&#58;aArrayData&#91;oBrw&#58;nArrayAt,i&#93;&#41; , IIF&#40;oBrw&#58;aArrayData&#91;oBrw&#58;nArrayAt,i&#93;,x-1,x&#41;,0&#41;&#125; oCol&#58;bStrData &#58;= &#123;||" "&#125; RETURN ****************************************************************************************************** FUNC NewoBrwDlg&#40;oBrw , lNieuw &#41; ****************************** LOCAL Arr &#58;= &#123;&#125; LOCAL x LOCAL i IF lNieuw RETURN &#46;F&#46; END GO 9999999 // EOF&#40;&#41; ! Arr &#58;= &#123;&#125; FOR i &#58;= 1 TO FCOUNT&#40;&#41; x &#58;= Fieldget&#40;i&#41; IF ValType&#40;x&#41; = "D" x &#58;= Date&#40;&#41; END AADD&#40;Arr , x&#41; NEXT AADD&#40;Arr,&#46;T&#46;&#41; // Ok checkbox AADD&#40;Arr,0&#41; // RecNr 0 , record will be appended when the ok checkbox is clicked AADD&#40;oBrw&#58;aArrayData,Arr&#41; oBrw&#58;GoBottom&#40;&#41; oBrw&#58;Refresh&#40;&#41; lNieuw &#58;= &#46;T&#46; RETURN &#46;T&#46; ***************************************************************************** PROC WisoBrwDlg&#40;oBrw , lNieuw&#41; ********************************* LOCAL Nr &#58;= oBrw&#58;NarrayAt LOCAL RecNr &#58;= ATAIL&#40;oBrw&#58;aArrayData&#91;Nr&#93;&#41; DbGoto&#40;RecNr&#41; IF RLOCK&#40;&#41; DbDelete&#40;&#41; DbUnlock&#40;&#41; aDel&#40;oBrw&#58;aArrayData,Nr,&#46;T&#46;&#41; oBrw&#58;nArrayAt &#58;= MIN&#40;Nr,LEN&#40;oBrw&#58;aArraydata&#41;&#41; oBrw&#58;Refresh&#40;&#41; IF lNieuw lNieuw &#58;= &#46;F&#46; END END RETURN ********************************************************** PROC SaveoBrwDlg&#40;oBrw , lNieuw , oDlg , oBut&#41; ********************************************** LOCAL Nr &#58;= oBrw&#58;nArrayAt LOCAL RecNr &#58;= ATAIL&#40;oBrw&#58;aArrayData&#91;Nr&#93;&#41; LOCAL oCol , i LOCAL lOk &#58;= &#46;F&#46; FOR EACH oCol IN oBrw&#58;aCols IF IsObject&#40;oCol&#58;oBrwObj&#41; &#46;AND&#46; IsBlock&#40;oCol&#58;oBrwObj&#58;bValid&#41; &#46;AND&#46; ! EVAL&#40;oCol&#58;oBrwObj&#58;bValid&#41; oCol&#58;oBrwObj&#58;SetFocus&#40;&#41; RETURN END NEXT IF lNieuw IF ! DBAPPEND&#40;&#41; RETURN END RecNr &#58;= RecNo&#40;&#41; ATAIL&#40;oBrw&#58;aArrayData&#91;Nr&#93;&#41; &#58;= RecNr END DbGoto&#40;RecNr&#41; FOR EACH oCol IN oBrw&#58;aCols IF IsObject&#40;oCol&#58;oBrwObj&#41; &#46;AND&#46; IsBlock&#40;oCol&#58;bOnPostEdit&#41; i &#58;= Hb_EnumIndex&#40;&#41; EVAL&#40;oCol&#58;bOnPostEdit,oCol&#41; END NEXT oBrw&#58;DrawLine&#40;&#46;t&#46;&#41; DbCommit&#40;&#41; DbGoto&#40;recnr&#41; lNieuw &#58;= &#46;F&#46; DBUNLOCK&#40;&#41; ActivateDlg&#40;oDlg,oBrw,oBut,&#46;F&#46;,@lNieuw&#41; oBrw&#58;SetFocus&#40;&#41; RETURN ******************************************************************************************************************************** PROC ActivateoBrwDlg&#40;oBrw,oDlg&#41; ******************************* LOCAL nRow LOCAL nCol lOCAL nWidth LOCAL nHeight LOCAL Nr //&#58;= oBrw&#58;nArrayAt LOCAL nKol //&#58;= oBrw&#58;nColSel LOCAL x LOCAL oCol , i , Obj , Gehi LOCAL RecNr LOCAL aDisPlay LOCAL Self &#58;= HB_QSelf&#40;&#41; , cKey , nKey IF ! IsNil&#40;Self&#41; nKey &#58;= IIF&#40;IsNumber&#40;oBrw&#41;,oBrw,nil&#41; oBrw &#58;= Self&#58;oBrw oDlg &#58;= oBrw&#58;oWnd IF isnumber&#40;nKey&#41; cKey &#58;= Chr&#40; nKey &#41; END END Nr &#58;= oBrw&#58;nArrayAt nKol &#58;= oBrw&#58;nColSel RecNr &#58;= ATAIL&#40;oBrw&#58;aArraydata&#91;Nr&#93;&#41; IF RecNr > 0 DbGoto&#40;RecNr&#41; IF ! RLOCK&#40;&#41; RETURN END END FOR EACH Obj IN oDlg&#58;aControls Obj&#58;Disable&#40;&#41; NEXT nRow &#58;= &#40; &#40; oBrw&#58;nRowSel - 1 &#41; * oBrw&#58;nRowHeight &#41; + oBrw&#58;HeaderHeight&#40;&#41; + 2 + oBrw&#58;nTop nHeight &#58;= oBrw&#58;nRowHeight - 4 aDisPlay &#58;= oBrw&#58;GetDisplayCols&#40;&#41; FOR EACH oCol IN oBrw&#58;aCols IF IsObject&#40;oCol&#58;oBrwObj&#41; i &#58;= Hb_EnumIndex&#40;&#41; WITH OBJECT oCol nCol &#58;= &#58;nDisPlayCol + 2 + oBrw&#58;nLeft nWidth &#58;= &#58;nWidth - 4 x &#58;= oBrw&#58;aArrayData&#91;Nr,oCol&#58;nCreationOrder&#93; If oCol&#58;cHeader = "OK" nCol &#58;= oBrw&#58;nWidth + oBrw&#58;nLeft + 2 x &#58;= &#46;F&#46; END IF __ObjHasMethod&#40;&#58;oBrwObj,"VARPUT"&#41; // BUTTON ??? &#58;oBrwObj&#58;Varput&#40;x&#41; &#58;oBrwObj&#58;Refresh&#40;&#41; END IF &#40;i IN aDisplay&#41; &#46;OR&#46; oCol&#58;cHeader = "OK" IF &#40;i IN aDisplay&#41; &#46;AND&#46; i == aDisplay&#91;1&#93; // Selected col &#40;or clicked&#41; is no edit column Obj &#58;= &#58;oBrwObj Gehi &#58;= i END &#58;oBrwObj&#58;Enable&#40;&#41; &#58;oBrwObj&#58;Move&#40;nRow, nCol, nWidth, nHeight, &#46;t&#46; &#41; &#58;oBrwObj&#58;Show&#40;&#41; IF IsNil&#40;&#58;bOnPostEdit&#41; SetPostEdit&#40;oBrw,i&#41; END IF i == nKol // Selected col &#40;or clicked&#41; Obj &#58;= &#58;oBrwObj Gehi &#58;= i END END END END NEXT IF ! IsNil&#40;Obj&#41; IF IsNumber&#40;Gehi&#41; &#46;AND&#46; IsNumber&#40;nKey&#41; oCol &#58;= oBrw&#58;aCols&#91;Gehi&#93; If oBrw&#58;lFastEdit &#46;and&#46; oBrw&#58;nMarqueeStyle <= MARQSTYLE_HIGHLCELL &#46;and&#46; ; oCol&#58;nEditType > 0 &#46;and&#46; ; &#40; IsAlpha&#40; cKey &#41; &#46;or&#46; IsDigit&#40; cKey &#41; &#46;or&#46; cKey == "-" &#41; IF __ObjHasMethod&#40;oCol&#58;oBrwObj,"VARPUT"&#41; // BUTTON ??? x &#58;= oBrw&#58;aArrayData&#91;Nr,oCol&#58;nCreationOrder&#93; IF IsCharacter&#40;x&#41; oCol&#58;oBrwObj&#58;bGotFocus &#58;= &#123;|self|Self&#58;Keychar&#40;cKey&#41; , Self&#58;oGet&#58;Pos &#58;= 2 , Self&#58;EditUpdate&#40;&#41; , self&#58;Setpos&#40;2&#41;,Self&#58;bGotFocus&#58;=nil&#125; ELSEIF IsNumber&#40;x&#41; IF &#40;48<=nKey &#46;AND&#46; nKey <= 57&#41; &#46;or&#46; cKey == "-" oCol&#58;oBrwObj&#58;bGotFocus &#58;= &#123;|self|Self&#58;Keychar&#40;cKey&#41; , Self&#58;oGet&#58;Pos &#58;= 2 , Self&#58;EditUpdate&#40;&#41; , self&#58;Setpos&#40;2&#41;,Self&#58;bGotFocus&#58;=nil&#125; oCol&#58;oBrwObj&#58;lClrFocus &#58;= &#46;T&#46; END END oCol&#58;oBrwObj&#58;Refresh&#40;&#41; END end END Obj&#58;Setfocus&#40;&#41; END RETURN ******************************************************************************************************************************** PROC ActivateDlg&#40;oDlg,oBrw,oBut,lNieuw&#41; *************************************** LOCAL oCol , i , Obj LOCAL Nr LOCAL RecNr IF oDlg&#58;aControls&#91;1&#93;&#58;lActive // Can give problems when this contol is a oCol&#58;oBrwObj !!!!!!! oBut&#58;Setfocus&#40;&#41; return END FOR EACH Obj IN oDlg&#58;aControls Obj&#58;Enable&#40;&#41; NEXT FOR EACH oCol IN oBrw&#58;aCols IF IsObject&#40;oCol&#58;oBrwObj&#41; oCol&#58;oBrwObj&#58;Hide&#40;&#41; END NEXT Nr &#58;= oBrw&#58;nArrayAt RecNr &#58;= ATAIL&#40;oBrw&#58;aArrayData&#91;Nr&#93;&#41; IF RecNr == 0 aDel&#40;oBrw&#58;aArrayData,Nr,&#46;T&#46;&#41; oBrw&#58;nLen &#58;= LEN&#40;oBrw&#58;aArrayData&#41; oBrw&#58;nArrayAt &#58;= MIN&#40;oBrw&#58;nArrayAt,oBrw&#58;nLen&#41; oBrw&#58;GoBottom&#40;&#41; oBrw&#58;Refresh&#40;&#41; lNieuw &#58;= &#46;F&#46; ELSE DbGoto&#40;RecNr&#41; DbUnlock&#40;&#41; END oBrw&#58;setFocus&#40;&#41; RETURN ********************************************************************************************** PROC Trace&#40;&#46;&#46;&#46;&#41; // Only to test ************* LOCAL i , el LOCAL tkst &#58;= "" LOCAL arr &#58;= HB_aParams&#40;&#41; , elem , hlp FOR EACH el IN arr IF Valtype&#40;el&#41; == "A" FOR EACH elem IN el hlp &#58;= cValToChar&#40;elem&#41; IF IsCharacter&#40;elem&#41; &#46;AND&#46; LEN&#40;elem&#41; == 1 &#46;AND&#46; ASC&#40;elem&#41; < 32 hlp &#58;= 'CHR&#40;'+LTRIM&#40;STR&#40;Asc&#40;elem&#41;&#41;&#41; + '&#41;' END tkst += CRLF + hlp NEXT ELSEIF ValType&#40;el&#41; == "H" FOR i &#58;= 1 TO LEn&#40;el&#41; hlp &#58;= cValToChar&#40;el&#91;i&#93;&#41; IF IsCharacter&#40;Hlp&#41; &#46;AND&#46; LEN&#40;Hlp&#41; == 1 &#46;AND&#46; ASC&#40;Hlp&#41; < 32 hlp &#58;= 'CHR&#40;'+LTRIM&#40;STR&#40;Asc&#40;Hlp&#41;&#41;&#41; + '&#41;' END tkst += CRLF + PAD&#40;HaaGetKeyAt&#40;el,i&#41;,10&#41; + " &#58; " + hlp NEXT ELSE tkst += CRLF + cValToChar&#40;el&#41; END NEXT i &#58;= 0 DO WHIL ! EMPTY&#40;PROCNAME&#40;i&#41;&#41; tkst += CRLF + PROCNAME&#40;i&#41; + " " + "Lijn &#58; " + LTRIM&#40;STR&#40;PROCLINE&#40;i&#41;&#41;&#41; i++ END ? tkst RETU //----------------------------------------------------------------// STATIC FUNCTION BmpTiled&#40; hDC, oWnd, oBmp &#41; local nWidth &#58;= oWnd&#58;nWidth&#40;&#41;, nHeight &#58;= oWnd&#58;nHeight&#40;&#41; local nRow &#58;= 0, nCol &#58;= 0, n local nBmpWidth &#58;= oBmp&#58;nWidth&#40;&#41;, nBmpHeight &#58;= oBmp&#58;nHeight&#40;&#41; if oBmp&#58;hBitmap == 0 return nil endif while nRow < nHeight nCol = 0 while nCol < nWidth PalBmpDraw&#40; hDC, nRow, nCol, oBmp&#58;hBitmap &#41; nCol += nBmpWidth end nRow += nBmpHeight end return nil ************************************************************** TEST DIALOG 6, 15, 450, 227 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "TXBrowse demo" FONT 8, "MS Sans Serif" &#123; CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 4, 5, 328 , 202 EDITTEXT 100 , 197 , 2, 20, 10, WS_BORDER | WS_TABSTOP EDITTEXT 105 , 197 , 2, 20, 10, WS_BORDER | WS_TABSTOP COMBOBOX 110, 8, 16, 72, 75, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP CHECKBOX " ", 120 , 230 , 235 , 80, 14, BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP //, 8192 CONTROL "", 130 , "SysDateTimePick32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP | DTS_SHOWNONE , 153, 108 , 55, 10 CHECKBOX "OK ", 140 , 230 , 235 , 32 , 14, BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP //, 8192 PUSHBUTTON "OK", 300 , 252, 211, 50, 14 &#125; CHECKON BITMAP "bitmap\Checkon&#46;bmp" CHECKOFF BITMAP "bitmap\Checkoff&#46;bmp" BACKGROUND BITMAP "bitmap\fiveback&#46;bmp" [/code:1nyzi7qm]
xbrowse : enhancement inline editing
Frank,I think most users expect browses to work like a spreadsheet and there is no concept of having to check a checkbox to get the data updated. Most users are going to be very confused by this.James
xbrowse : enhancement inline editing
James,For me is a row in a table a record. Editing it in a dialog we Lock the record , or append it Edit all the fields , with all kinds off controls , navigating with TAB or ENTER A ok button accepts the data , inviting the user to check before , writes the data and unlock . Escape should eliminate the changes from the data . You are right when you stated it is not the filosophy from excel, more these from Clipper (editing a record) In mine program editing a row is as editing a dialog . In DOS i was used to do that . The ok checkbox can maybe be discarded (updating after each field , as in oCol:edit from txbrowse) ) , but : LOCK , UNLOCK must for every field. Suppose that two users try to edit the same row . After editing the first field , the second can be blocked ESCAPE : only the editing field Navigating : No TAB or ENTERWhen a row is edited , i am convinced that the user has the intention to edit not only one cell , but also the othersThe greatest benefit is we can use all kinds off control , not only get and listboxFrank
xbrowse : enhancement inline editing
Frank,>For me is a row in a table a record. Editing it in a dialog we >Lock the record , or append it >Edit all the fields , with all kinds off controls , navigating with TAB or >ENTER >A ok button accepts the data , inviting the user to check before , writes >the data and unlock . Escape should eliminate the changes from the data.Agreed, or, as I usually use, "optimistic" locking; edit, lock, save, unlock. This means the record is only locked for a split second. >You are right when you stated it is not the filosophy from excel, more >these from Clipper (editing a record)We do have to keep the users expectations in mind when designing our programs. >In mine program editing a row is as editing a dialog . In DOS i was used >to do that . The ok checkbox can maybe be discarded (updating after >each field , as in oCol:edit from txbrowse) ) , but : >LOCK , UNLOCK must for every field. Suppose that two users try to edit >the same row . After editing the first field , the second can be blocked >ESCAPE : only the editing field >Navigating : No TAB or ENTER >When a row is edited , i am convinced that the user has the intention to >edit not only one cell , but also the others These are all valid issues, and this is why I do not generally allow users to edit browses directly but rather use a double-click to bring up a dialog. There are other reasons too. A row of data is often too long to display on the screen at one time, but it will all fit on a dialog. Data can be grouped in a dialog and all kinds of controls can be used. Regards,James
xbrowse : enhancement inline editing
I provided a download link at : <!-- m --><a class="postlink" href="http://rapidshare.com/files/115712013/ROWEDIT.ZIP.html">http://rapidshare.com/files/115712013/ROWEDIT.ZIP.html</a><!-- m -->Frank
xbrowse : ocol:bEditWhen
Hello, I try to use oCol:bEditWhen with oCol:nEditType := EDIT_BUTTON This works when in the cell to edit (editing not allowed) ENTER is pressed or Double clicked with the mouse IT IS NOT WORKING WHEN THE CELL BUTTON IS CLICKED !!!! FWH8.10 I can solve this , by dinamically setting nEditType to 0 or EDIT_BUTTON , but this gives problems with the layout from the cell , the text can be over written with the button Frank
xbrowse : ocol:bEditWhen
Frank, This may help: [code:s85exv9r] oBrw&#58;bLClicked &#58;= { | nRow, nCol | oBrw&#58;LDblClick( nRow, nCol ) } [/code:s85exv9r]
xbrowse : sporadic error
Hello, In a intensive used aplication i got sporadic (4 errors in 2 years) , at line 396 : METHOD ColAtPos( nPos ) INLINE ::aCols[ ::aDisplay[ MinMax( If( nPos == nil, 1, nPos ), 1, Len( ::aDisplay ) ) ] ] With : #xtranslate MinMax( <xValue>, <nMin>, <nMax> ) => ; Min( Max( <xValue>, <nMin> ), <nMax> ) The error indicates Error description: Error BASE/1132 Bound error: array access Args: [ 1] = A { ... } [ 2] = N 0 ColAtPos seems to be called with parameter 1. When Minmax returns 0 , it can only be declared as LEN(::aDisplay) == 0 I can simulate this error with hiding all the columns from the browse . It gives the same error , but the calllist is much longer. I have no idea how ::aDisplay can become empty , for this browe ocol:hide() is not used at all I note also that the error occurs always on the same computer ( network from +/- 10 computers) , so could it be a hardware problem ? Frank
xbrowse : sporadic error
I do get it very often: It is not a hardware problem. It happens randomly when painting xBrowse. [code=fw:134khs8m]<div class="fw" id="{CB}" style="font-family: monospace;">  Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1132</span>  Bound error: <span style="color: #000000;">array</span> access<br /><br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = A   <span style="color: #000000;">&#123;</span> ... <span style="color: #000000;">&#125;</span><br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = N   <span style="color: #000000;">0</span><br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>TXBROWSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">517</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">COLATPOS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>TXBROWSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">519</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">SELECTEDCOL</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #0000ff;">PAINT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1250</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #00C800;">DISPLAY</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1228</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1686</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">11511</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">3443</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOX<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">277</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:134khs8m]
xbrowse : sporadic error
Demont, Please try it this way: METHOD ColAtPos( nPos ) INLINE ::aCols[ ::aDisplay[ MinMax( If( nPos == nil, 1, nPos ), 1, [color=#FF0000:12ngh4rh]Max[/color:12ngh4rh]( Len( ::aDisplay ), 1 ) ) ] ]
xbrowse : sporadic error
Antonio, /* METHOD ColAtPos( nPos ) INLINE ::aCols[ ::aDisplay[ MinMax( If( nPos == nil, 1, nPos ), 1, Max( Len( ::aDisplay ), 1 ) ) ] ] */ I don't believe it will solve the problem , the real problem is that for some reason ::aDisplay is empty. With this corection we have ::aDisplay[1] , it should also give a error. The translate : #xtranslate MinMax( <xValue>, <nMin>, <nMax> ) => Min( Max( <xValue>, <nMin> ), <nMax> ) doesn't work when for some reason nMax < nMin , the translate gives then nMax ( the lowest value from nmin,nmax) #xtranslate MinMax( <xValue>, <nMin>, <nMax> ) => Min( Max( <xValue>, MIN(<nMin>,<nMax>) ), MAX(<nMin>,<nMax>) ) Should work !
xbrowse : sporadic error
[quote:30orspkk]I don't believe it will solve the problem , the real problem is that for some reason ::aDisplay is empty. [/quote:30orspkk] Yes. This is the real reason. One case was resolved recently. When HScroll bar is moved in a single column browse, this was happening. This was fixed. We need to see under what other situations ::aDisplay is becoming empty. Any feedback on this is welcome.
xbrowse : sporadic error
With version 8.10 i got nearly the same callist. I do not understand this callist . Simulating this error , we got the error when the dialog is build , but the list is longer , the first 7 items : original error list : Called from: \MCLS\HENWIN8.10\fwh8.10\changed\ChangedSource\xbrowse.prg => (b)TXBROWSE:TXBROWSE(396) Called from: => TXBROWSE:COLATPOS(0) Called from: \MCLS\HENWIN8.10\fwh8.10\changed\ChangedSource\xbrowse.prg => TXBROWSE:PAINT(996) Called from: \MCLS\HENWIN8.10\fwh8.10\changed\ChangedSource\xbrowse.prg => TXBROWSE:DISPLAY(922) Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(0) Called from: \MCLS\HENWIN8.10\fwh8.10\changed\ChangedSource\window.prg => _FWH(3308) [b:j198yctn]Called from: => WINRUN(0)[/b:j198yctn] Sumulating : Called from: \MCLS\HENWIN8.10\fwh8.10\changed\ChangedSource\xbrowse.prg => (b)TXBROWSE:TXBROWSE(396) Called from: => TXBROWSE:COLATPOS(0) Called from: \MCLS\HENWIN8.10\fwh8.10\changed\ChangedSource\xbrowse.prg => TXBROWSE:PAINT(996) Called from: \MCLS\HENWIN8.10\fwh8.10\changed\ChangedSource\xbrowse.prg => TXBROWSE:DISPLAY(922) Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(0) Called from: \MCLS\HENWIN8.10\fwh8.10\changed\ChangedSource\window.prg => _FWH(3308) [b:j198yctn]Called from: => CREATEDLG(0)[/b:j198yctn] So the error doesn't occur when the dialog is build , maybe when the dialog becomes focus. In ACTIVATE DIALOG i have NOMODAL [quote="ukservice":j198yctn]I do get it very often: It is not a hardware problem. It happens randomly when painting xBrowse. [code=fw:j198yctn]<div class="fw" id="{CB}" style="font-family: monospace;">  Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1132</span>  Bound error: <span style="color: #000000;">array</span> access<br /><br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = A   <span style="color: #000000;">&#123;</span> ... <span style="color: #000000;">&#125;</span><br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = N   <span style="color: #000000;">0</span><br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>TXBROWSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">517</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">COLATPOS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>TXBROWSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">519</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">SELECTEDCOL</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #0000ff;">PAINT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1250</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #00C800;">DISPLAY</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1228</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1686</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">11511</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">3443</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOX<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">277</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:j198yctn][/quote:j198yctn]
xbrowse : sporadic error
See also mine previous post. The program uses obrw:bGotfocus. oBrw:bGotFocus := { ||TestHid(oBrw,oCol) , .......} PROC TestHid(oBrw,oCol) STATIC n := 0 IF n > 0 // prevent error when the dialog is created FOR EACH oCol IN oBrw:aCols oCol:Hide() NEXT END n++ RETURN I got exact the same error list as mine user Frank [quote="nageswaragunupudi":1u0q5je1][quote:1u0q5je1]I don't believe it will solve the problem , the real problem is that for some reason ::aDisplay is empty. [/quote:1u0q5je1] Yes. This is the real reason. One case was resolved recently. When HScroll bar is moved in a single column browse, this was happening. This was fixed. We need to see under what other situations ::aDisplay is becoming empty. Any feedback on this is welcome.[/quote:1u0q5je1]
xbrowse : sporadic error
#1. You should never hide all columns. Atleast one column should be visible. #2. When there is only one column in the browse, using horizontal scroll bar was resulting in this error. This is fixed in the latest version. For previous versions, the work around was not to have HScroll bar when there is only one column in the browse.
xbrowse : sporadic error
Nages , I try to simulate the same error list from mine user. I have no intention to hide all the columns in a browse Frank [quote="nageswaragunupudi":79tsu031]#1. You should never hide all columns. Atleast one column should be visible. #2. When there is only one column in the browse, using horizontal scroll bar was resulting in this error. This is fixed in the latest version. For previous versions, the work around was not to have HScroll bar when there is only one column in the browse.[/quote:79tsu031]
xbrowse : sporadic error
[quote:1pzd2r8a]Nages , I try to simulate the same error list from mine user. I have no intention to hide all the columns in a browse Frank [/quote:1pzd2r8a] I understand and appreciate. This also means that we need to take care of a situation where the user by himself hides all columns. We need to protect this either in the application program or in xbrowse. Later option is better. We shall see how we can do this within xbrowse.prg. But for existing applications, the applications need to take care of this possibility. Thanks for your feedback. We would also be interested in knowing if this error is encountered in any situations other than the two I mentioned above. We are always grateful for your feedback, because that helps us to improve the library.
xbrowse : sporadic error
Rao , I tested to hide all columns (8.10) , but xbrowse doesn't allow to hide the last column. Frank
xbrowse : sporadic error
That means the user can not hide all columns. If at all all columns are hidden that is done by the programmer. Ofcourse we expect the programmer not to do it. So this is not an issue.
xbrowse : sporadic error
Mr. Nao, In my case, I don´t hide any columns. The error appears just ramdonly.
xbrowse : sporadic error
Hello again, I am getting this error more often. Sometimes when the dbf is empty. Is there any advance?. Thank you.
xbrowse : sporadic error
aDisplay is created from METHOD GetDisplayCols() CLASS TXBrowse, so I guess thats where we could place some traces: 1. If you are not using any frozen coluns, then this loop should not be executed: [code=fw:17h1o355]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> nFreeze > <span style="color: #000000;">0</span> .and. nCol <= nLen<br />      oCol := ::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span><br />      <span style="color: #00C800;">if</span> ! oCol:<span style="color: #000000;">lHide</span><br />         AAdd<span style="color: #000000;">&#40;</span> aDisplay, nCol <span style="color: #000000;">&#41;</span><br />         oCol:<span style="color: #000000;">nPos</span> := Len<span style="color: #000000;">&#40;</span> aDisplay <span style="color: #000000;">&#41;</span><br />         nFreeze--<br />      <span style="color: #00C800;">endif</span><br />      nCol++<br />   <span style="color: #00C800;">enddo</span></div>[/code:17h1o355] 2. In the above case, aDisplay will be generated here: [code=fw:17h1o355]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> nCol <= nLen<br />      oCol := ::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span><br />      <span style="color: #00C800;">if</span> ! oCol:<span style="color: #000000;">lHide</span><br />         AAdd<span style="color: #000000;">&#40;</span> aDisplay, nCol <span style="color: #000000;">&#41;</span><br />         oCol:<span style="color: #000000;">nPos</span> := Len<span style="color: #000000;">&#40;</span> aDisplay <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />      nCol++<br />   <span style="color: #00C800;">enddo</span></div>[/code:17h1o355] So we could place a trace just after it: [code=fw:17h1o355]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aDisplay <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />      <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"aDisplay is zero! and nCol is: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> nCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" nLen is: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> nLen <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #000000;">aDisplay</span> := aDisplay<br /> </div>[/code:17h1o355] nLen is the total amount of columns. For those of you that are able to reproduce the error, we kindly ask you to use the above trace and tell us what you get, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xbrowse : sporadic error
[quote="Antonio Linares":1o6t2ymw]aDisplay is created from METHOD GetDisplayCols() CLASS TXBrowse, so I guess thats where we could place some traces: So we could place a trace just after it: [code=fw:1o6t2ymw]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aDisplay <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />      <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"aDisplay is zero! and nCol is: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> nCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" nLen is: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> nLen <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #000000;">aDisplay</span> := aDisplay<br /> </div>[/code:1o6t2ymw] nLen is the total amount of columns. For those of you that are able to reproduce the error, we kindly ask you to use the above trace and tell us what you get, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:1o6t2ymw] Maybe the callist is also from intrest : MsgInfo( ... , procname(1) , procname(2),procname(3),procname(4),procname(5)) Frank
xbrowse : sporadic error
Dear All, Any update on this topic.. I still experiencing this random error using FWH11.05.. I followed suggested alternatives but I cant explain further how this error still popup randomly.. [code=fw:18l69pyq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ColAtPos<span style="color: #000000;">&#40;</span> nPos <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">aDisplay</span><span style="color: #000000;">&#91;</span> MinMax<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nPos == <span style="color: #00C800;">nil</span> .or. nPos == <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span>, nPos <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDisplay</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span><br />&nbsp;</div>[/code:18l69pyq] Any update?
xbrowse : sporadic error
Hello, This error was fixed and it is working fine in 11.11.
xbrowse : sporadic error
Hi How to apply that fix to v11.05?
xbrowse : sporadic error
anyone...
xbrowse <-> Tree and viceversa
I have the customer.dbf table, [img:2uhduvpo]https&#58;//i&#46;postimg&#46;cc/XJvNGgBR/1&#46;png[/img:2uhduvpo] and above the table I can do a search then a get and a combox I would like to make groupings for example for the State field, so I could use an Xbrowse Tree control and create the same columns you see in the picture. But I would also like the end user to be able to select the grouping via a popup menu above the dialog . the end user can select to do the grouping by the "State" field or not to do it. If it decides not to do the grouping the procedure has to go back to the initial table That is, I would like to show both a normal table ( xbrowse) and a tree ( xbrowse) in the same xbrowse. if i have a tree how can i make the lookup work the same as i do with the regular table? how could i do it? I made a test but not run ok [b:2uhduvpo]see the video [/b:2uhduvpo] [img:2uhduvpo]https&#58;//i&#46;postimg&#46;cc/QtD406Jz/video2&#46;gif[/img:2uhduvpo]
xbrowse <-> Tree and viceversa
Hello Silvio; Your images don't show when I browse but regardless, I think I understand what you're looking for and want to suggest a way to get it. 1. Declare a regular xbrowse on a dialog and also another xbrowse hosting an otree with the very same data source on another dialog. 2. Have both occupy the very same area. 3. When you want to show the regular browse, show that dialog and hide the other and vise versa. 4. When you make changes on one, just make sure to refresh both. Being that both xbrowses occupy the very same real estate on the screen. only one of the two will be visible at a time. I hope that helps,
xbrowse <-> Tree and viceversa
the problem is that i use a scheme ie i use xbrowse search with a get and a combobox, and also the multiselect . When I create the tree it could also work but the search doesn't work I really don't think I have to use two separate dialogs, the dialog and the xbrowse must be the same, I created something that doesn't work but I'm sure nages will find the solution. It is important to have a grouping, for example in an archive of articles we can view the normal table or a grouping by category, it must be a fluid system. Must have research in both situations see your mail.
xbrowse <-> Tree and viceversa
Yes, obrw search probably wont work for searching but if that is the problem, then perhaps something like this extended cb is the idea you are looking for: [code=fw:2r3fw5hh]<div class="fw" id="{CB}" style="font-family: monospace;">   ::<span style="color: #000000;">bSearch</span> := ;<br />   < | isFromStart, isJump |  <br />      <span style="color: #00C800;">LOCAL</span> isFound := .F. <br />      <span style="color: #00C800;">LOCAL</span> oBranch := IIF<span style="color: #000000;">&#40;</span> isFromStart, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTree</span>:<span style="color: #000000;">oFirst</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span> <span style="color: #000000;">&#41;</span><br />      <br />      <span style="color: #00C800;">DEFAULT</span> isJump := .T. <br /><br />      <span style="color: #00C800;">WHILE</span> oBranch != <span style="color: #00C800;">NIL</span> .AND. ;<br />            !<span style="color: #000000;">&#40;</span> isFound := ALLTRIM<span style="color: #000000;">&#40;</span> oBranch:<span style="color: #000000;">cPrompt</span> <span style="color: #000000;">&#41;</span> == ::<span style="color: #000000;">cSeek</span> <span style="color: #000000;">&#41;</span> .AND. ;<br />            !<span style="color: #000000;">&#40;</span> isFound := ALLTRIM<span style="color: #000000;">&#40;</span> oBranch:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _ADMNUM <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == ::<span style="color: #000000;">cSeek</span> <span style="color: #000000;">&#41;</span> .AND. ;<br />            !<span style="color: #000000;">&#40;</span> isFound := UPPER<span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cSeek</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> $ UPPER<span style="color: #000000;">&#40;</span> oBranch:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PATNAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />            <br />         oBranch := oBranch:<span style="color: #000000;">GetNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      END<br /><br />      <span style="color: #00C800;">IF</span> isFound .AND. isJump  ;EVAL<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bBookmark</span>, oBranch:<span style="color: #000000;">ItemNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>  ;ENDIF<br />   <br />      <span style="color: #00C800;">RETURN</span> isFound<br />   ><br /> </div>[/code:2r3fw5hh] This code searches on various columns of the xbrowse tree. Change to search on more columns or just 1 column by adjusting _ADMNUM and _PTENAME to column index you want to search on. Hope it helps or at least points towards the solution you are looking for.
xbrowse <-> Tree and viceversa
Hello Silvio, I asked ChatGPT: I pass the Fivewin documentation along with my question. Best regards, Otto [code=fw:3to9lbcj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">To</span> achieve the desired functionality <span style="color: #0000ff;">of</span> displaying both a regular table <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">&#41;</span> and a tree <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">&#41;</span> in the same <span style="color: #0000ff;">xBrowse</span> control with the ability <span style="color: #0000ff;">to</span> <span style="color: #00C800;">switch</span> between grouping and non-grouping modes, you can follow these steps:<br /><br /><span style="color: #000000;">Create</span> the <span style="color: #0000ff;">xBrowse</span> control and attach the initial table <span style="color: #000000;">&#40;</span>customer.dbf<span style="color: #000000;">&#41;</span> as the <span style="color: #00C800;">data</span> source using the SetRDD<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">method</span>.<br /><br /><span style="color: #0000ff;">Define</span> the columns <span style="color: #00C800;">for</span> the regular table view <span style="color: #0000ff;">of</span> the <span style="color: #0000ff;">xBrowse</span>. You can use the AddColumn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">method</span> <span style="color: #0000ff;">to</span> add columns with field names or expressions, similar <span style="color: #0000ff;">to</span> how you would <span style="color: #0000ff;">define</span> columns <span style="color: #00C800;">for</span> a regular <span style="color: #0000ff;">xBrowse</span>.<br /><br />Implement the grouping functionality using an <span style="color: #0000ff;">xBrowse</span> Tree control. You can create a separate <span style="color: #0000ff;">xBrowse</span> Tree control and attach it as a child <span style="color: #0000ff;">of</span> the main <span style="color: #0000ff;">xBrowse</span> control. Configure the <span style="color: #0000ff;">xBrowse</span> Tree control <span style="color: #0000ff;">to</span> <span style="color: #00C800;">display</span> the grouped <span style="color: #00C800;">data</span> based <span style="color: #0000ff;">on</span> the <span style="color: #ff0000;">"State"</span> field.<br /><br />Implement the <span style="color: #0000ff;">popup</span> <span style="color: #0000ff;">menu</span> above the <span style="color: #0000ff;">dialog</span> <span style="color: #0000ff;">to</span> allow the end user <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">select</span> the grouping option. <span style="color: #0000ff;">When</span> the user selects the grouping option, <span style="color: #00C800;">switch</span> the <span style="color: #0000ff;">xBrowse</span> control <span style="color: #0000ff;">to</span> <span style="color: #00C800;">display</span> the <span style="color: #0000ff;">xBrowse</span> Tree control with the grouped <span style="color: #00C800;">data</span>.<br /><br />Handle the scenario <span style="color: #0000ff;">when</span> the user decides not <span style="color: #0000ff;">to</span> <span style="color: #00C800;">do</span> grouping. In this <span style="color: #00C800;">case</span>, you need <span style="color: #0000ff;">to</span> <span style="color: #00C800;">switch</span> the <span style="color: #0000ff;">xBrowse</span> control back <span style="color: #0000ff;">to</span> <span style="color: #00C800;">display</span> the regular table view. You can achieve this by hiding or removing the <span style="color: #0000ff;">xBrowse</span> Tree control and reattaching the initial table as the <span style="color: #00C800;">data</span> source using the SetRDD<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">method</span>.<br /><br /><span style="color: #0000ff;">To</span> make the lookup work the same as with the regular table, you can handle the lookup functionality separately <span style="color: #00C800;">for</span> the regular table view and the grouped view <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">xBrowse</span> Tree control<span style="color: #000000;">&#41;</span>. <span style="color: #0000ff;">When</span> the <span style="color: #0000ff;">xBrowse</span> control is displaying the regular table view, you can handle the lookup functionality as you normally would <span style="color: #00C800;">for</span> a regular <span style="color: #0000ff;">xBrowse</span>. <span style="color: #0000ff;">When</span> the <span style="color: #0000ff;">xBrowse</span> control is displaying the grouped view, you can implement custom lookup functionality specific <span style="color: #0000ff;">to</span> the grouped <span style="color: #00C800;">data</span> structure, such as searching within the grouped nodes or expanding/collapsing the nodes <span style="color: #0000ff;">to</span> perform the lookup.<br /><br />By combining these steps, you can create an <span style="color: #0000ff;">xBrowse</span> control that can <span style="color: #00C800;">display</span> both a regular table view and a grouped view using an <span style="color: #0000ff;">xBrowse</span> Tree control, allowing the end user <span style="color: #0000ff;">to</span> <span style="color: #00C800;">switch</span> between the two and perform lookups in a consistent manner.<br /><br /><br /><br /><br /><br />&nbsp;</div>[/code:3to9lbcj]
xbrowse <-> Tree and viceversa
I sent to fwteam a test. It can runn but the search run only with normale xbrowse and not with xbrowse tree
xbrowse <-> Tree and viceversa
[quote="Silvio.Falconi":fp1z8zzd]I sent to fwteam a test. It can runn but the search run only with normale xbrowse and not with xbrowse tree[/quote:fp1z8zzd] Dear Silvio To use Tree or normal view in an xbrowse, you have an example in xbrtree.prg ( samples folder). Allow to search in the tree as in the normal xbrowse, with what criteria? I don't understand that you can search, for example, for a surname that can be in several groups of the tree, that is, the table cannot be sorted at that moment because the tree would be lost. If a custom search is set (manually), I understand it can be done.
xbrowse <-> Tree and viceversa
Otto, I'm really impressed with the answer. It opens our minds. I wonder if you can follow up that same chat and ask to write sample code that implements those steps and then compare to how close to working code it produces.
xbrowse <-> Tree and viceversa
[quote="Otto":21zn7xbu]Hello Silvio, I asked ChatGPT: I pass the Fivewin documentation along with my question. Best regards, Otto [code=fw:21zn7xbu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">To</span> achieve the desired functionality <span style="color: #0000ff;">of</span> displaying both a regular table <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">&#41;</span> and a tree <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">&#41;</span> in the same <span style="color: #0000ff;">xBrowse</span> control with the ability <span style="color: #0000ff;">to</span> <span style="color: #00C800;">switch</span> between grouping and non-grouping modes, you can follow these steps:<br /><br /><span style="color: #000000;">Create</span> the <span style="color: #0000ff;">xBrowse</span> control and attach the initial table <span style="color: #000000;">&#40;</span>customer.dbf<span style="color: #000000;">&#41;</span> as the <span style="color: #00C800;">data</span> source using the SetRDD<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">method</span>.<br /><br /><span style="color: #0000ff;">Define</span> the columns <span style="color: #00C800;">for</span> the regular table view <span style="color: #0000ff;">of</span> the <span style="color: #0000ff;">xBrowse</span>. You can use the AddColumn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">method</span> <span style="color: #0000ff;">to</span> add columns with field names or expressions, similar <span style="color: #0000ff;">to</span> how you would <span style="color: #0000ff;">define</span> columns <span style="color: #00C800;">for</span> a regular <span style="color: #0000ff;">xBrowse</span>.<br /><br />Implement the grouping functionality using an <span style="color: #0000ff;">xBrowse</span> Tree control. You can create a separate <span style="color: #0000ff;">xBrowse</span> Tree control and attach it as a child <span style="color: #0000ff;">of</span> the main <span style="color: #0000ff;">xBrowse</span> control. Configure the <span style="color: #0000ff;">xBrowse</span> Tree control <span style="color: #0000ff;">to</span> <span style="color: #00C800;">display</span> the grouped <span style="color: #00C800;">data</span> based <span style="color: #0000ff;">on</span> the <span style="color: #ff0000;">"State"</span> field.<br /><br />Implement the <span style="color: #0000ff;">popup</span> <span style="color: #0000ff;">menu</span> above the <span style="color: #0000ff;">dialog</span> <span style="color: #0000ff;">to</span> allow the end user <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">select</span> the grouping option. <span style="color: #0000ff;">When</span> the user selects the grouping option, <span style="color: #00C800;">switch</span> the <span style="color: #0000ff;">xBrowse</span> control <span style="color: #0000ff;">to</span> <span style="color: #00C800;">display</span> the <span style="color: #0000ff;">xBrowse</span> Tree control with the grouped <span style="color: #00C800;">data</span>.<br /><br />Handle the scenario <span style="color: #0000ff;">when</span> the user decides not <span style="color: #0000ff;">to</span> <span style="color: #00C800;">do</span> grouping. In this <span style="color: #00C800;">case</span>, you need <span style="color: #0000ff;">to</span> <span style="color: #00C800;">switch</span> the <span style="color: #0000ff;">xBrowse</span> control back <span style="color: #0000ff;">to</span> <span style="color: #00C800;">display</span> the regular table view. You can achieve this by hiding or removing the <span style="color: #0000ff;">xBrowse</span> Tree control and reattaching the initial table as the <span style="color: #00C800;">data</span> source using the SetRDD<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">method</span>.<br /><br /><span style="color: #0000ff;">To</span> make the lookup work the same as with the regular table, you can handle the lookup functionality separately <span style="color: #00C800;">for</span> the regular table view and the grouped view <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">xBrowse</span> Tree control<span style="color: #000000;">&#41;</span>. <span style="color: #0000ff;">When</span> the <span style="color: #0000ff;">xBrowse</span> control is displaying the regular table view, you can handle the lookup functionality as you normally would <span style="color: #00C800;">for</span> a regular <span style="color: #0000ff;">xBrowse</span>. <span style="color: #0000ff;">When</span> the <span style="color: #0000ff;">xBrowse</span> control is displaying the grouped view, you can implement custom lookup functionality specific <span style="color: #0000ff;">to</span> the grouped <span style="color: #00C800;">data</span> structure, such as searching within the grouped nodes or expanding/collapsing the nodes <span style="color: #0000ff;">to</span> perform the lookup.<br /><br />By combining these steps, you can create an <span style="color: #0000ff;">xBrowse</span> control that can <span style="color: #00C800;">display</span> both a regular table view and a grouped view using an <span style="color: #0000ff;">xBrowse</span> Tree control, allowing the end user <span style="color: #0000ff;">to</span> <span style="color: #00C800;">switch</span> between the two and perform lookups in a consistent manner.<br /><br /><br /><br /><br /><br /> </div>[/code:21zn7xbu][/quote:21zn7xbu] aside I don't think chatGpt knows fivewin and Harbor because I've already tried a thousand times and I haven't succeeded, if he replies to you why don't you try to ask this: "Please create me a little Harbor/fivewin language program that does a xbrowse tree with grouping to one field and a normal xbrowse in the same xbrowse and creates record lookup"
xbrowse <-> Tree and viceversa
Silvio, You need to include the Fivewin documentation along with your question as a knowledge base. Best regards, Otto
xbrowse <-> Tree and viceversa
this is a small test the search not run I used array [code=fw:2nm64efh]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">static</span> lTipo1:=.f.,ltipo2:=.f.<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData<br /><br />&nbsp; &nbsp;FERASE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CUSTOMER.CDX"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE CUSTOMER <span style="color: #00C800;">NEW</span> EXCLUSIVE VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp;aData := FW_DbfToArray<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"FIRST,LAST,STREET,STATE"</span>, , <span style="color: #000000;">&#123;</span> || RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> < <span style="color: #000000;">11</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GO TOP<br />&nbsp; &nbsp;FW_CdxCreate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CLOSE CUSTOMER<br /><br />&nbsp; Customers<span style="color: #000000;">&#40;</span>aData<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">function</span> Customers<span style="color: #000000;">&#40;</span>aData<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oGroup<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oSay:=array<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cSeek:=Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">100</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGet<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL RESIZABLE<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">165</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cSeek <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">19</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* &nbsp;@ nRow - 1, 10 COMBOBOX nFilter SIZE 60, If( IsAppThemed(), 14, 60 ) PIXEL OF oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ITEMS { "Search For", "Show Only" } ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ON CHANGE ( oBrw:Seek( "" ), oBrw:lIncrFilter := nFilter > 1, &nbsp;oBrw:SetFocus() )<br /><br />&nbsp; &nbsp; &nbsp; @ nRow - 1, 72 COMBOBOX nSeekWild ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;size 60, If( IsAppThemed(), 14, 60 ) pixel of oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ITEMS { "Starting With", "Containing" } ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;on change ( oBrw:lSeekWild := ( nSeekWild > 1 ), oBrw:Seek( "" ), oBrw:SetFocus() )<br />&nbsp; &nbsp; &nbsp; */</span><br /><br /><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">10</span>, <span style="color: #000000;">700</span> &nbsp;<span style="color: #0000ff;">BTNBMP</span> oGroup <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"group on"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FLAT &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">20</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg &nbsp; <span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BITMAP <span style="color: #ff0000;">".<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>ombo.bmp"</span> <span style="color: #0000ff;">RIGHT</span> NOROUND;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> &nbsp;::<span style="color: #000000;">ShowPopUp</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> |oBtn| BtnPop<span style="color: #000000;">&#40;</span> aData, oDlg, oBrw,oGet <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">init</span> oBrw:= MyBrowse<span style="color: #000000;">&#40;</span>aData,oDlg, oBrw<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//--------------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> MyBrowse<span style="color: #000000;">&#40;</span>aData,oDlg, oBrw, oGet<span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp;@ <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE aData ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"NAME"</span>,<span style="color: #ff0000;">"SURNAME"</span>,<span style="color: #ff0000;">"ADDRESS"</span>,<span style="color: #ff0000;">"STATE"</span> ;<br />&nbsp; &nbsp; &nbsp; AUTOSORT ;<br />&nbsp; &nbsp; &nbsp; NOBORDER LINES<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">lHScroll</span> &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//---</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lIncrFilter</span> &nbsp; &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bOnSort</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |b,oCol| oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">cFilterFld</span> := oCol:<span style="color: #000000;">cExpr</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">oSeek</span> := oGet<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//----</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">COMBOBOX</span> oBrw:<span style="color: #000000;">oSortCbx</span> <span style="color: #0000ff;">VAR</span> oBrw:<span style="color: #000000;">cSortOrder</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /><span style="color: #00C800;">return</span> oBrw<br /><span style="color: #B900B9;">//--------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> BtnPop<span style="color: #000000;">&#40;</span>aData, oDlg, oBrw,oGet<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oItem1,oItem2<br /><span style="color: #0000ff;">MENU</span> oMenu <span style="color: #0000ff;">POPUP</span><br /><span style="color: #0000ff;">MENUITEM</span> oItem1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"State"</span> ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>lTipo1 := !lTipo1,;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> Iif<span style="color: #000000;">&#40;</span> ltipo1,MakeGroup<span style="color: #000000;">&#40;</span>oBrw,oGet,oDlg<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MyBrowse<span style="color: #000000;">&#40;</span>aData,oDlg, oBrw,oGet<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />oItem1:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span>lTipo1<span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">ENDMENU</span><br /><span style="color: #00C800;">return</span> oMenu<br /><span style="color: #B900B9;">//---------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">Function</span> &nbsp;MakeGroup<span style="color: #000000;">&#40;</span>oBrw,oGet,oDlg<span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// simulation</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aDatatree:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aState:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cState :=<span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> k<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aHeaders:= &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"First"</span>,<span style="color: #ff0000;">"Last"</span>,<span style="color: #ff0000;">"City"</span>,<span style="color: #ff0000;">"State"</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oCol<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDbf<br /><br />&nbsp; &nbsp;oDbf:=Tdatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>,<span style="color: #ff0000;">"customer"</span> ,<span style="color: #ff0000;">"DBFCDX"</span>, .t.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"state"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">//load State</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Do</span> <span style="color: #00C800;">while</span> .not. &nbsp;oDbf:<span style="color: #000000;">eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">&#40;</span>oDbf:<span style="color: #000000;">state</span><span style="color: #000000;">&#41;</span> .and. oDbf:<span style="color: #000000;">State</span>!=cState<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aadd<span style="color: #000000;">&#40;</span>aState,oDbf:<span style="color: #000000;">State</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n++<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cState:= oDbf:<span style="color: #000000;">State</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDbf:<span style="color: #000000;">skip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Enddo</span><br />&nbsp; &nbsp; &nbsp; oDbf:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp; <span style="color: #B900B9;">// see on dbf for state</span><br />&nbsp; k:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; <span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span> astate<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; k:=k<span style="color: #000000;">+1</span><br />&nbsp; &nbsp; &nbsp; &nbsp;aadd<span style="color: #000000;">&#40;</span>aDatatree,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"State"</span>+chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">187</span><span style="color: #000000;">&#41;</span>+aState<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span> ,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,k <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDbf:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span>aState<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Do</span> <span style="color: #00C800;">while</span> !oDbf:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> alltrim<span style="color: #000000;">&#40;</span>oDbf:<span style="color: #000000;">state</span><span style="color: #000000;">&#41;</span> == alltrim<span style="color: #000000;">&#40;</span>astate<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k:=k<span style="color: #000000;">+1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aadd<span style="color: #000000;">&#40;</span>aDatatree,<span style="color: #000000;">&#123;</span>space<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span>+alltrim<span style="color: #000000;">&#40;</span>oDbf:<span style="color: #000000;">First</span><span style="color: #000000;">&#41;</span>,oDbf:<span style="color: #000000;">Last</span>,oDbf:<span style="color: #000000;">city</span>,oDbf:<span style="color: #000000;">state</span>,k <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDbf:<span style="color: #000000;">skip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDbf:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDbf:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// make a sort</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aDatatree &nbsp; := aSort<span style="color: #000000;">&#40;</span> aDatatree,,,<span style="color: #000000;">&#123;</span>|x,y| <span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> < <span style="color: #000000;">&#40;</span>y<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// insert on xbrowse</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">ResetData</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>,<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">lAutoSort</span> := .t.<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">setarray</span><span style="color: #000000;">&#40;</span>aDatatree<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// set the titles</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"State"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"First"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp;:= <span style="color: #ff0000;">"Last"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp;:= <span style="color: #ff0000;">"Last"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp;:= <span style="color: #ff0000;">"State"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// hide :aCols[5] &nbsp;the number I used</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//these not run</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">lIncrFilter</span> &nbsp; &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">lSeekWild</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bOnSort</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |b,oCol| oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">cFilterFld</span> := oCol:<span style="color: #000000;">cExpr</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">oSeek</span> := oGet<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// refresh()</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------------------------------------------//</span><br /><br /><br />&nbsp;</div>[/code:2nm64efh]
xbrowse <-> Tree and viceversa
Hello Silvio, I get an anwer but I have an older version installed where things are missing. Which version of FW do you use. Best regards, Otto ChatGPT says: [quote:1cfmg9m3] The bOnSort property is defined as a code block, but its implementation is missing in the provided code. You need to define the sorting logic inside this code block to make the sorting functionality work. In the MakeGroup function, there is a line oDbf:close(), which is closing the database file before performing operations on it. Remove this line to ensure the database file remains open for further operations. [/quote:1cfmg9m3]
xbrowse <-> Tree and viceversa
[quote="Otto":iv6h4wca]Hello Silvio, I get an anwer but I have an older version installed where things are missing. Which version of FW do you use. Best regards, Otto ChatGPT says: [quote:iv6h4wca] The bOnSort property is defined as a code block, but its implementation is missing in the provided code. You need to define the sorting logic inside this code block to make the sorting functionality work. In the MakeGroup function, there is a line oDbf:close(), which is closing the database file before performing operations on it. Remove this line to ensure the database file remains open for further operations. [/quote:iv6h4wca][/quote:iv6h4wca] fwh release December 2021 to March 2022 I must close the oDbf with oDbf:close() I create an array aDatatree for xbrowse tree , why I need oDbf ? I regularly use this scheme to do database lookups in all my dialogs [code=fw:iv6h4wca]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">165</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cSeek <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">19</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span><br />&nbsp;<br />@ <span style="color: #000000;">110</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw....<br /><br />&nbsp;WITH OBJECT oBrw<br />              :<span style="color: #000000;">lHScroll</span>  := .f.<br />            :<span style="color: #000000;">lIncrFilter</span>      := .t.<br />            :<span style="color: #000000;">bOnSort</span>          := <span style="color: #000000;">&#123;</span> |b,oCol| oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, ;<br />                                   oBrw:<span style="color: #000000;">cFilterFld</span> := oCol:<span style="color: #000000;">cExpr</span>, ;<br />                                   oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />            :<span style="color: #000000;">oSeek</span> := oGet<br />            :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         END<br /><br />&nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">550</span> <span style="color: #0000ff;">COMBOBOX</span> oBrw:<span style="color: #000000;">oSortCbx</span> <span style="color: #0000ff;">VAR</span> oBrw:<span style="color: #000000;">cSortOrder</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp;</div>[/code:iv6h4wca]
xbrowse AYUDA perdida de foco y escape...
hola foro, aqui probando por 1a vez la xbrowse nativa, y me topo con 2 cosas que no he sabido por donde buscarle... la uso con array 1. tengo 5 botones y un xbrowse, el browse tengo 3 columnas editables,1 con get y dos con listbox, cuando en los listbox slecciono con ENTER se pirde el foco del xbrowse y me pasa al siguiente control, como hacer para que se quede el foco en el xbrowse? si selecciono del listbox con raton no sucede eso 2. cuando estoy editando la primer columna si presiono ESCAPE no me devuelve al valor anterior, me acepta la captura, de hecho en mi dialogo tuve que poner un VALID porque si presionaba ESCAPE estando editando en el xbrowse me cerraba el dialogo completo. asi tengo mi columna para el ESCAPE oBrw:aCols[1]:bOnPostEdit := {|o,xVal,nKey| IF(nKey!=VK_ESCAPE,aDetalle[ oBrw:nArrayAt, 1 ] := xVal,) } alguna sugerencia? uso fwh705 y harbour gracias paco
xbrowse Border
[img:2znz4t80]https&#58;//i&#46;postimg&#46;cc/ZKh8qcTq/ghg&#46;png[/img:2znz4t80] how can I have the black border at the right side of the xbrowse after the scrollbar ? I made [code=fw:2znz4t80]<div class="fw" id="{CB}" style="font-family: monospace;"> @ <span style="color: #000000;">40</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> ;<br />      <span style="color: #0000ff;">AUTOCOLS</span> DATASOURCE oDbf NOBORDER<br /><br />                   WITH OBJECT oBrw<br />                             :<span style="color: #000000;">lDrawBorder</span> := .t.<br />                             :<span style="color: #000000;">nClrBorder</span> := CLR_BLACK<br />                     END</div>[/code:2znz4t80] but the border is drawed only on left and up and down of the xbrowse If I make oBrw:lVScroll := .f. oBrw:lhScroll := .f. the border is painted good but I need to use Vscroll [img:2znz4t80]https&#58;//i&#46;postimg&#46;cc/1zwPXZ0g/lll&#46;png[/img:2znz4t80] I think we need to tell the xbrowse class that when there is vertical scrolling the border must be drawn after the scroll any solution ?
xbrowse Border
[b:5xee4cey]For Antonio & NagesWarao [/b:5xee4cey] Lines 2674/2675 of Xbrowse class I propose this solution for displaying the border in the presence of vertical scrolling if ::lDrawBorder // ::Box( 0, 0, ::nHeight - 1, ::nWidth - 1, IfNil( ::nClrBorder, ::hColPen ) ) [b:5xee4cey] ::Box( 0, 0, ::nHeight - 1, ::BrwWidth(), IfNil( ::nClrBorder, ::hColPen ) )[/b:5xee4cey] endif [img:5xee4cey]https&#58;//i&#46;postimg&#46;cc/vHytyBsS/ok&#46;png[/img:5xee4cey] the same must be made in the presence of Horizontal scrolling but I not found the part where draw the box when there ::lHscroll is true better can be oBrw:lVScroll := .t. oBrw:lhScroll := .t. [code=fw:5xee4cey]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lDrawBorder</span><br />     <span style="color: #00C800;">If</span> ::<span style="color: #000000;">lVScroll</span><br />         ::<span style="color: #000000;">Box</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, ::<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">1</span>, ::<span style="color: #000000;">BrwWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrBorder</span>, ::<span style="color: #000000;">hColPen</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Endif</span><br />     <span style="color: #00C800;">If</span> ::<span style="color: #000000;">lHScroll</span><br />         ::<span style="color: #000000;">Box</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, ::<span style="color: #000000;">BrwHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">1</span>, IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrBorder</span>, ::<span style="color: #000000;">hColPen</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />     <span style="color: #00C800;">If</span> ::<span style="color: #000000;">lVScroll</span>  .and. ::<span style="color: #000000;">lHScroll</span><br />         ::<span style="color: #000000;">Box</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, ::<span style="color: #000000;">BrwHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">BrwWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrBorder</span>, ::<span style="color: #000000;">hColPen</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">endif</span><br />  <span style="color: #00C800;">endif</span><br /><br /> </div>[/code:5xee4cey] [img:5xee4cey]https&#58;//i&#46;postimg&#46;cc/YSJR5zRJ/ok-2&#46;png[/img:5xee4cey] it run also with oBrw:lfooter := .t. [b:5xee4cey]My Advice[/b:5xee4cey] the best modification is to draw the border after the horizontal and vertical scroll and not before as I have solved, certainly you would know how to do it i.e. the border should be drawn around the whole control as it was a long time ago (xbrowse Ortiz de Zuniga)
xbrowse Devolver valor de una celda
Buenas Tardes foro: Tengo un array multidimensional aProductos [ xn, yn ] en un xbrowse, y necesito conocer el valor de la celda y su posición al momento de hacer un doble click. ¿ Cómo se hace? Gracias
xbrowse Devolver valor de una celda
Posición [code=fw:3og0da9e]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">nArrayAt</span><br /> </div>[/code:3og0da9e] Valor [code=fw:3og0da9e]<div class="fw" id="{CB}" style="font-family: monospace;"><br />variable := aMyArray<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>nroCol<span style="color: #000000;">&#93;</span><br />ó<br />variable := aMyArray<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"nameKey"</span><span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">//hash</span><br /> </div>[/code:3og0da9e]