topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
xBrowse function | Now I can resolve virtually any source code function call to the variables and edit in AUTOCODE with a wizard.
[img:99kee6jo]https://mybergland.com/fwforum/acd_clip5.jpg[/img:99kee6jo] |
xBrowse function | Dear Mr. Rao,
Thank you for your help. I'm waiting for the other examples.
I have started programming a wizard.
I will use [b:1bxxa4jl]WebView2 [/b:1bxxa4jl]for the input screens.
It is a good exercise to get more familiar with web development and also mod harbour.
The programming of the input masks is very comfortable.
To keep the source code simple, clear and readable I use a patcher.
This is the part how we get a HARBOUR hash value into the Webview2.
<?prg return hb_jsonEncode( hTmp[ 'BSETUP' ] , .T. )?>
Best regards,,
Otto
[code=fw:1bxxa4jl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #000000;">[</span>code<span style="color: #000000;">]</span><br /><br /><form <span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"row g-3 border p-3 shadow-lg"</span>> <br /> $-> TEXTAREA : <span style="color: #0000ff;">id</span>=paste; label=paste; <span style="color: #0000ff;">text</span>=<span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">(</span> cAlias , <span style="color: #ff0000;">"This is my title, subtitle , test neu"</span>, .F. , <span style="color: #000000;">{</span> |oBrw| oBrw:<span style="color: #000000;">nMarqeeStyle</span> := <span style="color: #000000;">1</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"Col1"</span>,<span style="color: #ff0000;">"Col2"</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span> |oBrw,oSelectedCol| cSelected := oSelectedCol:<span style="color: #000000;">Value</span> <span style="color: #000000;">}</span> , lExcel, lFastEdit,<span style="color: #000000;">{</span> |oBrw| IsValid <span style="color: #000000;">}</span>, cSerial, lNoModal, lAutoFit <span style="color: #000000;">)</span><br /> $-> INPUT : <span style="color: #0000ff;">id</span>=uData; label=Überschrift; value= <?prg <span style="color: #00C800;">return</span> hb_jsonEncode<span style="color: #000000;">(</span> hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'UDATA'</span> <span style="color: #000000;">]</span> , .T. <span style="color: #000000;">)</span>?><br /> $-> <span style="color: #0000ff;">CHECKBOX</span> : <span style="color: #0000ff;">id</span>=lAutoSort; label=lAutoSort <br /> $-> TEXTAREA : <span style="color: #0000ff;">id</span>=bSetUp; label=bSetUp; <span style="color: #0000ff;">text</span>=<?prg <span style="color: #00C800;">return</span> hb_jsonEncode<span style="color: #000000;">(</span> hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'BSETUP'</span> <span style="color: #000000;">]</span> , .T. <span style="color: #000000;">)</span>?><br /> $-> TEXTAREA : <span style="color: #0000ff;">id</span>=aCols; label=aCols; <span style="color: #0000ff;">text</span>=<?prg <span style="color: #00C800;">return</span> hb_jsonEncode<span style="color: #000000;">(</span> hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'ACOLS'</span> <span style="color: #000000;">]</span> , .T. <span style="color: #000000;">)</span>?><br /> $-> TEXTAREA : <span style="color: #0000ff;">id</span>=bSelect; label=bSelect; <span style="color: #0000ff;">text</span>=<?prg <span style="color: #00C800;">return</span> hb_jsonEncode<span style="color: #000000;">(</span> hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'BSELECT'</span> <span style="color: #000000;">]</span> , .T. <span style="color: #000000;">)</span>?><br /> $-> <span style="color: #0000ff;">CHECKBOX</span> : <span style="color: #0000ff;">id</span>=lExcel; label=lExcel <br /> $-> <span style="color: #0000ff;">CHECKBOX</span> : <span style="color: #0000ff;">id</span>=lFastEdit; label=lFastEdit <br /> $-> TEXTAREA : <span style="color: #0000ff;">id</span>=bValid; label=bValid; <span style="color: #0000ff;">text</span>=<?prg <span style="color: #00C800;">return</span> hb_jsonEncode<span style="color: #000000;">(</span> hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'BVALID'</span> <span style="color: #000000;">]</span> , .T. <span style="color: #000000;">)</span>?><br /> $-> TEXTAREA : <span style="color: #0000ff;">id</span>=cSlNo; label=cSlNo; <span style="color: #0000ff;">text</span>=<?prg <span style="color: #00C800;">return</span> hb_jsonEncode<span style="color: #000000;">(</span> hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'CSLNO'</span> <span style="color: #000000;">]</span> , .T. <span style="color: #000000;">)</span>?><br /> $-> <span style="color: #0000ff;">CHECKBOX</span> : <span style="color: #0000ff;">id</span>=lNoModal; label=lNoModal <br /> $-> <span style="color: #0000ff;">CHECKBOX</span> : <span style="color: #0000ff;">id</span>=lAutoFit; label=lAutoFit<br /> <br /> <div <span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"col-md-12 py-3"</span>><br /> <button <span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"btn btn-lg btn-success me-2"</span> onclick=<span style="color: #ff0000;">"save()"</span> type=<span style="color: #ff0000;">"button"</span>>SAVE</button><br /> <button <span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"btn btn-lg btn-outline-secondary"</span> onclick=<span style="color: #ff0000;">"alert('Abbruch')"</span> type=<span style="color: #ff0000;">"button"</span>>CANCEL</button><br /> </div><br /> <br /></form><br /><br />example TEXTAREA <br /><span style="color: #000000;">[</span>/code<span style="color: #000000;">]</span><br /><div <span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"form-floating"</span>><br /> <textarea <span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"form-control"</span> placeholder=<span style="color: #ff0000;">"Leave a comment here"</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"|id|"</span> <span style="color: #0000ff;">style</span>=<span style="color: #ff0000;">"height: 80px"</span>>|text|<br /> </textarea><br /> <label <span style="color: #00C800;">for</span>=<span style="color: #ff0000;">"|id|"</span>>|label|</label><br /></div><br /><span style="color: #000000;">[</span>code<span style="color: #000000;">]</span><br /><br /><br /><span style="color: #000000;">[</span>/code<span style="color: #000000;">]</span><br /><br /><br /><br /><br /><span style="color: #000000;">[</span>code=fw<span style="color: #000000;">]</span><br /><span style="color: #B900B9;">//lNoModal</span><br />cTmp := StrToken<span style="color: #000000;">(</span> cTmp2, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">","</span> <span style="color: #000000;">)</span><br />lNoModal := cTmp<br />nlencTmp := len<span style="color: #000000;">(</span> cTmp <span style="color: #000000;">)</span><br />cTmp2 := ALLTRIM<span style="color: #000000;">(</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> cTmp2, <span style="color: #000000;">(</span> nlencTmp + <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// lAutoFit</span><br />cTmp := StrToken<span style="color: #000000;">(</span> cTmp2, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">","</span> <span style="color: #000000;">)</span><br />cTmp := STRTRAN<span style="color: #000000;">(</span>cTmp, <span style="color: #ff0000;">")"</span>, <span style="color: #ff0000;">""</span><span style="color: #000000;">)</span><br />lAutoFit := cTmp<br />nlencTmp := len<span style="color: #000000;">(</span> cTmp <span style="color: #000000;">)</span><br />cTmp2 := ALLTRIM<span style="color: #000000;">(</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> cTmp2, <span style="color: #000000;">(</span> nlencTmp + <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'uData'</span> <span style="color: #000000;">]</span> := uData <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'cTitle'</span> <span style="color: #000000;">]</span> := cTitle <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'lAutoSort'</span> <span style="color: #000000;">]</span> := lAutoSort <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'bSetUp'</span> <span style="color: #000000;">]</span> := bSetUp <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'aCols'</span> <span style="color: #000000;">]</span> := aCols <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'bSelect'</span> <span style="color: #000000;">]</span> := bSelect <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'lExcel'</span> <span style="color: #000000;">]</span> := lExcel <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'lFastEdit'</span> <span style="color: #000000;">]</span> := lFastEdit<br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'bValid'</span> <span style="color: #000000;">]</span> := bValid <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'cSlNo'</span> <span style="color: #000000;">]</span> := cSlNo <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'lNoModal'</span> <span style="color: #000000;">]</span> := lNoModal <br />hTmp<span style="color: #000000;">[</span> <span style="color: #ff0000;">'lAutoFit'</span> <span style="color: #000000;">]</span> := lAutoFit <br /> </div>[/code:1bxxa4jl]
[img:1bxxa4jl]https://mybergland.com/fwforum/acd_clip2.jpg[/img:1bxxa4jl] |
xBrowse functionality | Hello Rao ,
there are many methods to invoke a column :
oBrw:cHeader:Value
oBrw:oCol(cHeader ):Value
oBrw:aCols[1]:Value
is there a way to call a column with the name of the field?
Regards Maurizio |
xBrowse functionality | Search for a column whose :Expr is same as the field name |
xBrowse functionality | Thanks Rao
oBrw:fCol('CODIVA')
METHOD fCol(cField) CLASS TXBrowse
Local n := 0
FOR n := 1 to len(::aCols)
IF HB_IsString(::aCols[n]:cExpr) .and. UPPER(::aCols[n]:cExpr) == UPPER(cField)
exit
ENDIF
next
return If( n > 0, ::aCols[ n ], nil )
Regards Maurizio |
xBrowse group row | I have dbf:
[img:2st10l0l]http://www.intersped.co.rs/dbf.jpg[/img:2st10l0l]
I would like to browse receive the following:
[img:2st10l0l]http://www.intersped.co.rs/browse.jpg[/img:2st10l0l]
I tried to use oBrw:invoice:lMergeVert := .t. ... but how to group the column total as a rule column invoice?
Regards,
Miloš |
xBrowse group row | If you want to browse like in the second picture please try
oBrw:Invoice:lMergeVert := .t.
oBrw:Total:lMergeVert := .t.
both. |
xBrowse group row | If I try
oBrw:Invoice:lMergeVert := .t.
oBrw:Total:lMergeVert := .t.
total column is not grouped correctly, I do not want this result:
[img:39wro5u9]http://www.intersped.co.rs/browse2.jpg[/img:39wro5u9]
Regards,
Miloš |
xBrowse group row | Please try the logic in this sample program:
[code=fw:1iwidxll]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oFont, oBrw<br /><br /> CreateTestDBF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> USE TEST<br /> SET ORDER <span style="color: #0000ff;">TO</span> TAG INVOICE<br /> GO TOP<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>,<span style="color: #000000;">250</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg DATASOURCE <span style="color: #ff0000;">"TEST"</span> ;<br /> COLUMNS <span style="color: #ff0000;">"INVOICE"</span>, <span style="color: #ff0000;">"INVOICE"</span>, <span style="color: #ff0000;">"DATEPAY"</span>, <span style="color: #ff0000;">"PAYMENT"</span> ;<br /> HEADERS <span style="color: #ff0000;">"INVOICE"</span>, <span style="color: #ff0000;">"TOTAL"</span>, <span style="color: #ff0000;">"DATEPAY"</span>, <span style="color: #ff0000;">"PAYMENT"</span> ;<br /> CELL LINES NOBORDER<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nStretchCol</span> := <span style="color: #000000;">1</span><br /> :<span style="color: #000000;">Invoice</span>:<span style="color: #000000;">lMergeVert</span> := .t.<br /> WITH OBJECT :<span style="color: #000000;">Total</span><br /> :<span style="color: #000000;">lMergeVert</span> := .t.<br /> :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span> || TRANSFORM<span style="color: #000000;">(</span> TEST->TOTAL, NumPict<span style="color: #000000;">(</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</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;">""</span><br /> END<br /><br /> <span style="color: #B900B9;">//</span><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CreateTestDBF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> field INVOICE<br /><br /> <span style="color: #00C800;">if</span> ! File<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TEST.DBF"</span> <span style="color: #000000;">)</span><br /><br /> DbCreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TEST"</span>, <span style="color: #000000;">{</span> ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"INVOICE"</span>, <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"TOTAL"</span>, <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"DATEPAY"</span>, <span style="color: #ff0000;">'D'</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAYMENT"</span>, <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .t., <span style="color: #ff0000;">"TEST"</span> <span style="color: #000000;">)</span><br /><br /> FW_ArrayToDBF<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"101"</span>, <span style="color: #000000;">1000</span>, <span style="color: #000000;">{</span>^ <span style="color: #000000;">2014</span>/<span style="color: #000000;">05</span>/<span style="color: #000000;">01</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">500</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"101"</span>, <span style="color: #000000;">1000</span>, <span style="color: #000000;">{</span>^ <span style="color: #000000;">2014</span>/<span style="color: #000000;">05</span>/<span style="color: #000000;">05</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">500</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"101"</span>, <span style="color: #000000;">1000</span>, <span style="color: #000000;">{</span>^ <span style="color: #000000;">2014</span>/<span style="color: #000000;">05</span>/<span style="color: #000000;">05</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">100</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"102"</span>, <span style="color: #000000;">1000</span>, <span style="color: #000000;">{</span>^ <span style="color: #000000;">2014</span>/<span style="color: #000000;">05</span>/<span style="color: #000000;">10</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">300</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"102"</span>, <span style="color: #000000;">1000</span>, <span style="color: #000000;">{</span>^ <span style="color: #000000;">2014</span>/<span style="color: #000000;">05</span>/<span style="color: #000000;">15</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">600</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"103"</span>, <span style="color: #000000;">2000</span>, <span style="color: #000000;">{</span>^ <span style="color: #000000;">2014</span>/<span style="color: #000000;">05</span>/<span style="color: #000000;">15</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">1000</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> INVOICE TAG INVOICE<br /><br /> CLOSE <span style="color: #00C800;">DATA</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 /><br /><span style="color: #0000ff;">init</span> procedure PrgInit<br /><br /> SET DATE GERMAN<br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /><br /> SET DELETED <span style="color: #0000ff;">ON</span><br /> SET EXCLUSIVE OFF<br /><br /> RDDSETDEFAULT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /> XbrNumFormat<span style="color: #000000;">(</span> <span style="color: #ff0000;">'E'</span>, .t. <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:1iwidxll]
[url=http://img843.imageshack.us/i/osoni.jpg/:1iwidxll][img:1iwidxll]http://img843.imageshack.us/img843/3798/osoni.jpg[/img:1iwidxll][/url:1iwidxll] |
xBrowse group row | hi Mr. Rao
about this xBrowse,
I would like one row for each INVOICE and put near to INVOICE NUMBER "+" or "-" bmp to expande or collapse (under the INVOICE NUMBER or
to the right is indifferent) that INVOICE with value details
is it possible?
thank you |
xBrowse group row | That is achieved by Tree browse. Most of the time, we adopt tree browse for similar cases.
In this case, the user wanted this way, so I provided this solution for him. |
xBrowse group row | hi Mr. Rao
I'm trying wbrwtree sample but get rhis error:
Application
===========
Path and name: C:\fwh1709\samples\xbrwtree.exe (32 bits)
Size: 3,488,768 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20161218)
FiveWin version: FWHX 17.09
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 12/11/17, 10:40:17
Error description: Error BASE/1004 Class: 'NIL' has no exported method: CARGO
Args:
[ 1] = U
Stack Calls
===========
Called from: => CARGO( 0 )
Called from: xbrwtree.prg => MAIN( 19 )
any help? |
xBrowse group row | Please make sure "customer.dbf" is in the same folder. |
xBrowse group row | [quote:3eyg2gis]Please make sure "customer.dbf" is in the same folder.[/quote:3eyg2gis]
yes, it is! |
xBrowse group row | Tested again and it is working here.
Command prompt
[code=fw:260eebh4]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cd\fwh\samples<br />buildh xbrwtree<br />or<br />buildx xbrwtree<br /> </div>[/code:260eebh4]
Working |
xBrowse group row | hi Mr Rao
my Customer.dbf is empty.
if I try to open it by DBF editor i get INVALID DBF file
if I try to open it by excel (file dBase) it has just COLUMN HEADER
thank you |
xBrowse group row | That is the reason.
If you do a fresh install of FWH you get a full customer.dbf |
xBrowse group row | hi Mr Rao
yes That was the reason!
thank you. |
xBrowse header | Hi friends,
oCol := oBrw:AddCol()
oCol:bStrData := { || Tran(ARQCHEQ->VALOR,"@e 99,999,999.99") }
oCol:cHeader := "VALOR"
oCol:nDataStrAlign := AL_RIGHT
How i can do "VALOR" header aligned right?
Regards,
Wanderson. |
xBrowse header | oCol:nHeadStrAlign := AL_RIGHT
Just a remark, try to use define or defefine xbrowse command, alignment will be done automatically
in your case
redefine xbrowse obrw id xxxx of yyy ;
fields ARQCHEQ->VALOR ;
pictures ,"@e 99,999,999.99")
....
Your header does not align right because you are adding an alpha column Tran(ARQCHEQ->VALOR,"@e 99,999,999.99")
writing the code diffrently allows not to care about this,
Hth
Richard |
xBrowse header | Thank you Richard, works great!
Wanderson. |
xBrowse header | [code=fw:3f20yexb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">xbrowse</span> obrw <span style="color: #0000ff;">id</span> xxxx <span style="color: #0000ff;">of</span> yyy ;<br />fields ARQCHEQ->VALOR ;<br />pictures ,<span style="color: #ff0000;">"@e 99,999,999.99"</span><span style="color: #000000;">)</span> <br /> </div>[/code:3f20yexb]
If we are browsing ARQCHEQ, the following code is even better:
[code=fw:3f20yexb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">xbrowse</span> obrw <span style="color: #0000ff;">id</span> xxxx <span style="color: #0000ff;">of</span> yyy ;<br />COLUMNS <span style="color: #ff0000;">"VALOR"</span> ;<br />PICTURES <span style="color: #ff0000;">"@e 99,999,999.99"</span> ;<br /><span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'ARQCHEQ'</span> <br /> </div>[/code:3f20yexb]
In this case XBrowse knows more information about the field 'VALOR' in the DBF 'ARQCHEQ' and builds setget block. bonpostedit block, tries to see what order tag is to be selected for autosort and more.
This is the way to take the best out of XBrowse |
xBrowse header from an Array | To All
I know I have done this before ... I am creating an empty array without any rows and assigning it to xBrowse. I remember I could define the Headers from an array ... I do not want any rows to show in xBrowse .. I just want to define my columns with headers .. this does not work.
[code=fw:12kq50tl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />aPlan := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br />aColumns := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Budget Item"</span>, ;<br /> <span style="color: #ff0000;">"Origional Budget"</span>, ;<br /> <span style="color: #ff0000;">"Budget Revision"</span>, ;<br /> <span style="color: #ff0000;">"Current Budget"</span>, ;<br /> <span style="color: #ff0000;">"Origional Contract"</span>, ;<br /> <span style="color: #ff0000;">"Contract Revisions"</span>, ;<br /> <span style="color: #ff0000;">"Current Committed"</span>, ;<br /> <span style="color: #ff0000;">"Pending Proposals"</span>, ;<br /> <span style="color: #ff0000;">"Potential Exposures"</span>, ;<br /> <span style="color: #ff0000;">"Potential Costs"</span>, ;<br /> <span style="color: #ff0000;">"Potential Proj Costs"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbx3 ;<br /> ARRAY aPlan ;<br /> HEADERS aColumns ; <span style="color: #B900B9;">// <----- here</span><br /> COLSIZES <span style="color: #000000;">65</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span> ; <span style="color: #B900B9;">// 11</span><br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">174</span> <span style="color: #0000ff;">of</span> oCust ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES<br /><br /> </div>[/code:12kq50tl]
[img:12kq50tl]http://i58.tinypic.com/1zof440.jpg[/img:12kq50tl]
Thanks
Rick Lipkin |
xBrowse header from an Array | Try
[code=fw:21cl6hqj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />HEADERS aColumns<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> ; <span style="color: #B900B9;">// <----- here</span><br /> </div>[/code:21cl6hqj] |
xBrowse header from an Array | Christabol
Unfortunately .. that did not work ..
[img:15jolxc5]http://i58.tinypic.com/raoq6b.jpg[/img:15jolxc5]
Rick Lipkin |
xBrowse header from an Array | I think you have to build the Array in this way!
[code=fw:2mmnzfuc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />aPlan := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br />aColumns := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Budget Item"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Origional Budget"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Budget Revision"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Current Budget"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Origional Contract"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Contract Revisions"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Current Committed"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Pending Proposals"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Potential Exposures"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Potential Costs"</span> <span style="color: #000000;">)</span><br />AAdd<span style="color: #000000;">(</span> aColumns, <span style="color: #ff0000;">"Potential Proj Costs"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbx3 ;<br /> ARRAY aPlan ;<br /> HEADERS aColumns ; <span style="color: #B900B9;">// <----- here</span><br /> COLSIZES <span style="color: #000000;">65</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span> ; <span style="color: #B900B9;">// 11</span><br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">174</span> <span style="color: #0000ff;">of</span> oCust ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES<br /> </div>[/code:2mmnzfuc] |
xBrowse header from an Array | Anton
Your solution works as long as aPlan has a single record .. I wanted to leave ( the data ) aPlan empty.
Thanks
Rick |
xBrowse header from an Array | To All
Kind of a sloppy work around was to resize the array to zero ON INIT
[code=fw:2syk70o5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oCust <span style="color: #0000ff;">NOWAIT</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> oCust:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span>,Asize<span style="color: #000000;">(</span> aPlan,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,oLbx3:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">//<----- </span><br /> <span style="color: #0000ff;">VALID</span><span style="color: #000000;">(</span>!GETKEYSTATE<span style="color: #000000;">(</span> <span style="color: #000000;">27</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> </div>[/code:2syk70o5]
[img:2syk70o5]http://i62.tinypic.com/rc0spl.jpg[/img:2syk70o5]
Was hoping for a more elegant solution.
Rick LIpkin |
xBrowse header from an Array | Hey Rick;
I'm a friend of anything that works. Even better If it can be done elegantly but at the end of the day all that matters is if it works and how much time/effort it took. Admittedly I like it simple, stupid and quick. So far I happen to be doing the same thing as you to solve this very same problem. Thank you for posting this question. I was hoping you got a better answer to this thread. I'm sure there is. Please keep me posted if you do find it.
Best regards,
Reinaldo. |
xBrowse header from an Array | Rick,
I don't know if this would help, but did you know you can create temp data files in memory? They are like arrays but work just like DBFs. There was a recent thread on this. Perhaps this would solve your header problem.
James |
xBrowse header from an Array | Rick
Try,
REDEFINE xBROWSE oLbx3 ;
ARRAY aPlan ;
HEADERS aColumns ; // <----- here
[color=#BF0000:lpitzzpu] COLUMNS 1,2,3,4,5,6,7,8,9,10,11 ; <------ Add[/color:lpitzzpu]
COLSIZES 65,43,43,43,43,43,43,43,43,43,43 ; // 11
ID 174 of oCust ;
AUTOCOLS CELL LINES
Regards
Paco |
xBrowse header from an Array | Method-1
[code=fw:3q69jb9b]<div class="fw" id="{CB}" style="font-family: monospace;">aPlan := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br />aColumns := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br />aHeaders := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Budget Item"</span>, ;<br /> <span style="color: #ff0000;">"Origional Budget"</span>, ;<br /> <span style="color: #ff0000;">"Budget Revision"</span>, ;<br /> <span style="color: #ff0000;">"Current Budget"</span>, ;<br /> <span style="color: #ff0000;">"Origional Contract"</span>, ;<br /> <span style="color: #ff0000;">"Contract Revisions"</span>, ;<br /> <span style="color: #ff0000;">"Current Committed"</span>, ;<br /> <span style="color: #ff0000;">"Pending Proposals"</span>, ;<br /> <span style="color: #ff0000;">"Potential Exposures"</span>, ;<br /> <span style="color: #ff0000;">"Potential Costs"</span>, ;<br /> <span style="color: #ff0000;">"Potential Proj Costs"</span> <span style="color: #000000;">}</span> <br /><br />AEval<span style="color: #000000;">(</span> aHeaders, <span style="color: #000000;">{</span> |u,i| AAdd<span style="color: #000000;">(</span> aColumns, i <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbx3 ;<br /> ARRAY aPlan ;<br /> COLUMNS aColumns ;<br /> HEADERS aHeaders ; <span style="color: #B900B9;">// <----- here</span><br /> COLSIZES <span style="color: #000000;">65</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span>,<span style="color: #000000;">43</span> ; <span style="color: #B900B9;">// 11</span><br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">174</span> <span style="color: #0000ff;">of</span> oCust ;<br /> CELL LINES<br /> </div>[/code:3q69jb9b]
METHOD-2
[code=fw:3q69jb9b]<div class="fw" id="{CB}" style="font-family: monospace;">aPlan := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br />aSpec := <span style="color: #000000;">{</span> ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Budget Item"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">65</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"Origional Budget"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">3</span>, <span style="color: #ff0000;">"Budget Revision"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">4</span>, <span style="color: #ff0000;">"Current Budget"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">5</span>, <span style="color: #ff0000;">"Origional Contract"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">6</span>, <span style="color: #ff0000;">"Contract Revisions"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">7</span>, <span style="color: #ff0000;">"Current Committed"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"Pending Proposals"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">9</span>, <span style="color: #ff0000;">"Potential Exposures"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">10</span>, <span style="color: #ff0000;">"Potential Costs"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">11</span>, <span style="color: #ff0000;">"Potential Proj Costs"</span>,<span style="color: #00C800;">nil</span>, <span style="color: #000000;">43</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">// { Exprn/ArrayColNo, cHeader, cPicture, nWidth, lnAlign, cSortOrder } </span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbx3 ;<br /> ARRAY aPlan ;<br /> COLUMNS aSpec ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">174</span> <span style="color: #0000ff;">of</span> oCust ;<br /> CELL LINES<br /> </div>[/code:3q69jb9b]
Personally I prefer to write my programs using the Method-2. |
xBrowse header move | Hi,
Is there a way to disable the column swap if you drag a header of a xbrowse to another column?
I only want the header moved, and not the column.
Thanks,
Marc |
xBrowse header move | Hello Marc,
the header is connected to the Column,
but You can use my solution ( You question before ),
to change the column-titles ( rename => title 1= title 2, title 2 = title 1 )
The change You can define on any action ( buttons, mouseclick inside the xBrowse ... )
[code:1509tcev]
// Change a Col-title on Button-action
// Column 2 with a new title
// -----------------------------------------
REDEFINE BUTTONBMP oBtn ID 10 OF oFld:aDialogs[1] ;
ACTION ( oLbx:aCols[ 2 ]:cHeader := "New Title", oLbx:Refresh(), ;
.....
.....
[/code:1509tcev]
You don't need to move the xBrowse-Header.
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse header move | Uwe,
I used your suggestion for changing the text in the headers, but I was just wondering I could change the action that is executed for swapping colums into just swap the headers...
In tsbrowse there was a function that was called everytime you swap columns.
Regards,
Marc |
xBrowse header move | Hi,
Is there than a possibility to disable the column-swap?
Thanks,
Marc |
xBrowse header move | Marc,
oBrw:lAllowColSwapping := .F. |
xBrowse header move | Thanks Antonio
Regards,
Marc |
xBrowse header sort change picture | At the moment if I change the sort order of xBrowse I use to change the header picture :
oxBrw:LButtonDown( 1, 61, 0 )
oxBrw:LButtonUp( 1, 61, 0 )
to simulate a click on the header.
Sure there is a better way.
Thanks in advance
Otto |
xBrowse header sort change picture | Hello Otto,
can You explain a bit more in detail, what You want to do ?
There are many possible ways, to change the sort order of the columns :
On Button-action, move the columns with the mouse,
swap columns with mouse-click on a header, right mouse-click inside a data-area and more ...
Just like the text of the header, You can change the bitmap as well on any action.
There is no header-click necessary.
I have done some solutions, but I don't know what to use for Your application.
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse header sort change picture | Hello Uwe,
thank you for your answer.
This is what I want to do:
I delete a record –
then I refresh() the xbrowse –
after the xbrowse gets focus again I want that the sort order is on column 1.
The bitmap must be changed that column 1 is selected.
Thanks in advance
Otto |
xBrowse header sort change picture | Hello Otto,
I included the header-painting inside the delete-button-action
It is just the basics, to give You a idea, much more fine-tuning is possible.
There could be a test, if the database contains no deleted record < recall >,
change back to green and so on.
A solution could be, a index on deleted records.
In this case, using the delete-button for delete or recall, You only need to test the 1. Record :
A function could include something like that :
[code:uqy98g7j]
FUNCTION TEST_DEL()
local lDel := .F.
local nOldOrder := INDEXORD()
local nOldrecord := RECNO()
DBSELECTAREA(1)
Net_RLock( 1, 1 )
IF DELETED()
Net_Recall( 1, 1 )
ELSE
Net_Delete ( 1, 1 )
ENDIF
Net_ULock()
DBSETORDER( 2 ) // index on deleted
DBGOTOP()
IF deleted()
lDel = .T.
ENDIF
DBSETORDER( nOldORDER )
DBGOTO( nOldrecord )
RETURN( lDel )
[/code:uqy98g7j]
I think You want the header marked, if the database has any deleded records included ?
[code:uqy98g7j]
....
....
// 1. Column
// -------------
oCol := oLbx1:AddCol()
oCol:AddResource( "Green" )
oCol:bStrData := { || (1)->Last}
oCol:cHeader := "Last"
oCol:cFooter := "Last"
oCol:nHeadBmpNo := 1
// 2. Column ( Indexed )
// --------------------------
oCol := oLbx1:AddCol()
oCol:AddResource( "Green" )
oCol:AddResource( "Red" )
oCol:bStrData := { || (1)->First}
oCol:cHeader := "First"
oCol:cFooter := "First"
oCol:bBmpData := {|| IIF( deleted(), 2, 1 ) }
oCol:nHeadBmpNo := 1
// 3. Column
// ------------
oCol := oLbx1:AddCol()
oCol:AddResource( "Green" )
oCol:bStrData := { || (1)->City}
oCol:cHeader := "City"
oCol:cFooter := "City"
oCol:nHeadBmpNo := 1
....
....
// Use Your delete-function or include < TEST_DEL() >
// REDEFINE BUTTONBMP oBtn7 ID 70 OF oDlg ;
// ACTION ( IIF( TEST_DEL() = .T., ;
// ( oLbx1:SwapCols( 1, 2 ), ; // Bring selected col 2 ( indexed ) to 1
// oLbx1:GoLeftMost(), ; // Go to 1. Col ( indexed )
// oLbx1:aCols[1]:nHeadBmpNo := 2 ), ; // Red BMP from Col-resource
// oLbx1:aCols[1]:nHeadBmpNo := 1 ), ; // Green BMP from Col-resource
// oLbx1:Refresh() ) ;
// BITMAP "Delete" PROMPT " &Delete" TEXTRIGHT
// oBtn7:cToolTip = { "Delete" + CRLF + ;
// "a Record","Record-Delete", 1, CLR_BLACK, 14089979 }
// If TEST_DEL() = .F., reset the swapt columns to the original positon with a Green BMP.
REDEFINE BUTTONBMP oBtn7 ID 70 OF oDlg ;
ACTION ( DB_SET(), ; // Delete and Recall-function
oLbx1:SwapCols( 1, 2 ), ; // Bring selected col 2 ( indexed ) to 1
oLbx1:GoLeftMost(), ; // Go to 1. Col ( indexed )
oLbx1:aCols[1]:nHeadBmpNo := 2, ; // Red BMP from Col-resource
oLbx1:Refresh() ) ;
BITMAP "Delete" PROMPT " &Delete" TEXTRIGHT
oBtn7:cToolTip = { "Delete" + CRLF + ;
"a Record","Record-Delete", 1, CLR_BLACK, 14089979 }
[/code:uqy98g7j]
The basic-view
[img:uqy98g7j]http://www.pflegeplus.com/pictures/header11.jpg[/img:uqy98g7j]
After deleting
[img:uqy98g7j]http://www.pflegeplus.com/pictures/header12.jpg[/img:uqy98g7j]
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse headers | Hallo zusammen,
benutzt irgend jemand xBrowse ?
Ich hab folgendes Problem, der Header wird nicht angezeigt, wenn keine Daten vorhanden sind.
Ich habe eine Scope gesetzt und manchmal sind halt keine Daten da, die diese Bedingung erfüllen. Somit sind die Datenzeilen leer. Dann wird aber auch der Header nicht angezeigt, erst wenn ich mit der linken Maustaste auf einen Header klicke, wird er sichtbar.
Hat jemand eine Lösung ?
Gruß
Stefan |
xBrowse headers | Stefan,
In Class TXBrowse Method Paint() comment out this line and please try it again:
[code:2go51l6t]
if ::nLen == 0
// ::EraseData( nFirstRow )
return nil
endif
[/code:2go51l6t] |
xBrowse headers | Die Lösung gibts hier
[url:2hz4ecfm]http://fivetechsoft.com/forums/viewtopic.php?t=7241[/url:2hz4ecfm]
Stefan |
xBrowse headers disappear | I am using xBrowse (FWH 2.6) to show database registers (not arrays)
It works ok but when I move the scroll bar vertically, and, sometimes when I move from a register to the next, the headers disappear (that is, get painted blank). Usually, the get repainted when I manually force a "Goto begining or "goto end" but that gets unconfortable.
Anybody has a solution for this anomaly?
Rafael |
xBrowse headers disappear | Rafael,
I had this and others problems with xBrowse that was solved in 2.7.
Try edit xBrowse.prg and change all ::lRefreshOnlyData to .F.
It will force xBrowse to refresh all including headers and footers
Regards
Maurilio |
xBrowse headers disappear | Maurilio:
Thanks for your answer. I got a similiar suggestion from Biel in the FWH Spanish forum. I tried it and have found that it seems enough to comment the line ::lRefreshOnlyData := .T. in the VScroll method.
Hope that this information is usefult to somebody else.
Thanks for your help
Rafael |
xBrowse horizontal and vertical lines colors | Hi!
Where I must change into xBrowse class to let us change the color of horizontal and/or vertical lines?
Regards,
Maurilio |
xBrowse horizontal and vertical lines colors | Maurilio,
Class TXBrowse uses three pens to draw the lines:
[code:qlx0zupp]
DEFAULT ::hBtnShadowPen := CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNSHADOW ) ),;
::hWhitePen := CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNHIGHLIGHT ) )
if ::hColPen != nil
DeleteObject( ::hColPen )
::hColPen := nil
endif
nStyle := ::nColDividerStyle
do case
case nStyle == LINESTYLE_BLACK .or. nStyle == LINESTYLE_RAISED .or. nStyle == LINESTYLE_INSET
::hColPen := CreatePen( PS_SOLID, 1, CLR_BLACK )
case nStyle == LINESTYLE_DARKGRAY
::hColPen := CreatePen( PS_SOLID, 1, CLR_GRAY )
case nStyle == LINESTYLE_FORECOLOR
::hColPen := CreatePen( PS_SOLID, 1, ::nClrText )
case nStyle == LINESTYLE_LIGHTGRAY
::hColPen := CreatePen( PS_SOLID, 1, CLR_LIGHTGRAY )
end case
[/code:qlx0zupp]
You may change the colors used there and/or look for LineTo() in the source code and use another pen of your own |
xBrowse horizontal and vertical lines colors | Thanks a lot, Antonio!!!
I changed the color and it worked fine.
Regards!
Maurilio |
xBrowse how to change bound array | On a TAB I would like to show an XBrowse. If I switch from one to the other and I would like to change the ARRAY bound to the xBrowse.
I do it this way but I get an error.
Do I need one xBrowse per folder or could I change the array during runtime.
Thanks in advance
Otto
[code=fw:1kcdolbh]<div class="fw" id="{CB}" style="font-family: monospace;">@ <span style="color: #000000;">460</span>, <span style="color: #000000;">0</span> TABS oTabs ; <br /> <span style="color: #0000ff;">PROMPTS</span> <span style="color: #ff0000;">"&Properties"</span>, <span style="color: #ff0000;">"&Events"</span> <span style="color: #0000ff;">OF</span> oWndlocal <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">340</span>,<span style="color: #000000;">200</span>; <br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oTabs:<span style="color: #000000;">nOption</span> == <span style="color: #000000;">1</span>,<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">(</span> aData,.t.<span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">(</span> aData2,.t.<span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> </div>[/code:1kcdolbh]
[quote:1kcdolbh] Error occurred at: 07/28/09, 18:37:10
Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = U
[ 2] = N 2
Stack Calls
===========
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:LASTDISPLAYPOS(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(0)
Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(0)
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG(0)
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS(0)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBRWCOLUMN:SORTARRAYDATA(0))[/quote:1kcdolbh] |
xBrowse how to change bound array | Otto,
Try a sysrefresh() bewteen the setArray() and Refresh(). If that doesn't work, then you may want to try compiling a copy of xBrowse and linking it so you can get line numbers in the error message. This way you can see which line is erroring out.
James |
xBrowse how to change bound array | Hello James,
thank you for your answer.
The error occurs in this line:
nWidth += ::ColAtPos( nPos++ ):nWidth + COL_SEPARATOR
But maybe I need a special reset command.
The sample with SETRDD() xBrwalia.prg in the samples works well.
I will have a closer look into SETARRAY-method.
Best regards,
Otto |
xBrowse how to change bound array | Otto,
[code=fw:1vbn0wbx]<div class="fw" id="{CB}" style="font-family: monospace;">Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1081</span> Argument error: +<br />Args:<br /><span style="color: #000000;">[</span> <span style="color: #000000;">1</span><span style="color: #000000;">]</span> = U <br /><span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span> = N <span style="color: #000000;">2</span><br /><br />nWidth += ::<span style="color: #000000;">ColAtPos</span><span style="color: #000000;">(</span> nPos++ <span style="color: #000000;">)</span>:<span style="color: #000000;">nWidth</span> + COL_SEPARATOR</div>[/code:1vbn0wbx]
Hmm, the error message doesn't make sense to me. It seems to be saying there is an error with nPos++, but then it is saying there are two passed parameters, the first of which is undefined. But, there is only one passed parameter...
I would try putting some msgInfo() debugging code into the LastDisplayPos() method to see if you can isolate the problem. Maybe ::ColAtPos( nPos++ ):nWith is nil? You could try msgInfo( ::ColAtPos( 1 ):nWidth).
James |
xBrowse how to change bound array | Hello James,
If I change the SetArray -method like this it is working - but I am not aware of the side effects:
Best regards,
Otto
[code=fw:1908jp43]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lCreated</span><br /> <br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nDataType</span> == DATATYPE_ARRAY<br /> <span style="color: #B900B9;">// if SameArrayStruct( Self, aData )</span><br /> <br /> <span style="color: #B900B9;">// ::aArrayData = aData</span><br /> <span style="color: #B900B9;">// ::aCols := {}</span><br /> <span style="color: #B900B9;">//return nil</span><br /> <span style="color: #B900B9;">// lReset := .t.</span><br /> <span style="color: #B900B9;">// else</span><br /> <span style="color: #B900B9;">// ::aCols := {}</span><br /> lReSet := .t.<br /> <span style="color: #B900B9;">// endif</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">ClearBlocks</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aCols</span> := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> lReset := .t.<br /> <span style="color: #00C800;">endif</span><br /> <br /> <br /> <span style="color: #00C800;">endif</span></div>[/code:1908jp43] |
xBrowse how to change bound array | Otto,
It looks like it might be a bug. If Antonio doesn't respond to this thread in a day or two, I would email him with a simple example program that shows the error, along with your solution.
James |
xBrowse how to change bound array | Hello James,
thank you. I forgot to mention that I am still on 9.01 FWH. Maybe this is resolved in one of the most current releases.
I will download tomorrow the last version an try with this.
Best regards,
Otto |
xBrowse how to change bound array | Otto,
I have a newer version and the code is slightly different. Try this
[code=fw:hx39m6z2]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nDataType</span> == DATATYPE_ARRAY<br /> <span style="color: #00C800;">if</span> SameArrayStruct<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, aData <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aArrayData</span> = aData<br /> <span style="color: #B900B9;">// ::aCols:= {}</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">aCols</span> := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> lReSet := .t.<br /> <span style="color: #00C800;">endif</span></div>[/code:hx39m6z2]
James |
xBrowse how to change bound array | Mr Otto
I have a running application with tabs and switching arrays. I implemented it when xbrowse was not so mature.
If I have to rewrite that code now, I might switch browses instead of arrays. I am giving a small sample working application here.
[code=fw:asidooa1]<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: #B900B9;">//------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oPanel, oBar, oTabs<br /> <span style="color: #00C800;">local</span> aBrw<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">local</span> aData1 := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #000000;">7</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">9</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> aData2 := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">'AA'</span>,<span style="color: #ff0000;">'BB'</span>,<span style="color: #ff0000;">'CC'</span>,<span style="color: #ff0000;">'DD'</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">'EE'</span>,<span style="color: #ff0000;">'FF'</span>,<span style="color: #ff0000;">'GG'</span>,<span style="color: #ff0000;">'HH'</span><span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'II'</span>,<span style="color: #ff0000;">'JJ'</span>,<span style="color: #ff0000;">'KK'</span>,<span style="color: #ff0000;">'LL'</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">'MM'</span>,<span style="color: #ff0000;">'NN'</span>,<span style="color: #ff0000;">'OO'</span>,<span style="color: #ff0000;">'PP'</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #000000;">2007</span><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">2007</span><br /><br /> oPanel := TPanel<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> ,,,, oWnd <span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">oClient</span> := oPanel<br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> aBrw<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">OF</span> oPanel ;<br /> HEADERS <span style="color: #ff0000;">'One'</span>, <span style="color: #ff0000;">'Two'</span>, <span style="color: #ff0000;">'Three'</span> ;<br /> ARRAY aData1 <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES<br /><br /> aBrw<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> aBrw<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">OF</span> oPanel ;<br /> HEADERS <span style="color: #ff0000;">'AAAA'</span>, <span style="color: #ff0000;">'BBBB'</span>, <span style="color: #ff0000;">'CCCC'</span> ;<br /> ARRAY aData2 <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES<br /><br /> aBrw<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> aBrw<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oPanel:<span style="color: #000000;">oClient</span> := aBrw<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /><br /> @ <span style="color: #000000;">400</span>,<span style="color: #000000;">0</span> TABS oTabs <span style="color: #0000ff;">PROMPTS</span> <span style="color: #ff0000;">'First'</span>, <span style="color: #ff0000;">'Second'</span> <span style="color: #0000ff;">OF</span> oPanel ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> ChangeBrw<span style="color: #000000;">(</span> nOption, nOldOption, aBrw <span style="color: #000000;">)</span><br /><br /> oPanel:<span style="color: #000000;">oBottom</span> := oTabs<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ChangeBrw<span style="color: #000000;">(</span> nNew, nOld, aBrw <span style="color: #000000;">)</span><br /><br /> aBrw<span style="color: #000000;">[</span> nOld <span style="color: #000000;">]</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> aBrw<span style="color: #000000;">[</span> nNew <span style="color: #000000;">]</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oClient</span> := aBrw<span style="color: #000000;">[</span> nNew <span style="color: #000000;">]</span><br /> aBrw<span style="color: #000000;">[</span> nNew <span style="color: #000000;">]</span>:<span style="color: #000000;">Enable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> aBrw<span style="color: #000000;">[</span> nNew <span style="color: #000000;">]</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> aBrw<span style="color: #000000;">[</span> nNew <span style="color: #000000;">]</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">Resize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------//</span><br /> </div>[/code:asidooa1]
Switching browses has many advantages over switching arrays.
1. You are XBrowse version independant.
2. Different browses can have different datasources, like arrays, dbfs, recordsets
3. Browse states are preserved when switching
Note: I used TPanel because I want to have both message bar and tabs also. If you don't need message bar, you don't have to have TPanel. You can straight away create the browses in the window itself instead of in the Panel |
xBrowse how to change bound array | Hello Mr. Rao,
Thank you for your help.
I too use xbrowse the same way you suggest especially if I mix listbox and xbrowse on different Tabs of a folder.
Only I saw that xBrwalia.prg lets you switch between different dbf-files I tried to do it with Arrays but with no success.
I compared the SETRDD and the SETARRAY method and found out commenting out some lines of the SETARRAY method you can get it working.
Coming from the 286MHz and 16-64 k RAM times I still have in mind to use as less objects an code as possible.
Best regards,
Otto |
xBrowse how to change bound array | Otto,
to change the array of a xbrowse I use
[code=fw:17nib9t9]<div class="fw" id="{CB}" style="font-family: monospace;">::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := ::<span style="color: #000000;">aNewArray</span><br />::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:17nib9t9] |
xBrowse how to change bound array | Hello Stefan,
thank you so much. Your code is working for me.
Best regards,
Otto |
xBrowse how to change bound array | Mr Otto
[quote:chwe73ji]I compared the SETRDD and the SETARRAY method and found out commenting out some lines of the SETARRAY method you can get it working.[/quote:chwe73ji]
Then let me too try it. When I tested with the above two arrays in my example, it worked well. ( Because the two arrays did not have the same structure)
Can i have sample of the two array structures you tried to switch and got error ? i would like to experiment too |
xBrowse how to change bound array | Dear Mr.Otto,
This code is working for me
[code=fw:2m5dsers]<div class="fw" id="{CB}" style="font-family: monospace;">oBrwMenu:<span style="color: #000000;">aArrayData</span>:=aMenu<br />oBrwMenu:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oBrwMenu:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:2m5dsers]
Contents of the second xBrowse (right hand side) changes when the user scrolls thru the xBrowse on the left hand side. Array data is used in the right hand side xBrowse and its array data contents are changed dynamically.
[url=http://imageshack.us:2m5dsers][img:2m5dsers]http://img98.imageshack.us/img98/9871/xbrwhm8.jpg[/img:2m5dsers][/url:2m5dsers]
Regards
Anser |
xBrowse how to change bound array | Mr Anser
The point is that the promised behavior of SetArray is giving errors. If so that need to be rectified by FWH.
It is true we can achieve the objective in some other ways.
The promised behavior is that at run time we can change the datasource from any to any.
If there are bugs in this feature, they have an opportunity to rectify in next releases, if we can point our the problem precisely |
xBrowse how to change bound array | Otto,
Please try my suggested code in my previous message. Just comment out the one line. This line is not in the current version of xbrowse. This will tell us if the problem has been fixed in the current version.
James |
xBrowse how to change bound array | James,
when I am at home I try and give you a feedback.
Best regards,
Otto |
xBrowse how to show 1 DBF in 2 browser with diff. indexes ? | Hello,
I must show 2 browser with different indexes
the first UNIQUE ( index by < names > ) the second ( Index by < names + articel > )
is that possible ?
The problem :
before I used a customer.dbf and a article.dbf with relation on customer-name.
It works fine but It can be, that the custumer is not included in custumer.dbf anymore after some years
to make it possible to select the customer and control the articles.
I have to use the included names from the articel.dbf using UNIQUE for the customer-selection
to show the related articles in browser 2.
I noticed only the 2. index is used
Browser 1 and browser 2 are using the same index
My test to split the customer.dbf in 2 browser.
USE customer NEW SHARED ALIAS CUSTOMER VIA 'DBFCDX'
ORDCREATE( ,"CUST1", "UPPER(LAST)", ;
{|| UPPER(LAST) } ,[color=#FF0000:fiu4gtaq] .T. ) // .T. = UNIQUE IGNORED !!![/color:fiu4gtaq]
ORDCREATE( ,"CUST2", "UPPER(LAST)", ;
{|| UPPER(LAST) } , .F. )
My test
[img:fiu4gtaq]http://www.pflegeplus.com/IMAGES/Unique3.jpg[/img:fiu4gtaq]
[code=fw:fiu4gtaq]<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;">'ord.ch'</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//-------------------------------------- </span><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oDlg, oBrw1, oBrw2, oFont1, oFont2, oBtn1<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont2 <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;">-18</span><br /><br />SETBALLOON<span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Balloon shape required for tooltips</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">590</span>, <span style="color: #000000;">540</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> ;<br /><span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing UNIQUE in XBrowse"</span> ;<br /><span style="color: #0000ff;">FONT</span> oFont1<br /><br /><span style="color: #B900B9;">// ------</span><br /><br />USE customer <span style="color: #00C800;">NEW</span> SHARED <span style="color: #0000ff;">ALIAS</span> CUSTOMER VIA <span style="color: #ff0000;">'DBFCDX'</span><br />ORDCREATE<span style="color: #000000;">(</span> ,<span style="color: #ff0000;">"CUST1"</span>, <span style="color: #ff0000;">"UPPER(LAST)"</span>, ;<br /> <span style="color: #000000;">{</span>|| UPPER<span style="color: #000000;">(</span>LAST<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> , .T. <span style="color: #000000;">)</span> <span style="color: #B900B9;">// .T. = UNIQUE</span><br />ORDCREATE<span style="color: #000000;">(</span> ,<span style="color: #ff0000;">"CUST2"</span>, <span style="color: #ff0000;">"UPPER(LAST)"</span>, ;<br /> <span style="color: #000000;">{</span>|| UPPER<span style="color: #000000;">(</span>LAST<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> , .F. <span style="color: #000000;">)</span> <br /><br />DBSELECTAREA<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CUSTOMER"</span> <span style="color: #000000;">)</span><br /><span style="color: #000000;">(</span><span style="color: #ff0000;">"CUSTOMER"</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DBSETORDER<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CUST1"</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #000000;">(</span><span style="color: #ff0000;">"CUSTOMER"</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <br />@ <span style="color: #000000;">15</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">XBROWSE</span> oBrw1 ;<br />COLUMNS <span style="color: #ff0000;">'Last'</span>, <span style="color: #ff0000;">'Age'</span>, <span style="color: #ff0000;">'Value'</span> ;<br /><span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">220</span>, <span style="color: #000000;">112</span> <span style="color: #0000ff;">PIXEL</span> ;<br />COLSIZES <span style="color: #000000;">195</span>, <span style="color: #00C800;">NIL</span>, <span style="color: #000000;">95</span> ;<br />PICTURES <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">'999.99 %'</span>, <span style="color: #ff0000;">'999999.99'</span> ;<br /><span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CUSTOMER'</span> ;<br />CELL LINES <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT <br /><br />oBrw1:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBrw1:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> oBrw1:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">15329747</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> oBrw1:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">16053482</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oBrw1:<span style="color: #000000;">bClrSel</span> := ;<br />oBrw1:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> oBrw1:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">14935039</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br />oBrw1:<span style="color: #000000;">nRecSelColor</span> := <span style="color: #000000;">14201187</span> <br /><br />WITH OBJECT oBrw1<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END<br /><br /> <br /><span style="color: #B900B9;">// ----------------- BROWSER 2</span><br /><br />DBSELECTAREA<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CUSTOMER"</span> <span style="color: #000000;">)</span><br /><span style="color: #000000;">(</span><span style="color: #ff0000;">"CUSTOMER"</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DBSETORDER<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CUST2"</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #000000;">(</span><span style="color: #ff0000;">"CUSTOMER"</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br />@ <span style="color: #000000;">140</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">XBROWSE</span> oBrw2 ;<br /> COLUMNS <span style="color: #ff0000;">'Last'</span>, <span style="color: #ff0000;">'Age'</span>, <span style="color: #ff0000;">'Value'</span> ;<br /> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">220</span>, <span style="color: #000000;">112</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> COLSIZES <span style="color: #000000;">195</span>, <span style="color: #00C800;">NIL</span>, <span style="color: #000000;">95</span> ;<br /> PICTURES <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">'999.99 %'</span>, <span style="color: #ff0000;">'999999.99'</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CUSTOMER'</span> ;<br /> CELL LINES <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT <br /><br />oBrw2:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBrw2:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> oBrw2:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">15329747</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> oBrw2:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">16053482</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oBrw2:<span style="color: #000000;">bClrSel</span> := ;<br />oBrw2:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> oBrw2:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">14935039</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br />oBrw2:<span style="color: #000000;">nRecSelColor</span> := <span style="color: #000000;">14201187</span> <br /><br /><br />WITH OBJECT oBrw2<br /><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />END<br /> <br /><span style="color: #B900B9;">// ------------</span><br /><br />@ <span style="color: #000000;">240</span>, <span style="color: #000000;">250</span> <span style="color: #0000ff;">BTNBMP</span> oBtn1 <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">37</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #000000;">2007</span> ;<br />BORDER <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ROUND</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Exit"</span> ;<br /><span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oBtn1:<span style="color: #000000;">bClrGrad</span> := <span style="color: #000000;">{</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! lMouseOver,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.5</span>, <span style="color: #000000;">14342911</span>, <span style="color: #000000;">16119295</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #000000;">0.5</span>, <span style="color: #000000;">16119295</span>, <span style="color: #000000;">14342911</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.5</span>, <span style="color: #000000;">14277043</span>, <span style="color: #000000;">16053482</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #000000;">0.5</span>, <span style="color: #000000;">16053482</span>, <span style="color: #000000;">14277043</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oBtn1:<span style="color: #000000;">cToolTip</span> = <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Exit"</span> + CRLF + <span style="color: #ff0000;">"test"</span>,<span style="color: #ff0000;">"EXIT"</span>, <span style="color: #000000;">1</span>, CLR_BLACK, <span style="color: #000000;">14089979</span> <span style="color: #000000;">}</span><br />oBtn1:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">)</span><br /><br />DLG_BRUSH<span style="color: #000000;">(</span>oDlg, <span style="color: #000000;">2</span>, <span style="color: #000000;">16182746</span>, <span style="color: #ff0000;">"Wall.bmp"</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont1<br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont2<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// --------------------------------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> DLG_BRUSH<span style="color: #000000;">(</span>oDlg, nStyle, nColor, cBmp, cImage<span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oBrush, oImage<br /><span style="color: #00C800;">LOCAL</span> aRect := GETCLIENTRECT<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">IF</span> nStyle = <span style="color: #000000;">1</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #0000ff;">COLOR</span> nColor<br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> nStyle = <span style="color: #000000;">2</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILENAME cBmp<br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> nStyle = <span style="color: #000000;">3</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">IMAGE</span> oImage FILE cImage<br /> oBrush := TBrush<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span> ,,,, ResizeBmp<span style="color: #000000;">(</span> oImage:<span style="color: #000000;">hBitmap</span>, aRect<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>, aRect<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>, .T. <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /> oImage:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDIF</span><br />oDlg:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">(</span> oBrush <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:fiu4gtaq]
any idea ?
best regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse how to show 1 DBF in 2 browser with diff. indexes ? | you can open de same database in two diferenta areas
use customer index cust1 shared new alias data1
use customer index cust2 shared new alias data2
sele data1
xbrowse
sele data2
xbrowse |
xBrowse how to show 1 DBF in 2 browser with diff. indexes ? | Marco,
thank You very much.
The problem was, to include / change the logic of my existing code.
Belongs to my extra Network-library and some other functions.
It seems I got it working now.
best regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
xBrowse how to show 1 DBF in 2 browser with diff. indexes ? | If you use database objects ( so much easier ), you simply open two different objects. It's a very easy solution. Also, you don't have to track "areas" ... |
xBrowse how to show a button-seek-result on top | Mr. Rao,
thank You very much
tested but the seek-result is still displayed on different row-positions
[color=#0000FF:201m0bdi][b:201m0bdi]("TOUREN")->(DBSEEK( TRIM(cTour) ) ) // on Button-action
oBrw1:nRowSel := 1
oBrw1:Refresh()[/b:201m0bdi][/color:201m0bdi]
the result of the other test
[color=#0000FF:201m0bdi][b:201m0bdi]oBrw:nClrText := <nNewColor>[/b:201m0bdi][/color:201m0bdi]
the color is only shown on selector-header, not the rows
[img:201m0bdi]http://www.pflegeplus.com/IMAGES/Xbrwsel5.jpg[/img:201m0bdi]
The result including my changes
[img:201m0bdi]http://www.pflegeplus.com/IMAGES/Xbrwsel6.jpg[/img:201m0bdi]
another test gives the needed result und moves to the top but destroys the new recordselector-counter
maybe changing the contens of the codeblock ( it is just a test )
[img:201m0bdi]http://www.pflegeplus.com/IMAGES/Xbrwsel7.jpg[/img:201m0bdi]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse how to show a button-seek-result on top | Mr Uwe
It is working for me here.
Please try this code.
[code=fw:5o15cws6]<div class="fw" id="{CB}" style="font-family: monospace;">func xbtest<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> field STATE<br /> <span style="color: #00C800;">local</span> oDlg, oBrw, oFont<br /><br /> USE CUSTOMER <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> STATE TAG TMPSTATE <span style="color: #0000ff;">TO</span> TMP MEMORY<br /> SET ORDER <span style="color: #0000ff;">TO</span> TAG TMPSTATE<br /> GO TOP<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br /> @ <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 /> DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> ;<br /> COLUMNS <span style="color: #ff0000;">"STATE"</span>, <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"CITY"</span>, <span style="color: #ff0000;">"AGE"</span>, <span style="color: #ff0000;">"SALARY"</span> ;<br /> CELL LINES NOBORDER<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">bRecSelData</span> := <span style="color: #000000;">{</span> || oBrw:<span style="color: #000000;">KeyNo</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nRecSelWidth</span> := <span style="color: #ff0000;">"9999"</span><br /> :<span style="color: #000000;">AutoFit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//</span><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> @ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"AL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> CUSTOMER-><span style="color: #000000;">(</span> DBSEEK<span style="color: #000000;">(</span> <span style="color: #ff0000;">"AL"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">nRowSel</span> := <span style="color: #000000;">1</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>, <span style="color: #000000;">90</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"AR"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> CUSTOMER-><span style="color: #000000;">(</span> DBSEEK<span style="color: #000000;">(</span> <span style="color: #ff0000;">"AR"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">nRowSel</span> := <span style="color: #000000;">1</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">160</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"AZ"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> CUSTOMER-><span style="color: #000000;">(</span> DBSEEK<span style="color: #000000;">(</span> <span style="color: #ff0000;">"AZ"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">nRowSel</span> := <span style="color: #000000;">1</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">230</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"CA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> CUSTOMER-><span style="color: #000000;">(</span> DBSEEK<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CA"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">nRowSel</span> := <span style="color: #000000;">1</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:5o15cws6] |
xBrowse how to show a button-seek-result on top | I'm trying to show the result of a seek from button on browser top
but it is shown on different places
I tested :
VSetPos(1)
VGoTop()
but it is not the solution I need.
The first found record must be placed on top-position.
I remember there was a solution ( post ), but couldn't find it.
[img:211aeipc]http://www.pflegeplus.com/IMAGES/Rowpos1.jpg[/img:211aeipc]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse how to show a button-seek-result on top | Glad to see you are using the new features of recordselector. Text, pointer bitmap and header bitmap.
You asked in another thread. To change the recordselector text color, please set oBrw:nClrText := <nNewColor> and call oBrw:Refresh().
Now coming to your question.
oBrw:nRowSel := 1 and oBrw:Refresh() should bring the current row to top.
But please keep this in mind. Assuming the browse can display 10 rows and data has more than 10 rows, any row in the last 9 rows can not be displayed on the top. Because xbrowse never allows blank lines in the bottom. |
xBrowse how to show a button-seek-result on top | Mr. Rao,
Thank You very much
Your sample works and I got it working as well.
From inside my program I added the following lines :
instead of buttons the value is selected from a second browser ( with a different array related to the index )
In case of the defined index the browser shows different values can be selected
[color=#0000FF:1odvl31q]oBrw2:bLClicked := { || ( nRow := oBrw2:nArrayAt, ;[/color:1odvl31q]
IIF( nNEUTour = 1, ( ("TOUREN")->(DBSETORDER("TOUREN2")), ; // Index 1 = values F01 - F18
cTour := "F" + aTour[ nRow ] ), NIL ), ;
IIF( nNEUTour = 2, ( ("TOUREN")->(DBSETORDER("TOUREN3")), ; // Index 2 = values M01 - M18
cTour := "M" + aTour[ nRow ] ), NIL ), ;
IIF( nNEUTour = 3, ( ("TOUREN")->(DBSETORDER("TOUREN4")), ; // Index 3 = values S01 - S18
cTour := "S" + aTour[ nRow ] ), NIL ), ;
("TOUREN")->(DBSEEK( TRIM(cTour) ) ), ;
[color=#0000FF:1odvl31q][b:1odvl31q]oBrw1:SetFocus(), ;
oBrw1:nRowSel := 1, oBrw1:Refresh() ) }[/b:1odvl31q][/color:1odvl31q]
The second situation :
is there maybe a solution as well to show records on browser-top during incremental seek ?
or maybe better centered, to show the records before and after
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse how to use BACKGROUND and cellcolors | It seems :bClrStd doesn't work using xbrowse BACKGROUND
[img:1lkz6toy]http://www.pflegeplus.com/IMAGES/XbrwBack.jpg[/img:1lkz6toy]
I added a abrush to a original from the sample-folder
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE aData ;
COLUMNS 2,3,4,5,6, 7 ;
HEADERS "DATE", "DETAILS", "QUANTITY", "RATE", "AMOUNT", Transform( nOpgBal, NumPict( 10, 2 ) ) ;
PICTURES nil, nil, "9999.999", "$ 999.99", '$ ' + NumPict( 7, 2 ), '$ ' + NumPict( 7, 2 ) ;
CELL FOOTERS NOBORDER STYLE FLAT ;
[color=#0000FF:1lkz6toy]BACKGROUND "..\bitmaps\backgrnd\Marble.bmp"[/color:1lkz6toy]
[img:1lkz6toy]http://www.pflegeplus.com/IMAGES/XbrwBack1.jpg[/img:1lkz6toy]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse how to use BACKGROUND and cellcolors | any solution <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
I tested a solution to define a background color
that works with a defined column :bClrStd
[code=fw:2inp03fs]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #B900B9;">// oSystem:Color = DBF-field for 9 defined colors</span><br /><span style="color: #B900B9;">// building the cell-gradient</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> , <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> .<span style="color: #000000;">5</span>, oSystem:<span style="color: #0000ff;">Color</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> .<span style="color: #000000;">5</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span>, oSystem:<span style="color: #0000ff;">Color</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br />WITH OBJECT oBrw<br /> :<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> , nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">187</span>, <span style="color: #000000;">221</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// light blue background</span><br />END<br /><br />or :<br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">of</span> oDlg1 ;<br />DATASOURCE oSystem ; <br />...<br />... ;<br /><span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">16639174</span><br /><br /> </div>[/code:2inp03fs]
but I couldn't define a gradient, brush or image background.
[img:2inp03fs]http://www.pflegeplus.com/IMAGES/XbrwBack2.jpg[/img:2inp03fs]
regards
Uwe <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> |
xBrowse how to use BACKGROUND and cellcolors | No solution for the problem <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Needed :
a combination of xbrowse background-brush and using column :bclrstd
( [color=#0000FF:12xvgw9o]photo-assembly from colored background[/color:12xvgw9o])
[img:12xvgw9o]http://www.pflegeplus.com/IMAGES/bclrstd1.jpg[/img:12xvgw9o]
regards
Uwe <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> |
xBrowse how to use BACKGROUND and cellcolors | In the meantime I'm using a solution testing 3 different styles
and working on a defined xbrowse background.
1. Full cell-color + defined 2. color-area
2. cell-color-area on xbrowse-brush
3. full cellsize-color
defined vertical textposition
images are centered and resized keeping the aspect ratio
[img:jd0nt629]http://www.pflegeplus.com/IMAGES/xbrwback3.jpg[/img:jd0nt629]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
xBrowse how to use BACKGROUND and cellcolors | Adolfo,
[quote:3t330lkj]how did you do to put different backgrounds colors on a column,
I can do it with only 2 options, I see you use a variety of them.[/quote:3t330lkj]
shows how to define cell-colors for different age-groups
[code=fw:3t330lkj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">// defined colum for ( oBrw:cAlias )->AGE </span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| PAINT_CELL<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /><span style="color: #B900B9;">// ---------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> PAINT_CELL<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> aColors := <span style="color: #000000;">{</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">}</span> <span style="color: #B900B9;">// basic color</span><br /><br /><span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->AGE < <span style="color: #000000;">30</span><br /> aColors := <span style="color: #000000;">{</span> CLR_BLACK, CLR_HRED <span style="color: #000000;">}</span><br />ELSEIF <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->AGE >= <span style="color: #000000;">30</span> .and. <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->AGE < <span style="color: #000000;">50</span><br /> aColors := <span style="color: #000000;">{</span> CLR_BLACK, CLR_YELLOW <span style="color: #000000;">}</span><br />ELSEIF <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->AGE >= <span style="color: #000000;">50</span> .and. <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->AGE < <span style="color: #000000;">60</span><br /> aColors := <span style="color: #000000;">{</span> CLR_WHITE, CLR_HBLUE <span style="color: #000000;">}</span><br />ELSEIF <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->AGE >= <span style="color: #000000;">60</span> <br /> aColors := <span style="color: #000000;">{</span> CLR_BLACK, CLR_HGREEN <span style="color: #000000;">}</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> aColors<br /><br /> </div>[/code:3t330lkj]
[img:3t330lkj]http://www.pflegeplus.com/IMAGES/Cellcolor1.jpg[/img:3t330lkj]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
xBrowse how to use BACKGROUND and cellcolors | Uwe.
A question, how did you do to put different backgrounds colors on a column, I can do it with only 2 options, I see you use a variety of them.
Any idea, sample will be appreciated.
Thanks in advance
From Chile
Adolfo |
xBrowse how to use BACKGROUND and cellcolors | Thanks UWE, simple, I didn`t figure it out.
Thanks again.
Grettings
From Chile
Adolfo |
xBrowse images ( JPG PNG BMP ... ) | Hello...
i comeback with new change to xbrowse, i will wait for suggestions and opinions
it 's a prototipe, i do not show code yet
we can show images on cell without added array, no need methods
METHOD AddResource( cRes )
METHOD AddBmpFile( cFile )
METHOD AddBmpHandle( hBmp )
New DATA bStrImage // String data codeblock (returns a string with imagen name)
New nEditType
#define TYPE_IMAGE -1
we can select the image in 2 ways using the bStrImage data or putting the image name in the cell, this cell in not editable, only show image
it is a sample
The first column contains the Image, do click rigth button mouse open a popmenu, the second column we can select image with cGetFile()
[url:3t3hfcyc]http://www.sitasoft.com/fivewin/test/xbimg.rar[/url:3t3hfcyc]
[code=fw:3t3hfcyc]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">static</span> hLib<br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg<br /> <span style="color: #00C800;">local</span> oBrw<br /> <span style="color: #00C800;">local</span> nI<br /> <span style="color: #00C800;">local</span> hBitMap1, hBitMap2, hBitMap3, hBitMap4<br /> <span style="color: #00C800;">local</span> aArray:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <br /> <span style="color: #00C800;">for</span> nI = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br /> aadd<span style="color: #000000;">(</span> aArray, <span style="color: #000000;">{</span> <span style="color: #ff0000;">""</span>, space<span style="color: #000000;">(</span> <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> <br /><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"TEST"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">800</span>,<span style="color: #000000;">600</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg columns <span style="color: #000000;">{</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">}</span>;<br /> Array aArray sizes <span style="color: #000000;">{</span><span style="color: #000000;">100</span>,<span style="color: #000000;">300</span><span style="color: #000000;">}</span> LINES CELL <span style="color: #0000ff;">autocols</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := <span style="color: #000000;">1</span><br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">33</span><br /> oBrw:<span style="color: #000000;">lAdjustLastCol</span> := .t. <br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := TYPE_IMAGE<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">lBmpStretch</span> := .t.<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">lBmpTransparent</span> := .t.<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bStrImage</span> := <span style="color: #000000;">{</span>|oCol, oBrw| oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bPopUp</span> := <span style="color: #000000;">{</span> |o| ColMenu<span style="color: #000000;">(</span> o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_BUTTON<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span>|nRow, nCol, oCol| oCol:<span style="color: #000000;">Value</span> := cGetFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"*.*"</span>, <span style="color: #ff0000;">"Select a file"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <br /> oDlg:<span style="color: #000000;">oClient</span> := oBrw<br /> <br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">Resize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ColMenu<span style="color: #000000;">(</span> ocol <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oPop<br /><br /> <span style="color: #0000ff;">MENU</span> oPop POPUP <span style="color: #000000;">2007</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Left Align"</span> <span style="color: #0000ff;">WHEN</span> oCol:<span style="color: #000000;">nDataBmpAlign</span> > <span style="color: #000000;">0</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oCol:<span style="color: #000000;">nDataBmpAlign</span>:= AL_LEFT, oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Center Align"</span> <span style="color: #0000ff;">WHEN</span> oCol:<span style="color: #000000;">nDataBmpAlign</span> != AL_CENTER ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oCol:<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER, oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Right Align"</span> <span style="color: #0000ff;">WHEN</span> oCol:<span style="color: #000000;">nDataBmpAlign</span> != AL_RIGHT ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oCol:<span style="color: #000000;">nDataBmpAlign</span> := AL_RIGHT , oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> MenuAddItem<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Transparent"</span>, ,oCol:<span style="color: #000000;">lBmpTransparent</span>, .t., ;<br /> <span style="color: #000000;">{</span> |oItem| oCol:<span style="color: #000000;">lBmpTransparent</span> := !oCol:<span style="color: #000000;">lBmpTransparent</span>, ;<br /> oItem:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> oCol:<span style="color: #000000;">lBmpTransparent</span> <span style="color: #000000;">)</span>, ;<br /> oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> MenuAddItem<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Stretch"</span>, ,oCol:<span style="color: #000000;">lBmpStretch</span>, .t., ;<br /> <span style="color: #000000;">{</span> |oItem| oCol:<span style="color: #000000;">lBmpStretch</span> := !oCol:<span style="color: #000000;">lBmpStretch</span>, ;<br /> oItem:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> oCol:<span style="color: #000000;">lBmpStretch</span> <span style="color: #000000;">)</span>, ;<br /> oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><br /><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oPop<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:3t3hfcyc] |
xBrowse images ( JPG PNG BMP ... ) | Hello Daniel,
thank you for this nice extensions.
I did some tests.
This is really impressive.
Best regards,
Otto
[img:18gn2s9o]http://www.atzwanger-software.com/fw/danclip1.jpg[/img:18gn2s9o] |
xBrowse images ( JPG PNG BMP ... ) | Excellant improvement to XBrowse. Hope to get this in 9.03 |
xBrowse improvement | Hello Nage ,
there is a request in the spanish forum about SQL and xBrowse .
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=32261">viewtopic.php?f=6&t=32261</a><!-- l -->
the problem is the delay in a select with many many records .
I saw that browse for SQL ( like Mysql-Front) use this process
SELECT * FROM dabase.client LIMIT 100
when I go over the 100 records automatically there is another select
SELECT * FROM dabase.client ORDER LIMIT 100,100;
it would be nice to have this in xBrowse <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Regards
Maurizio
<!-- w --><a class="postlink" href="http://www.nipeservice.com">www.nipeservice.com</a><!-- w --> |
xBrowse improvement | Maurizio
I do not know if MySql has the ablilty to create a recordset with a local cache :
[code=fw:2an9pxzk]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRsCopr := TOleAuto<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">)</span><br />oRsCopr:<span style="color: #000000;">CursorType</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">// opendkeyset</span><br />oRsCopr:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// local cache <------ here</span><br />oRsCopr:<span style="color: #000000;">LockType</span> := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// lockoportunistic</span><br /><br /><span style="color: #00C800;">TRY</span><br /> oRsCopr:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> cSQL,xCONNECT <span style="color: #000000;">)</span><br />CATCH oErr<br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Error in Opening COPROPOSAL table"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span><br />END <span style="color: #00C800;">TRY</span><br /> </div>[/code:2an9pxzk]
This is a BIG improvement in speed as the records are not being drawn from the database but from a fetch to the local machine. Much better to traverse a local cache than trying to read records from a table ..
Rick Lipkin
[quote:2an9pxzk]
The Significance of Cursor Location
Every cursor uses temporary resources to hold its data. These resources can be memory, a disk paging file, temporary disk files, or even temporary storage in the database. The cursor is called a client-side cursor when these resources are located on the client computer. The cursor is called a server-side cursor when these resources are located on the server.
Client-Side Cursors
In ADO, call for a client-side cursor by using the adUseClient CursorLocationEnum. With a non-keyset client-side cursor, the server sends the entire result set across the network to the client computer. The client computer provides and manages the temporary resources needed by the cursor and result set. The client-side application can browse through the entire result set to determine which rows it requires.
Static and keyset-driven client-side cursors may place a significant load on your workstation if they include too many rows. While all of the cursor libraries are capable of building cursors with thousands of rows, applications designed to fetch such large rowsets may perform poorly. There are exceptions, of course. For some applications, a large client-side cursor might be perfectly appropriate and performance might not be an issue.
One obvious benefit of the client-side cursor is quick response. After the result set has been downloaded to the client computer, browsing through the rows is very fast. Your application is generally more scalable with client-side cursors because the cursor's resource requirements are placed on each separate client and not on the server.
Server-Side Cursors
In ADO, call for a server-side cursor by using the adUseServer CursorLocationEnum. With a server-side cursor, the server manages the result set using resources provided by the server computer. The server-side cursor returns only the requested data over the network. This type of cursor can sometimes provide better performance than the client-side cursor, especially in situations where excessive network traffic is a problem.
However, it is important to point out that a server-side cursor is — at least temporarily — consuming precious server resources for every active client. You must plan accordingly to ensure that your server hardware is capable of managing all of the server-side cursors requested by active clients. Also, a server-side cursor can be slow because it provides only single row access — there is no batch cursor available.
Server-side cursors are useful when inserting, updating, or deleting records. With server-side cursors, you can have multiple active statements on the same connection.
[/quote:2an9pxzk] |
xBrowse improvement | Rick ,
I use already
oRsCopr:CursorLocation := 3 // local cache <------ here
Thanks ,
Maurizio
<!-- w --><a class="postlink" href="http://www.nipeservice.com">www.nipeservice.com</a><!-- w --> |
xBrowse in 2 windows | I have a small problem in displaing info from two dbf.files with relation.
1. In first main window i want to display list of simple information from 1-st base, second should contain filtered info from second base. By move in master window the list in detail must be refreshed.
2. Can I do this with MDI Window structure or in Dialog?
regards Eugeniusz |
xBrowse in 2 windows | Hello Eugeniusz
to use 2 Browsers in relation is possible
in both, a window or dialog.
I will do a sample in the DB-Tools.
It will have a vertical splitter as well,
so you can resize a browser.
I hope, it is not to urgent, so you can
get the source how to handle it.
Greetings
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse in 2 windows | Eugeniusz,
Please review fwh\samples\gallery\onemany\* |
xBrowse in 2 windows | [quote="Eugeniusz Owsiak":2tu4er3o]I have a small problem in displaing info from two dbf.files with relation.
1. In first main window i want to display list of simple information from 1-st base, second should contain filtered info from second base. By move in master window the list in detail must be refreshed.
2. Can I do this with MDI Window structure or in Dialog?
regards Eugeniusz[/quote:2tu4er3o]
You can do this either in MDI window or in Dialog.
Sample code for Dialog
[code:2tu4er3o]
@ 10,10 XBROWSE oBrw1 FIELDS .. HEADERS .... SIZE 400,300 PIXEL OF oDlg ALIAS master
@ 320,10 XBROWSE oBrw2 FIELDS ......... SIZE 400,300 PIXEL OF oDlg ALIAS child
oBrw1:bChange := { || RefilerChild(), oBrw2:Refresh(.t.) }
[/code:2tu4er3o] |
xBrowse in FWPPC | Hi,
I am trying to use xBrowse along with FWPPC. Unfortunately, I am getting the following link errors
FiveCEC.lib(XBROWSEC.obj) : error LNK2005: HB_FUN_XBRWSCROLLROW already defined in FiveCE.lib(XBROWSE.obj)
FiveCE.lib(XBROWSE.obj) : error LNK2001: unresolved external symbol HB_FUN_PALBMPFREE
FiveCE.lib(TREES.obj) : error LNK2001: unresolved external symbol HB_FUN_PALBMPFREE
Test.exe : fatal error LNK1120: 1 unresolved externals
* Linking errors *
[code=fw:377uyr71]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fwce.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbclass.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Directry.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br />*---------------------------------------------------*<br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />*---------------------------------------------------*<br /><span style="color: #00C800;">Private</span> oGetCustName,cCustName<br /><span style="color: #00C800;">Private</span> cBarCode<br /><span style="color: #00C800;">Private</span> oBtnScan,oBtnSave,oBtnClose<br /><span style="color: #00C800;">Private</span> oWnd,oBrw,aBarCodes:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br />cCustName:=Space<span style="color: #000000;">(</span><span style="color: #000000;">30</span><span style="color: #000000;">)</span><br />cBarCode:=Space<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Anser Test"</span><br /><br />@ <span style="color: #000000;">1.0</span>,<span style="color: #000000;">02</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Customer :"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">20</span><br /><br />@ <span style="color: #000000;">1.0</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">GET</span> oGetCustName <span style="color: #0000ff;">VAR</span> cCustName <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oWnd <br /><br />@ <span style="color: #000000;">04.2</span>,<span style="color: #000000;">01</span> <span style="color: #0000ff;">BUTTON</span> oBtnScan <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Scan"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> oWnd <br />@ <span style="color: #000000;">04.2</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">BUTTON</span> oBtnSave <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save File"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> oWnd <br />@ <span style="color: #000000;">04.2</span>,<span style="color: #000000;">22</span> <span style="color: #0000ff;">BUTTON</span> oBtnClose <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />@<span style="color: #000000;">05</span>,<span style="color: #000000;">01</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd ;<br /> COLUMNS <span style="color: #000000;">{</span><span style="color: #000000;">1</span><span style="color: #000000;">}</span> ;<br /> HEADERS <span style="color: #000000;">{</span><span style="color: #ff0000;">"Code"</span><span style="color: #000000;">}</span> ;<br /> ARRAY aBarCodeArr ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">20</span> ; <br /> FOOTERS CELL <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:377uyr71]
Am I missing any specific libs. To bulid the exe, I use FwPPc\Samples\BuildCe.Bat
Regards
Anser |
xBrowse in FWPPC | I thonk no possible on fwppc also |
xBrowse in cell of other xbrowse | Hello friends.
I need to insert a xBrowse into a cell of another xBrowse.
Is this possible?
Any examples of how to do ?, if possible.
Greetings. |
xBrowse in cell of other xbrowse | Francisco
You can use EDIT_GET on the cell you wish to activate and use the Pre and Post code blocks to fire off a user defined function to do anything you want.
In this example snipit from an invoicing browse .. I am editing the Stock Number cell and calling out a function InvtLook() to verify the part number against inventory... where v is the passed value of the user typed stock number.
Rick Lipkin
[code=fw:1n2hfg3x]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// part number</span><br />oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span>oRsDetail:<span style="color: #000000;">fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"LockedDown"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> = .f., .t.,.f.<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPreEdit</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span>oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Inventory Id"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> = <span style="color: #ff0000;">" "</span>, , __Keyboard<span style="color: #000000;">(</span> Chr<span style="color: #000000;">(</span> VK_HOME <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>|o,v| _InvtLook<span style="color: #000000;">(</span> v, oRsDetail, oRsRepair, <span style="color: #ff0000;">"3"</span>, oLbxB, @lTaxable, oTaxable, cLoc,;<br /> oLabor,oParts,oMisc,oTax,oTotal,nTaxNumber,nAssignedTo<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:1n2hfg3x] |
xBrowse in cell of other xbrowse | Rick, thanks for your reply.
Maybe I don't explained correctly ( my bad english).
What I want to do is to use cells of xbrowse1 and insert other xBrowses into xBrowse1's each cells..
Is't possible? |
xBrowse in cell of other xbrowse | Something like this, I want to do.
Anybody?
[url=http://www.4shared.com/photo/ScnBydNQba/xbrwxbrw.html:3vtb3bkh][img:3vtb3bkh]http://dc644.4shared.com/img/ScnBydNQba/148a413c098/xbrwxbrw.bmp[/img:3vtb3bkh][/url:3vtb3bkh]
Regards |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.