topic
stringlengths
1
63
text
stringlengths
1
577k
xBrowse With DatePicker & TimePicker
Hello Daniel, but if you have a look at the object inspector of FW VISUAL it is different. If you select a item with the mouse it is changed without ENTER. I think it should be that way. Best regards, Otto
xBrowse With DatePicker & TimePicker
Otto... Yes, you have reason but... dtpicker have edit features no button features i dont know how get control on dtpicker button <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
xBrowse With DatePicker & TimePicker
Please change this line on function EditGetkeyDown find [code=fw:13bednup]<div class="fw" id="{CB}" style="font-family: monospace;">         ::<span style="color: #000000;">PostEdit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:13bednup] replace with [code=fw:13bednup]<div class="fw" id="{CB}" style="font-family: monospace;"><br />      <span style="color: #00C800;">if</span> lExit<br />         ::<span style="color: #000000;">PostEdit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br /> </div>[/code:13bednup]
xBrowse a column containing richedit
Hi, I Have a column in a xbrowse list that refers to a memo field containing a richedit text. oCol = oBrw:AddCol() oCol:bStrData = { || note->nota } oCol:cHeader = "Nota" oCol:nEditType = EDIT_GET oCol:nWidth = 200 note->nota contains a string like this =========================== {\rtf1\ansi\ansicpg1252\deff0\deflang1040{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\fnil\fcharset0 Arial;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\cf1\b\i\f0\fs36 Ciao marco\cf0\b0\i0\f1\fs20\par } ============================ How can I extract pure text of this memo field? Thanks in advance Marco
xBrowse a column containing richedit
I am also interested in a function like Rtf2Text(). I started coding a straight function but I haven't completed it. I shall post it again after doing some more work. Meanwhile I can suggest a function using a hidden richedit control. Can you please help by testing this function? [code=fw:6trk6skx]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Rtf2text<span style="color: #000000;">&#40;</span> cRtf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">static</span> hDLL, oWnd, oRich<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> &nbsp;cText<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> cRtf <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> hDLL == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hDLL &nbsp; &nbsp; := LoadLibrary<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"riched20.dll"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> RICHEDIT oRich <span style="color: #0000ff;">VAR</span> cRtf <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>,<span style="color: #000000;">50</span> <span style="color: #0000ff;">PIXEL</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cText &nbsp; &nbsp;:= oRich:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd HIDDEN<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRich:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">&#40;</span> cRTF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cText &nbsp; &nbsp;:= oRich:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> hDLL != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWnd &nbsp; &nbsp; := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRich &nbsp; &nbsp;:= <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FreeLibrary<span style="color: #000000;">&#40;</span> hDLL <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hDLL &nbsp; &nbsp; := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cText<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:6trk6skx] After done finally call Rtf2Text() without any parameters to close the window and DLL. I would be glad to know the test results, Meanwhile if any one can provide a direct function to strip of all rtf codes, that would be greatly welcome.
xBrowse a column containing richedit
The only drawback of MR. Rao's suggestion is that you must create the richtext control in order to extract the text. In my case I was having to report on thousands of records containing richtext. So I wrote a very short and simple function to extract only text from richtext using a regular expression. Here is the code: [code=fw:2y8txtz3]<div class="fw" id="{CB}" style="font-family: monospace;">*---------------------------------------------------------------------------------------------<br /><span style="color: #00D7D7;">#DEFINE</span> _cREGEX <span style="color: #ff0000;">"<span style="color: #000000;">\{</span>?<span style="color: #000000;">\\</span>([a-z]{1,32}[0-9]* ?)([A-z, ]*;)?|}"</span>   <span style="color: #B900B9;">//includes fonts</span><br /><br /><span style="color: #00C800;">function</span> GetTextFromRTF<span style="color: #000000;">&#40;</span> cRtfText, lKeepCRLFs <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> aRet<br /><span style="color: #00C800;">local</span> cStrip, i<br /><br />   <span style="color: #00C800;">DEFAULT</span> cRtfText := <span style="color: #ff0000;">""</span><br />   <span style="color: #00C800;">DEFAULT</span> lKeepCRLFs := .t.<br /><br />   aRet := hb_RegExAll<span style="color: #000000;">&#40;</span> _cREGEX, cRtfText, .f. <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> aRet == <span style="color: #00C800;">Nil</span>    ;return cRtfText    ;endif<br /><br />   aSort<span style="color: #000000;">&#40;</span> aRet,,, <span style="color: #000000;">&#123;</span> |x,y| len<span style="color: #000000;">&#40;</span> x<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> > len<span style="color: #000000;">&#40;</span> y<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span> aRet <span style="color: #000000;">&#41;</span><br /><br />      cRtfText := StrTran<span style="color: #000000;">&#40;</span> cRtfText, aRet<span style="color: #000000;">&#91;</span> i, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">Next</span><br /><br />   <span style="color: #00C800;">if</span> !lKeepCRLFs<br />      cRtfText := StrTran<span style="color: #000000;">&#40;</span> cRtfText, CRLF, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">Return</span> cRtfText<br /><br /> </div>[/code:2y8txtz3] Hope that helps, Reinaldo.
xBrowse a column containing richedit
Mr. Reinaldocrespo Thank you very much. This is the kind of function I needed too. Yes I agree with your comments about the disadvantage of creating control.
xBrowse a column containing richedit
Reinaldo, Your function is very good but ther is a little problem. If I pass a string containing one of these characters "àèéìòù" for instance the days of week in Italian : "Lunedì Martedì Mercoledì Giovedì Venerdì " I have these string as return value Marc\'e0 Marc\'e8 Marc\'ec Marc\'f2 Marc\'f9 nageswaragunupudi, your function works very well. But I put this function in a column of a listbox to display the content of a memo field containing a richedit text. When I test it with larger table I can tell you if it works without problem Thanks to all marco
xBrowse a column containing richedit
Marco Boschi, can you send me a test sample with this feature please , ? I'd like try it
xBrowse a column containing richedit
Mr Marco I don't think my method would be good in case of large tables. Function posted by Mr. Reinaldo is the way to go. Though this function has limitations as of now, we can improve it. I myself need a good function for this purpose. When I get time I try to improve that function solving some of the problems I already noticed.
xBrowse a column containing richedit
nageswaragunupudi, I confirm the problem when in the memo field there are words containing these character widely used in italian language àèéìòù Lunedì is Monday Martedì is etc. etc. Bye I hope that reinaldo read this post
xBrowse a column containing richedit
Marco; I apologize for being so busy. Please send me a rich edit memotext I can do tests with. Send me for example something like: [quote:np7z5ujf]{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 ARIAL;}} \viewkind4\uc1\pard\f0\fs20 The specimen is received fresh, wrapped in plastic, is labeled "LEFT LEG BELOW AMPUTATION" and consists of a below the knee amputation specimen measuring 30 cm from tibial amputation site to medial malleolus. The specimen is notable for gangrenous ulcers involving all toes and anterior aspect of the dorsum of the foot. The proximal soft tissue is beefy red and viable. Sections through the vessels show atheromatous plaque. (RSS 1 CASS) VCV\par \pard\fs20\par } [/quote:np7z5ujf] BTW and FYI - all the function does is remove all instances of richtext coded tags from the memo field sent as parameter returning everything else. For more information on regular expressions you can search the web. It is a good idea to become acquainted with regex as they are a powerful and very fast way to parse text for anything. Again, please send me some sample richtext that does not work at your end and I will gladly test it against the function here. Best regards, Reinaldo.
xBrowse a column containing richedit
I have problems with the following files in \fwh\samples folder. MemoEdit( GetTextFromRTF( MemoRead( "testrtf.rtf" ) ) ) MemoEdit( GetTextFromRTF( MemoRead( "fiveodbc.rtf" ) ) )
xBrowse a column containing richedit
{\rtf1\ansi\ansicpg1252\deff0\deflang1040{\fonttbl{\f0\fnil\fcharset0 Arial;}} \viewkind4\uc1\pard\fs20 Oggi \'e8 marted\'ec\par domani \'e8 mercoled\'ec\par dopodomani gioved\'ec\par che ora \'e8\par Come sar\'e0 il tempo domani?\par } àèéìòù Reinaldo: too kind , no hurry
xBrowse a column containing richedit
Marco; I see your point. I wasn't aware of how richtext implemented international characters, but I find a simple solution without having to re-touch the regular expression. Change the function to this: [code=fw:3r3srbpj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> GetTextFromRTF<span style="color: #000000;">&#40;</span> cRtfText, lKeepCRLFs <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> aRet<br /><span style="color: #00C800;">local</span> cStrip, i<br /><br />   <span style="color: #00C800;">DEFAULT</span> cRtfText := <span style="color: #ff0000;">""</span><br />   <span style="color: #00C800;">DEFAULT</span> lKeepCRLFs := .t.<br /><br />   aRet := hb_RegExAll<span style="color: #000000;">&#40;</span> _cREGEX, cRtfText, .f. <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> aRet == <span style="color: #00C800;">Nil</span>    ;return cRtfText    ;endif<br /><br />   aSort<span style="color: #000000;">&#40;</span> aRet,,, <span style="color: #000000;">&#123;</span> |x,y| len<span style="color: #000000;">&#40;</span> x<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> > len<span style="color: #000000;">&#40;</span> y<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span> aRet <span style="color: #000000;">&#41;</span><br /><br />      cRtfText := StrTran<span style="color: #000000;">&#40;</span> cRtfText, aRet<span style="color: #000000;">&#91;</span> i, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">Next</span><br /><br />   <span style="color: #00C800;">if</span> !lKeepCRLFs<br />      cRtfText := StrTran<span style="color: #000000;">&#40;</span> cRtfText, CRLF, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />    <span style="color: #B900B9;">//International chars</span><br />    cRtfText := StrTran<span style="color: #000000;">&#40;</span> cRtfText, <span style="color: #ff0000;">"<span style="color: #000000;">\'</span>ec"</span>, chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">141</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">//inverted accented i</span><br />    cRtfText := StrTran<span style="color: #000000;">&#40;</span> cRtfText, <span style="color: #ff0000;">"<span style="color: #000000;">\'</span>e8"</span>, chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">138</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">//inverted accented e</span><br />    cRtfText := StrTran<span style="color: #000000;">&#40;</span> cRtfText, <span style="color: #ff0000;">"<span style="color: #000000;">\'</span>e0"</span>, chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">133</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">//inverted accented a</span><br />    <br /><span style="color: #00C800;">Return</span> cRtfText<br /><br /> </div>[/code:3r3srbpj] It should work. For Mr. Rao, I find that my windows 7 wordpad does not want to open testrtf.rtf. In fact, my windows installation will NOT open that file. But it does open fiveodbc.rtf. So I will work with fiveodbc.rtf as soon as I get a chance. Reinaldo.
xBrowse a column containing richedit
Mr. Reinaldo The function posted by you does most of the work and works well on most normal rich text. It is just that it needs to be improved a bit further. I can open testrtf.rtf in Word 2007, WordPad and FWH RichText control on my Windows 7 (32-bit). [url=http&#58;//img641&#46;imageshack&#46;us/i/testrtf&#46;jpg/:2us9tsd9][img:2us9tsd9]http&#58;//img641&#46;imageshack&#46;us/img641/9787/testrtf&#46;jpg[/img:2us9tsd9][/url:2us9tsd9] What distinguishes these two files from other normal richtext files is that testrtf.rtf contains image and fiveodbc.rtf contains a table. We need to include logic to handle these features in rtf.
xBrowse a column containing richedit
Reinaldo, with this sequence of replace the problem is solved! cRtfText := StrTran( cRtfText, "\'e0", "à" ) cRtfText := StrTran( cRtfText, "\'e8", "è" ) cRtfText := StrTran( cRtfText, "\'e9", "é" ) cRtfText := StrTran( cRtfText, "\'ec", "ì" ) cRtfText := StrTran( cRtfText, "\'f2", "ò" ) cRtfText := StrTran( cRtfText, "\'f9", "ù" ) Many Thanks Marco
xBrowse a column containing richedit
Marco -Good! Mr. Rao. Good morning. I see the problem you are pointing to. There is no easy fix. I would have to revisit my regular expression which is already a bit cryptic. I must take care of some pressing issues today. I'm thinking perhaps tomorrow I should be able to spend time rewriting the regular expression in order to catch imbedded tables and images. Another possibility would be to use a lex or yacc utility as means to catch streams of data delimited by tags. Reinaldo.
xBrowse a column containing richedit
Mr Reinaldo There is no hurry at all. You can attend to this only when you find some free time. Instead of changing the main regular expression, you may handle the issue of embedded pictures and tables in a second pass.
xBrowse a column containing richedit
Mr. Reinaldo and other friends Can we just "render" RichText in a window without using RichText control?
xBrowse a recordset from a WinChild
Please try this code [code=fw:2hl0rs7z]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oGRP                         ;<br />      <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">2</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">25</span>,<span style="color: #000000;">80</span>                    ;<br />      <span style="color: #0000ff;">of</span> oWndMDI                           ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"HOLIDAY Schedule"</span>             ;<br />      <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span> oRs <span style="color: #000000;">&#41;</span>                ;<br />      NOMINIMIZE                           ;<br />      NOZOOM                               ;<br />      <span style="color: #0000ff;">MDICHILD</span><br /><br />@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBrowse</span> oBrow <span style="color: #0000ff;">of</span> oGrp ;<br />       RECORDSET oRs ;<br />       COLUMNS <span style="color: #ff0000;">'begin_date'</span>, <span style="color: #ff0000;">'end_date'</span>, <span style="color: #ff0000;">'holiday'</span> ;<br />       HEADERS <span style="color: #ff0000;">'Begin DT'</span>, <span style="color: #ff0000;">'End DT'</span>, <span style="color: #ff0000;">'Holiday'</span> ;<br />       COLSIZES <span style="color: #000000;">90</span>, <span style="color: #000000;">90</span>, <span style="color: #000000;">200</span> ; &nbsp;<span style="color: #B900B9;">// sizes is not normally necessary. XBrowse allots appropriate space to each column</span><br />       AUTOSORT FASTEDIT LINES<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// The following 2 lines are not compatible with Editing. For display and selection, its ok</span><br />   oBrow:<span style="color: #000000;">bClrRowFocus</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">185</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> &nbsp;<br />   oBrow:<span style="color: #000000;">nMarqueeStyle</span>   := MARQSTYLE_HIGHLROWMS<br /><br />   <span style="color: #B900B9;">// for the columns you want to edit.</span><br />   <span style="color: #B900B9;">// example</span><br />   oBrow:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /><br />   oBrow:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oGrp:<span style="color: #000000;">oClient</span>          := oBrow<br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oGRP   <span style="color: #B900B9;">// VALID ( IIF( !lOK, GrpCLose( .T. , oRs ), .F. ))</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:2hl0rs7z] With XBrowse DToC( .. ) is not necessary XBrowse knows the datatypes and their sizes and formats appropriately. XBrowse also provides necessary codeblocks like bGoTop, bSkip etc by itself. It is just enough for us to say what columns to be shown and whether we want to edit or not. Xbrowse knows how to read and write to recordset.
xBrowse a recordset from a WinChild
To All I must be doing something very wrong here. I am taking my 'listbox' code for an ADO recordset and modifying it for xBrowse. The program compiles .. but when the browse fires ... all I get is a Grey mdichild window .. no data .. just blank. Here is the code : [code=fw:22xl8xuw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oGRP                         ;<br />      <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">2</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">25</span>,<span style="color: #000000;">80</span>                    ;<br />      <span style="color: #0000ff;">of</span> oWndMDI                           ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"HOLIDAY Schedule"</span>             ;<br />      <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span> oRs <span style="color: #000000;">&#41;</span>                ;<br />      NOMINIMIZE                           ;<br />      NOZOOM                               ;<br />      <span style="color: #0000ff;">MDICHILD</span><br /><br />@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">xBrowse</span> oBrow <span style="color: #0000ff;">of</span> oGrp RECORDSET oRs  ;<br />       FIELDS ;<br />       dtoc<span style="color: #000000;">&#40;</span>oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"begin_date"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span>,;<br />       dtoc<span style="color: #000000;">&#40;</span>oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"end_date"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span>,  ;<br />       oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"holiday"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>          ;<br />       SIZES <span style="color: #000000;">90</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">200</span>                      ;<br />       HEADERS <span style="color: #ff0000;">"Begin DT"</span>,                  ;<br />               <span style="color: #ff0000;">"End DT"</span>,                    ;<br />               <span style="color: #ff0000;">"Holiday"</span>                    ;<br />       AUTOSORT FASTEDIT LINES CELL<br /><br />   oBrow:<span style="color: #000000;">bClrRowFocus</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">185</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   oBrow:<span style="color: #000000;">nMarqueeStyle</span>   := MARQSTYLE_HIGHLROWMS<br /><br /><br /><span style="color: #B900B9;">//  ;</span><br />   *    <span style="color: #0000ff;">ON</span> DBLCLICK<span style="color: #000000;">&#40;</span> _HoliView<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"V"</span>, oRs <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  ;<br />   *    <span style="color: #0000ff;">UPDATE</span><br /><br /><br />      oBrow:<span style="color: #000000;">bLogicLen</span> := <span style="color: #000000;">&#123;</span> || oRs:<span style="color: #000000;">RecordCount</span> <span style="color: #000000;">&#125;</span><br />      oBrow:<span style="color: #000000;">bGoTop</span>    := <span style="color: #000000;">&#123;</span> || oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oBrow:<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">&#123;</span> || oRs:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oBrow:<span style="color: #000000;">bSkip</span>     := <span style="color: #000000;">&#123;</span> | nSkip | Skipper<span style="color: #000000;">&#40;</span> oRs, nSkip <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oBrow:<span style="color: #000000;">cAlias</span>    := <span style="color: #ff0000;">"ARRAY"</span><br /><br /><br />      oGrp:<span style="color: #000000;">oClient</span> := oBROW<br />      oGrp:<span style="color: #000000;">SetControl</span><span style="color: #000000;">&#40;</span> oBrow <span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oGRP           ;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> IIF<span style="color: #000000;">&#40;</span> !lOK, GrpCLose<span style="color: #000000;">&#40;</span> .T. , oRs <span style="color: #000000;">&#41;</span>, .F. <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//-------------------------------</span><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> SKIPPER<span style="color: #000000;">&#40;</span> oRsx, nSkip <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> nRec := oRsx:<span style="color: #000000;">AbsolutePosition</span><br /><br />oRsx:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nSkip <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> oRsx:<span style="color: #000000;">EOF</span>; oRsx:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> oRsx:<span style="color: #000000;">BOF</span>; oRsx:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> oRsx:<span style="color: #000000;">AbsolutePosition</span> - nRec <span style="color: #000000;">&#41;</span><br /> </div>[/code:22xl8xuw]
xBrowse aSortBmp
Hi, Can't find any sample how to use native ::aSortBmp with xBrowse headers sorting ... Can you share with small sample ? Regards !
xBrowse aSortBmp
Automatic sorting works by simply adding AUTSORT clause to XBROWSE command in case of RDD,ADO,TDataBase,Array. We do not need to do anything more than including this clause in the command. I am not sure about TDolphin.
xBrowse aSortBmp
[quote="nageswaragunupudi":3f85nk61]Automatic sorting works by simply adding AUTSORT clause to XBROWSE command in case of RDD,ADO,TDataBase,Array. We do not need to do anything more than including this clause in the command. I am not sure about TDolphin.[/quote:3f85nk61] O, thanks Rao ! I forgot about AUTOSORT .
xBrowse aSortBmp
[quote="Rimantas":262vkuv0][quote="nageswaragunupudi":262vkuv0]Automatic sorting works by simply adding AUTSORT clause to XBROWSE command in case of RDD,ADO,TDataBase,Array. We do not need to do anything more than including this clause in the command. I am not sure about TDolphin.[/quote:262vkuv0] O, thanks Rao ! I forgot about AUTOSORT .[/quote:262vkuv0] AUTOSORT is working fine and with Dolphin . I believe that AUTOSORT can be extended ... <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> I'm suggesting a small idea - autosort with Shift or Ctrl key for MULTICOLUMN SORTING ... Or maybe it alreday exist ? Regards !
xBrowse aSortBmp
It is much simpler in xbrowse. Multiple column sorting in xbrowse/ADO is to set oCol:cSortOrder := "LAST,FIRST"
xBrowse aSortBmp
[quote:1zz3qd50]AUTOSORT is working fine and with Dolphin [/quote:1zz3qd50] Yes, True. I am now testing with TDolphin. I noticed a few bugs and fixing them.
xBrowse ahora que anda quiero mas
Amigos: Ahora que pude hacer andar el xBrowse deseo saber como asignar el font al header, como cambiar el color de una celda segun sus datos Muchas gracias. Ruben Fernandez. Creo que no pregunto mas de xBrowse
xBrowse ahora que anda quiero mas
En el directorio samples hay unos ejemplos muy buenos te los recomiendo. Tambien si lees el codigo de la clase te vas a dar cuenta como, si algo bueno tiene fw es el codigo fuente. Saludos, Carlos.
xBrowse and ToExcel problem
Dear Nages, Sometimes when I use oBrw:ToExcel my client gets the following error [code=fw:12mt22pv]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br />&nbsp; &nbsp;Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\CaricoScarico\zucal.EXE <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">Size</span>: <span style="color: #000000;">4</span>,<span style="color: #000000;">801</span>,<span style="color: #000000;">536</span> bytes<br />&nbsp; &nbsp;Compiler version: <span style="color: #000000;">Harbour</span> <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">&#40;</span>r1412151448<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;FiveWin &nbsp;Version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">15.01</span><br />&nbsp; &nbsp;Windows version: <span style="color: #000000;">6.2</span>, Build <span style="color: #000000;">9200</span> <br /><br />&nbsp; &nbsp;Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">7</span> secs <br />&nbsp; &nbsp;Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">08</span><span style="color: #000000;">-05</span><span style="color: #000000;">-2015</span>, <span style="color: #000000;">14</span>:<span style="color: #000000;">34</span>:<span style="color: #000000;">25</span><br />&nbsp; &nbsp;Error description: <span style="color: #000000;"><span style="color: #000000;">&#40;</span>DOS</span> Error <span style="color: #000000;">-2147352567</span><span style="color: #000000;">&#41;</span> WINOLE/<span style="color: #000000;">1007</span> &nbsp;<br />&nbsp; &nbsp;Impossibile trovare la proprietà Paste per la classe Worksheet. <br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span>0x800A03EC<span style="color: #000000;">&#41;</span>: <span style="color: #000000;">Microsoft</span> Excel<br /><br />Stack Calls<br />===========<br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TOLEAUTO:<span style="color: #000000;">PASTE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\fwh_15\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBROWSE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">7457</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">zucal</span>.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>PRODUZIONE_RIGHE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">923</span> <span style="color: #000000;">&#41;</span></div>[/code:12mt22pv] and the program completely blocks Excel and client has to switch off his pc. client uses Excel 64 bit. Regards Maurizio <!-- w --><a class="postlink" href="http://www.nipeservice.com">www.nipeservice.com</a><!-- w -->
xBrowse and ToExcel problem
I never tested with Excel 64 bits, but I *assume* that may not be the problem. The problem is more likely to be with the text data prepared by xbrowse for pasting into Excel range. The entire text or part of it may be invalid for pasting. If the xbrowse has image data (or binary data) in the earlier versions the image was properly pasted into excel but in all recent versions (2007 onwards) it is failing with similar error. With the limited information available here, I am unable to come up with any more ideas.
xBrowse and Array Refresh
Dear Freinds,In my app I am using a dialog with 2 xBrowse's on it.xBrowse 1 (oBrwUsers) will display the user's listxBrowse 2 (oBrwMenu) will display the Menu's available to the user Wne the user moves thru the xBrowse 1, xBrowse 2 should update/refresh the menu's available to the userIn xBrowse 1 (oBrwUsers), I am using ADO RecordSetIn xBrowse 2 (oBrwMenu), I am using an arrayScreen Snapshot[url=http&#58;//imageshack&#46;us:3eheqw4c][img:3eheqw4c]http&#58;//img390&#46;imageshack&#46;us/img390/3660/xbrwtf9&#46;jpg[/img:3eheqw4c][/url:3eheqw4c][url=http&#58;//g&#46;imageshack&#46;us/img390/xbrwtf9&#46;jpg/1/:3eheqw4c][img:3eheqw4c]http&#58;//img390&#46;imageshack&#46;us/img390/xbrwtf9&#46;jpg/1/w694&#46;png[/img:3eheqw4c][/url:3eheqw4c]My problem is that xBrowse 2 is not getting refreshed when the user moves thru xBrowse 1On xBrowse 1's bChange I have used the following code[code:3eheqw4c]oBrwUsers&#58;bChange&#58;=&#123; || nUserId&#58;=oUsers&#58;oRecSet&#58;Fields&#40;"User_Id"&#41;&#58;Value,; // func GetUserMenu&#40;&#41; will erase the array aMenu and creates a Fresh array, aMenu is the array used in xBrowse2 GetUserMenu&#40;oUserMenu,oMenuArray,nUserId,@aMenu&#41;,; oBrwMenu&#58;Update&#40;&#41;,; oBrwMenu&#58;Refresh&#40;&#41;,; oDlg&#58;UpDate&#40;&#41; &#125;[/code:3eheqw4c]I have checked and found that Function GetUserMenu(oUserMenu,oMenuArray,nUserId,@aMenu) is creating the array perfectly with all the required data. But xBrowse not getting refreshed with the new updataed array dataCode to create xBrowse 2 (oBrwMenu)[quote:3eheqw4c]@ 0,100 XBROWSE oBrwMenu ; COLUMNS 2, 3 ; HEADERS "Menu", "Status" ; OF oDlg ; ARRAY aMenu // should not use AUTOCOLS now *oBrwMenu:SetArray( aMenu,.F. ) oBrwMenu:lUpdate := .t. oBrwMenu:nColSel := 2 oBrwMenu:aCols[ 1 ]:nWidth:=330 oBrwMenu:aCols[ 2 ]:SetCheck( { "CheckOn", "CheckOff" } ) oBrwMenu:aCols[ 2 ]:bStrData:=NIL[/quote:3eheqw4c]Any Idea where I have went wrong ?RegardsAnser
xBrowse and Array Refresh
[code:hl4ypa96]function GetUserMenu&#40;oUserMenu,oMenuArray,nUserId,aMenu&#41; &#46;&#46;&#46; &#46;&#46;&#46; your commands &#46;&#46;&#46; &#46;&#46;&#46; return aMenu [/code:hl4ypa96] [code:hl4ypa96]oBrwUsers&#58;bChange&#58;=&#123; || nUserId&#58;=oUsers&#58;oRecSet&#58;Fields&#40;"User_Id"&#41;&#58;Value,; oBrwMenu&#58;aArrayData &#58;=GetUserMenu&#40;oUserMenu,oMenuArray,nUserId,aMenu&#41;,; oBrwMenu&#58;Refresh&#40;&#41;,; oDlg&#58;UpDate&#40;&#41; &#125;[/code:hl4ypa96]other point..oBrwMenu:aCols[ 2 ]:bStrData:=[b:hl4ypa96]{||NIL}[/b:hl4ypa96]
xBrowse and Array Refresh
Hi Daniel,Thankyou for the support. [b:1lx4pnei]oBrwMenu:aArrayData [/b:1lx4pnei] did the trick[b:1lx4pnei]oBrwMenu:nWidth[/b:1lx4pnei] should be set manually for [b:1lx4pnei]oBrwMenu:aCols[ 2 ]:bStrData:={||NIL}[/b:1lx4pnei] to work properly otherwise it will give an error Len(0).[code:1lx4pnei]oBrwMenu&#58;aCols&#91; 2 &#93;&#58;nWidth&#58;=100 oBrwMenu&#58;aCols&#91; 2 &#93;&#58;bStrData&#58;=&#123; || NIL &#125;[/code:1lx4pnei]Once again thank you for the help.RegardsAnser
xBrowse and Mysql
Mr Nages, how to in xbrowse: REDEFINE XBROWSE oBrw ID 100 DATASOURCE oQuery ; HEADERS "Fecha","Motivo" ; COLUMNS "FECHA",{|| myfunction(oQuery:CODIGO)} ; //where myfunction is a function external JUSTIFY AL_CENTER,AL_LEFT ; COLSIZES 60,200 ; LINES CELL NOBORDER OF oDlg oDlg:oClient:=oBrw It can be done? Regards Roberto
xBrowse and Mysql
Yes. You can intermix codeblocks in the COLUMNS clause if you are using any recent version of FWH. If you are using an older version where codeblocks are not allowed, I suggest this workaround. First specify the COLUMNS CLAUSE with some column name for the second column also. After that you assign codeblock to the oCol:bEditValue. Example: oBrw:aCols[ 2 ]:bEditValue := { || ........your codeblock } Also assign :cEditPicture if required and assign :cHeader Alternatively, you can use ADD TO oBrw DATA (your func) HEADER .... etc
xBrowse and Mysql
Mr. Nages Thank you very much! Roberto
xBrowse and SQLRDD bug
We enhanced VScroll bar compatibility for SQLRDD xbrowse in FWH 2006. This is the test program: [code=fw:3t3hkm8v]<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;">"SQLRDD.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"MySQL.Ch"</span><br /><br />REQUEST DBFCDX<br />REQUEST SQLRDD, SR_MYSQL<br /><br /><span style="color: #00C800;">static</span> SQLRDD_nKeyNo  := <span style="color: #000000;">1</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   field CODE,<span style="color: #0000ff;">NAME</span><br /><br />   <span style="color: #00C800;">local</span> cServer, cDatabase, cUser, cPassword, cConnection, nConnection := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> aData, aStruct, cTag<br /><br />   cServer     := <span style="color: #ff0000;">"localhost"</span><br />   cDatabase   := <span style="color: #ff0000;">"sqlrdd"</span><br />   cUser       := <span style="color: #ff0000;">"root"</span><br />   cPassword   := <span style="color: #ff0000;">"password"</span><br /><br />   ? <span style="color: #ff0000;">"Start"</span><br /><br />   USE STATES SHARED<br />   aData    := FW_DbfToArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   aStruct  := DBSTRUCT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   CLOSE <span style="color: #00C800;">DATA</span><br /><br />   cConnection := <span style="color: #ff0000;">"HST="</span>+cServer+<span style="color: #ff0000;">";UID="</span>+cUser+<span style="color: #ff0000;">";PWD="</span>+cPassword+<span style="color: #ff0000;">";DTB="</span>+cDatabase<br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Connecting to Server"</span>, <span style="color: #ff0000;">"SQLRDD"</span>, ;<br />           <span style="color: #000000;">&#123;</span> || nConnection := SR_AddConnection<span style="color: #000000;">&#40;</span> CONNECT_MYSQL, cConnection <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   ? <span style="color: #ff0000;">"nConnection ="</span>, nConnection<br /><br />   <span style="color: #00C800;">if</span> nConnection <= <span style="color: #000000;">0</span><br />      MsgAlert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No conexion. "</span>,<span style="color: #ff0000;">"Verifique!"</span><span style="color: #000000;">&#41;</span><br />      QUIT<br />   <span style="color: #00C800;">endif</span><br /><br />   RddSetDefault<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SQLRDD"</span><span style="color: #000000;">&#41;</span><br />   SR_UseDeleteds<span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br /><br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Creting states table"</span>, <span style="color: #ff0000;">"SQLRDD"</span>, ;<br />           <span style="color: #000000;">&#123;</span> || DBCREATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"states"</span>, aStruct, <span style="color: #ff0000;">"SQLRDD"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Writing 51 records to states.dbf"</span>, <span style="color: #ff0000;">"SQLRDD"</span>, <||<br />      USE states EXCLUSIVE <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"SQLRDD"</span><br />      FW_ArrayToDBF<span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> CODE TAG CODE<br />      <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">NAME</span><span style="color: #000000;">&#41;</span> TAG <span style="color: #0000ff;">NAME</span> ADDITIVE<br />      CLOSE <span style="color: #00C800;">DATA</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />      > <span style="color: #000000;">&#41;</span><br /><br /><br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Using sates.dbf"</span>, <span style="color: #ff0000;">"SQLRDD"</span>, <||<br />      USE states SHARED <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"SQLRDD"</span><br />      > <span style="color: #000000;">&#41;</span><br /><br />   SET ORDER <span style="color: #0000ff;">TO</span> TAG <span style="color: #0000ff;">NAME</span><br />   GO BOTTOM<br /><br />   XBROWSER <span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> FASTEDIT AUTOSORT SHOW RECID ;<br />      <span style="color: #0000ff;">TITLE</span> FWVERSION + <span style="color: #ff0000;">" : SQLRDD"</span> ;<br />      SETUP <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">lFastEdit</span> := .f., oBrw:<span style="color: #000000;">lVThumbTrack</span> := .t. <span style="color: #000000;">&#41;</span><br /><br />   DBCLOSEALL<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   SR_end<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   ? <span style="color: #ff0000;">"Done"</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:3t3hkm8v] [url=https&#58;//imageshack&#46;com/i/pmfiP65cg:3t3hkm8v][img:3t3hkm8v]https&#58;//imagizer&#46;imageshack&#46;com/img922/7646/fiP65c&#46;gif[/img:3t3hkm8v][/url:3t3hkm8v]
xBrowse and SQLRDD bug
Hi, I would like to ask the status of the fix, as I reported the wrong behaviour in december. Thank you.
xBrowse and SQLRDD bug
Up!
xBrowse and SQLRDD bug
Up
xBrowse and SQLRDD bug
???
xBrowse and SQLRDD bug
Any update please?
xBrowse and SQLRDD bug
Moises, I just asked Rao, I am waiting for his answer Also, please keep in mind that SQLRDD is a commercial product, that does not provide source code, and its not easy to support it in those circunstances, anyhow we are doing out best to help you. So, please, be patient. Changing the caption of your posts only provide a wrong sense to other users and its not a kind way to ask for help.
xBrowse and SQLRDD bug
Hable con Marcelo Lombardo del Proyecto xHarbour. Skype: marcelolombardo Saludos.
xBrowse and SQLRDD bug
Olá, Como não falo nem português nem brasileiro, poderia partilhar connosco a sua resposta? Muito obrigado.
xBrowse and SQLRDD bug
usted puede hablar en español con Marcelo Lombardo sin problemas, ó con Patrick Mast en ingléz. Saludos. Mejor: [url:dhtyefl7]https&#58;//www&#46;facebook&#46;com/marcelombardo[/url:dhtyefl7] [url:dhtyefl7]https&#58;//www&#46;facebook&#46;com/patrickmast[/url:dhtyefl7] [url:dhtyefl7]https&#58;//www&#46;facebook&#46;com/luiz&#46;guimaraes&#46;756?fref=search&__tn__=%2Cd%2CP-R&eid=ARDg2UIh6BoVDWE4SqZqx5IOHrRy60HmNrE26uE7FpQa0IJWEROdwpQdRRCbgrviQ5L9uLNMDOMiary0[/url:dhtyefl7]
xBrowse and SQLRDD bug
The issue is about vertical scrollbar support to xbrowse for SQLRDD. I have sent modified xbrowse.prg, restoring previous functionality. Vertical scrollbar support for SQLRDD is very limited. In order to provide better support we need to know some details about SQLRDD. We will start explaining with a DBFCDX DBF. In this example, states.dbf is used via DBFCDX and index order is set to field NAME and also a filter is set: [code=fw:2135q3rl]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> XbrVScroll<br /><br />&nbsp; &nbsp;field <span style="color: #0000ff;">NAME</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oFont<br /><br />&nbsp; &nbsp;USE STATES <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp;SET ORDER <span style="color: #0000ff;">TO</span> TAG <span style="color: #0000ff;">NAME</span><br />&nbsp; &nbsp;SET FILTER <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">NAME</span> >= <span style="color: #ff0000;">"A"</span> .AND. <span style="color: #0000ff;">NAME</span> <= <span style="color: #ff0000;">"D"</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"VSCROLLBAR"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE <span style="color: #ff0000;">"STATES"</span> ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"RECNO()"</span>, <span style="color: #ff0000;">"CODE"</span>, <span style="color: #ff0000;">"NAME"</span> ;<br />&nbsp; &nbsp; &nbsp; PICTURES <span style="color: #ff0000;">"999"</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:2135q3rl] [url=https&#58;//imageshack&#46;com/i/pmSMsj1vp:2135q3rl][img:2135q3rl]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq90/922/SMsj1v&#46;png[/img:2135q3rl][/url:2135q3rl] In this case, xbrowse knows that the total number of visible records in the DBF are 9 (nine) with the help of the function OrdKeyCount(). Also xbrowse knows that the current record is 7th (seventh) from top using the function OrdKeyNo(). With this information, xbrowse is able to position the thumb of the scrollbar at 7/9 of the scrollbar. Also if the user drags the scrollbar to say 3/9th position on the scrollbar, then xbrowse will move the record position to the 3rd record from the top using OrdKeyGoTo(). Using this example, please advise us how should xbrowse ascertain 1) The total number of records visible in the DBF 2) What is the serial number of the current record counting from the top. 3) How to go to a record at the nth position when counted from the top. If you can provide us what functions to use to know the above three, then we will be able to provide full support for vertical scrollbar. Please help us.
xBrowse and SQLRDD bug
Thank you very much for your time and support. With the changes you have sent me, it is possible to navigate in the xBrowse by moving the vertical scroll bar. The only remaining problem is if I perform a DbGoBottom() and then call xBrowse, the vertical scroll bar still appears on top. OrdKeyCount() works perfect under SQLRDD, but OrdKeyNo() is not supported, it returns 0 always. They are not going to fix it, they say it is impossible. In the past, you solved I think as follows: [code=fw:a4bvs7dd]<div class="fw" id="{CB}" style="font-family: monospace;">   <br />   <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bKeyNo</span>     := ::<span style="color: #000000;">bBookMark</span>, ;<br />            ::<span style="color: #000000;">bKeyCount</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> LastRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></div>[/code:a4bvs7dd] <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=24327&p=138698#p138698">viewtopic.php?f=3&t=24327&p=138698#p138698</a><!-- l -->
xBrowse and SQLRDD bug
This code: [code=fw:20p45gr3]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bKeyNo</span>     := ::<span style="color: #000000;">bBookMark</span>, ;</div>[/code:20p45gr3] ::bBookMark is { |x| If( x == nil, RECNO(), DBGOTO( x ) ) } This works well if the DBF is in natural order (with no index set) and when no filter is set. If the DBF is set to an index or if a filter is set, this behaves very erratically. Do you want this? Please also let me know do these functions work reliably with SQLRDD? [code=fw:20p45gr3]<div class="fw" id="{CB}" style="font-family: monospace;"><br />DBFILTER<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />ORDSETFOCUS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:20p45gr3] Can you also please confirm that when a filter is set, OrdKeyCount() returns the count of filtered records only? In the post you referred, Mr. Kokoo suggested maintaining an array of RecNo()s outside the xbrowse. This works well but the programmer has to do an extra work of creating the array at the beginning and recreating whenever the index is changed, record is added or deleted of a keyvalue is edited and modified. This is upto you if you want to adopt this approach.
xBrowse and SQLRDD bug
To give the same effect as the code: [code=fw:iqgvmbth]<div class="fw" id="{CB}" style="font-family: monospace;"><br />::<span style="color: #000000;">bKeyNo</span> := ::<span style="color: #000000;">bBookMark</span><br />&nbsp;</div>[/code:iqgvmbth] we made these changes: [code=fw:iqgvmbth]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bKeyNo</span> := <span style="color: #000000;">&#123;</span> |n| <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> SqlRddKey<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />...<br />...<br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SqlRddKey<span style="color: #000000;">&#40;</span> x <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> DBFILTER<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .and. Empty<span style="color: #000000;">&#40;</span> OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> x != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBGOTO<span style="color: #000000;">&#40;</span> x <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br />&nbsp;</div>[/code:iqgvmbth] We sent the modified xbrowse.prg to your email. Please check.
xBrowse and SQLRDD bug
Yes, I confirm that DBFILTER()/SET FILTER TO and ORDSETFOCUS() work under SQLRDD. And yes, when a filter is set, OrdKeyCount() Works too. But never OrdKeyNo() I am going to test your new versión and share the results. Thank you.
xBrowse and SQLRDD bug
Up!
xBrowse and SQLRDD bug
Up
xBrowse and SQLRDD bug
I have tested with this sample with FWH20.04. I found the scrollbar working properly and if we execute DBGOBOTTOM() before invoking the browse, the vertical scrollbar is positioned at the bottom. Please try this sample on your server, by changing the password, etc. This is my modified buildx.bat [code=fw:26wm649p]<div class="fw" id="{CB}" style="font-family: monospace;">@ECHO OFF<br />CLS<br />ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿<br />ECHO ³ FiveWin <span style="color: #00C800;">for</span> xHarbour <span style="color: #000000;">20.04</span> - Apr. <span style="color: #000000;">2020</span>          Harbour development <span style="color: #0000ff;">power</span>  ³Ü<br />ECHO ³ <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> FiveTech <span style="color: #000000;">1993</span><span style="color: #000000;">-2020</span> <span style="color: #00C800;">for</span> Microsoft Windows 9X/NT/200X/ME/XP/Vista/<span style="color: #000000;">7</span>/<span style="color: #000000;">8</span>/<span style="color: #000000;">10</span> ³Û<br />ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ<br />ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß<br /><br /><span style="color: #00C800;">if</span> A%<span style="color: #000000;">1</span> == A GOTO :<span style="color: #000000;">SINTAX</span><br /><span style="color: #00C800;">if</span> NOT EXIST %<span style="color: #000000;">1</span>.prg GOTO :<span style="color: #000000;">NOEXIST</span><br /><br />ECHO Compiling...<br /><br /><span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%FWDIR%"</span> == <span style="color: #ff0000;">""</span> set FWDIR=.\..\<br /><span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%XHDIR%"</span> == <span style="color: #ff0000;">""</span> set XHDIR=c:\xharbour<br />rem <span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%2"</span> == <span style="color: #ff0000;">"/b"</span> set GT=gtwin<br />rem <span style="color: #00C800;">if</span> not <span style="color: #ff0000;">"%2"</span> == <span style="color: #ff0000;">"/b"</span> set GT=gtgui<br />set GT=gtgui<br /><br />set hdir=%XHDIR%<br />set hdirl=%hdir%\lib<br />set bcdir=c:\bcc7<br />set fwh=%FWDIR%<br /><br />%hdir%\bin\harbour %<span style="color: #000000;">1</span> /n /i%fwh%\include;%hdir%\include;c:\sqlrdd\include /w /p %<span style="color: #000000;">2</span> %<span style="color: #000000;">3</span> > comp.log <span style="color: #000000;">2</span>> warnings.log<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO COMPILEERRORS<br />@type comp.log<br />@type warnings.log<br /><br />echo -O2 -e%<span style="color: #000000;">1</span>.exe -I%hdir%\include -I%bcdir%\include %<span style="color: #000000;">1</span>.c > b32.bc<br />%bcdir%\bin\bcc32 -M -c -v @b32.bc<br />:<span style="color: #000000;">ENDCOMPILE</span><br /><br /><span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.rc %bcdir%\bin\brc32.exe -r -I%bcdir%\include -I%bcdir%\include\windows\sdk %<span style="color: #000000;">1</span><br /><br />echo %bcdir%\lib\c0w32.obj + > b32.bc<br />echo %<span style="color: #000000;">1</span>.obj, + >> b32.bc<br />echo %<span style="color: #000000;">1</span>.exe, + >> b32.bc<br />echo %<span style="color: #000000;">1</span>.map, + >> b32.bc<br />echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib %fwh%\lib\libmysql.lib + >> b32.bc<br />echo c:\sqlrdd\lib\odbccp32.lib + >> b32.bc<br />echo c:\sqlrdd\lib\sql.lib + >> b32.bc<br />echo %hdirl%\hbhpdf.lib + >> b32.bc<br />echo %hdirl%\libharu.lib + >> b32.bc<br />echo %hdirl%\png.lib + >> b32.bc<br />echo %hdirl%\rtl.lib + >> b32.bc<br />echo %hdirl%\vm.lib + >> b32.bc<br />echo %hdirl%\%GT%.lib + >> b32.bc<br />echo %hdirl%\lang.lib + >> b32.bc<br />echo %hdirl%\macro.lib + >> b32.bc<br />echo %hdirl%\rdd.lib + >> b32.bc<br />echo %hdirl%\dbfntx.lib + >> b32.bc<br />echo %hdirl%\dbfcdx.lib + >> b32.bc<br />echo %hdirl%\dbffpt.lib + >> b32.bc<br />echo %hdirl%\hbsix.lib + >> b32.bc<br />echo %hdirl%\debug.lib + >> b32.bc<br />echo %hdirl%\common.lib + >> b32.bc<br />echo %hdirl%\codepage.lib + >> b32.bc<br />echo %hdirl%\pp.lib + >> b32.bc<br />echo %hdirl%\pcrepos.lib + >> b32.bc<br />echo %hdirl%\ct.lib + >> b32.bc<br />echo %hdirl%\zlib.lib + >> b32.bc<br />echo %hdirl%\hbzip.lib + >> b32.bc<br />echo %hdirl%\libmisc.lib + >> b32.bc<br />echo %hdirl%\tip.lib + >> b32.bc<br />echo %hdirl%\hbzebra.lib + >> b32.bc<br />rem echo %hdirl%\png.lib + >> b32.bc<br /><br />rem Uncomment these two lines <span style="color: #0000ff;">to</span> use Advantage RDD<br />rem echo %hdir%\lib\rddads.lib + >> b32.bc<br />rem echo %hdir%\lib\Ace32.lib + >> b32.bc<br /><br />echo %bcdir%\lib\cw32.lib + >> b32.bc<br />echo %bcdir%\lib\import32.lib + >> b32.bc<br />echo %bcdir%\lib\uuid.lib + >> b32.bc<br />echo %bcdir%\lib\ws2_32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\shell32.lib, >> b32.bc<br /><br /><span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.res echo %<span style="color: #000000;">1</span>.res >> b32.bc<br /><br />rem uncomment this line <span style="color: #0000ff;">to</span> use the debugger and comment the following one<br /><span style="color: #00C800;">if</span> %GT% == gtwin %bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO LINKERROR<br /><span style="color: #00C800;">if</span> %GT% == gtgui %bcdir%\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO LINKERROR<br />ECHO * Application successfully built *<br />%<span style="color: #000000;">1</span><br />GOTO EXIT<br />ECHO<br /><br />rem delete temporary files<br />@del %<span style="color: #000000;">1</span>.c<br /><br />:<span style="color: #000000;">COMPILEERRORS</span><br />@type comp.log<br />ECHO * Compile errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">LINKERROR</span><br />ECHO * Linking errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">SINTAX</span><br />ECHO    SYNTAX: <span style="color: #000000;">Build</span> <span style="color: #000000;">&#91;</span>Program<span style="color: #000000;">&#93;</span>     <span style="color: #000000;">&#123;</span>-- No especifiques la extensi?n PRG<br />ECHO                                <span style="color: #000000;">&#123;</span>-- Don<span style="color: #ff0000;">'t specify .PRG extension<br />GOTO EXIT<br /><br />:NOEXIST<br />ECHO The specified PRG %1 does not exist<br /><br />:EXIT</span></div>[/code:26wm649p] This is my sample program: [code=fw:26wm649p]<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;">"SQLRDD.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"MySQL.Ch"</span><br /><br />REQUEST DBFCDX<br />REQUEST SQLRDD, SR_MYSQL<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cServer, cDatabase, cUser, cPassword, cConnection, nConnection := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> aData, aStruct<br /><br />   cServer     := <span style="color: #ff0000;">"localhost"</span><br />   cDatabase   := <span style="color: #ff0000;">"sqlrdd"</span><br />   cUser       := <span style="color: #ff0000;">"root"</span><br />   cPassword   := <span style="color: #ff0000;">"??????"</span><br /><br />   ? <span style="color: #ff0000;">"Start"</span><br /><br />   USE STATES SHARED<br />   aData    := FW_DbfToArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   aStruct  := DBSTRUCT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   CLOSE <span style="color: #00C800;">DATA</span><br /><br />   cConnection := <span style="color: #ff0000;">"HST="</span>+cServer+<span style="color: #ff0000;">";UID="</span>+cUser+<span style="color: #ff0000;">";PWD="</span>+cPassword+<span style="color: #ff0000;">";DTB="</span>+cDatabase<br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Connecting to Server"</span>, <span style="color: #ff0000;">"SQLRDD"</span>, ;<br />           <span style="color: #000000;">&#123;</span> || nConnection := SR_AddConnection<span style="color: #000000;">&#40;</span> CONNECT_MYSQL, cConnection <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   ? <span style="color: #ff0000;">"nConnection ="</span>, nConnection<br /><br />   <span style="color: #00C800;">if</span> nConnection <= <span style="color: #000000;">0</span><br />      MsgAlert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No conexion. "</span>,<span style="color: #ff0000;">"Verifique!"</span><span style="color: #000000;">&#41;</span><br />      QUIT<br />   <span style="color: #00C800;">endif</span><br /><br />   RddSetDefault<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SQLRDD"</span><span style="color: #000000;">&#41;</span><br />   SR_UseDeleteds<span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br /><br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Creting states table"</span>, <span style="color: #ff0000;">"SQLRDD"</span>, ;<br />           <span style="color: #000000;">&#123;</span> || DBCREATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"states"</span>, aStruct, <span style="color: #ff0000;">"SQLRDD"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Writing 51 records to states.dbf"</span>, <span style="color: #ff0000;">"SQLRDD"</span>, <||<br />      USE states EXCLUSIVE <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"SQLRDD"</span><br />      FW_ArrayToDBF<span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br />      CLOSE <span style="color: #00C800;">DATA</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />      > <span style="color: #000000;">&#41;</span><br /><br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Using sates.dbf"</span>, <span style="color: #ff0000;">"SQLRDD"</span>, <||<br />      USE states SHARED <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"SQLRDD"</span><br />      GO BOTTOM<br />      > <span style="color: #000000;">&#41;</span><br /><br />   XBROWSER <span style="color: #ff0000;">"STATES"</span> FASTEDIT SHOW RECID <span style="color: #0000ff;">TITLE</span> FWVERSION + <span style="color: #ff0000;">" "</span> + RDDNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   DBCLOSEALL<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   SR_end<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   ? <span style="color: #ff0000;">"Done"</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:26wm649p] This is the result: [url=https&#58;//imageshack&#46;com/i/pm4D02Acg:26wm649p][img:26wm649p]https&#58;//imagizer&#46;imageshack&#46;com/img922/9870/4D02Ac&#46;gif[/img:26wm649p][/url:26wm649p] Notes: VScrollbar works as expected when the dbf is in natural order (not set to an index) and no filter is set. I am unable to understand why this is not working at your end.
xBrowse and SQLRDD bug
First of all, thank you for your time. It fails when the DBF has an index. Please add this changes: [code=fw:14zzfo7o]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><br />USE states SHARED <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"SQLRDD"</span><br />&nbsp; <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> field->CODE TAG NAGES1<br /><br />&nbsp; GO BOTTOM<br /><br />&nbsp; XBROWSER <span style="color: #ff0000;">"STATES"</span> FASTEDIT SHOW RECID <span style="color: #0000ff;">TITLE</span> FWVERSION + <span style="color: #ff0000;">" "</span> + RDDNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; DBCLOSEALL<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; SR_end<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:14zzfo7o] The result is this: [url=https&#58;//postimg&#46;cc/wtpKS33p:14zzfo7o][img:14zzfo7o]https&#58;//i&#46;postimg&#46;cc/wtpKS33p/nages&#46;png[/img:14zzfo7o][/url:14zzfo7o]
xBrowse and TOTAL
Mr Rao, I test xBrowse with Total , I'd like to know why this works [code=fw:388xtgfo]<div class="fw" id="{CB}" style="font-family: monospace;">   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />        <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CUST"</span> ;<br />        COLUMNS <span style="color: #ff0000;">"First"</span> ;<br />        CELL LINES FOOTERS NOBORDER<br /><br />   ADD COLUMN <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> FieldWBlock<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Age"</span>,<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span>caLMov<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ;<br />                HEADER <span style="color: #ff0000;">"Age"</span>  ALIGN  <span style="color: #0000ff;">RIGHT</span> <br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nStretchCol</span>         := <span style="color: #000000;">1</span><br />      :<span style="color: #000000;">Age</span>:<span style="color: #000000;">nFooterType</span>  := AGGR_SUM<br />      :<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// omit for resource</span><br />   END<br /> </div>[/code:388xtgfo] And this doesn't works (without COLUMNS "First" ) [code=fw:388xtgfo]<div class="fw" id="{CB}" style="font-family: monospace;">   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />        <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CUST"</span> ;<br />        CELL LINES FOOTERS NOBORDER<br /><br />   ADD COLUMN <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> FieldWBlock<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Age"</span>,<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span>caLMov<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ;<br />                HEADER <span style="color: #ff0000;">"Age"</span>  ALIGN  <span style="color: #0000ff;">RIGHT</span> <br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nStretchCol</span>         := <span style="color: #000000;">1</span><br />      :<span style="color: #000000;">Age</span>:<span style="color: #000000;">nFooterType</span>  := AGGR_SUM<br />      :<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// omit for resource</span><br />   END</div>[/code:388xtgfo] Thanks in anticipation Maurizio <!-- w --><a class="postlink" href="http://www.nipeservice.com">www.nipeservice.com</a><!-- w -->
xBrowse and TOTAL
Present behavior is that when XBrowse is created without specifying any columns ( or with autcols ) call to SetRDD() is deferred till initialization of xbrowse. In that case methods like MakeTotals() should be called in ON INIT clause in case of Dialogs and after CreateFromCode() in case of Windows. I think we can and should change this behavior and we shall implement the changed behavior from the next release. Meanwhile you can make this small change in your xbrowse.prg. Please locate the following lines in function XbrwSetDataSource(...) (line no:12621 in fwh13.08 2nd revision) [code=fw:4y0lmtwy]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lAddCols .or. ! Empty<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:4y0lmtwy] Please change it as [code=fw:4y0lmtwy]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> .t. &nbsp; &nbsp;<span style="color: #B900B9;">// lAddCols .or. ! Empty( aCols )</span><br />&nbsp;</div>[/code:4y0lmtwy]
xBrowse and ToExcel()
Hello I remarked that when I use xbrowse Toexcel() in excel the numer are always wrong . I try to use xbrNumFormat() but the number but without success . It's a xbrowse bug ? Regards Maurizio
xBrowse and ToExcel()
here run ok
xBrowse and ToExcel()
I found, that if numbers as characterfield defined, then Excel marked it as "error". If it real numbers with decimals, then it is ok.
xBrowse and ToExcel()
This is a sample that explain the problem [code:2urk2ipx]#include 'fivewin&#46;ch' #include 'xbrowse&#46;ch' static oFont, ovFont,oWnd,oBrw function main() Local aDbf &#58;= {} Local nX &#58;= 1 Local cPic &#58;= "@ZE 999999&#46;9999" ferase("NUMBER&#46;DBF") AADD (aDbf, {"NUM_1" ,"N", 12, 3 }) AADD (aDbf, {"NUM_2" ,"N", 12, 3 }) AADD (aDbf, {"NUM_3" ,"N", 12, 3 }) dbcreate("NUMBER", aDbf) xbrNumFormat( "E", &#46;t&#46; ) // "E" for European, "A" for American and others // &#46;t&#46; for showing thousand separators use number FOR nX &#58;= 1 to 10 dbappend() field->NUM_1 &#58;= nX * 0&#46;1 field->NUM_2 &#58;= nX * 10 field->NUM_3 &#58;= nX * 100 NEXT dbgotop() DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12 DEFINE FONT oVfont NAME 'TAHOMA' SIZE 0,-12 NESCAPEMENT 900 DEFINE WINDOW oWnd MENU MainMenu() oWnd&#58;SetFont( oFont ) @ 0,0 XBROWSE oBrw ; COLUMNS 'NUM_1', 'NUM_2', 'NUM_3' ; PICTURE cPic,cPic,cPic ; OF oWnd ; ALIAS 'NUMBER' ; LINES CELL oBrw&#58;CreateFromCode() oWnd&#58;oClient &#58;= oBrw SET MESSAGE OF oWnd TO "XBrowse " 2007 ACTIVATE WINDOW oWnd return nil //=========================== Static Function MAinMenu() Local oPop MENU oPop 2007 MENUITEM "Excel" ACTION oBrw&#58;ToExcel() MENUITEM "Exit" ACTION oWnd&#58;end() ENDMENU Return oPop[/code:2urk2ipx] And this is the images [img][url=http&#58;//img162&#46;imageshack&#46;us/my&#46;php?image=immagineys6&#46;png:2urk2ipx][IMG]http://img162.imageshack.us/img162/4546/immagineys6.th.png[/img][/url:2urk2ipx][/img]
xBrowse and Windows Vista ( Question )
Hello,Because of a new computer, i'm working withWindows Vista now.I noticed a funny effect when changing the focusbetween browsers in a dialog :The rows in the other browsers, where the cursor has been before, when i change the focus, are changing to black. In windows 2000 it is ok.I use nothing special[img:2hjug780]http&#58;//www&#46;pflegeplus&#46;com/pictures/brush5&#46;jpg[/img:2hjug780][code:2hjug780] // Browser 1 oLbx1 &#58;= TXBrowse&#40;&#41;&#58;New&#40; oFld&#58;aDialogs&#91;1&#93; &#41; oLbx1&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLROW oLbx1&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oLbx1&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oLbx1&#58;SetArray&#40; aBRCOLOR1 &#41; oLbx1&#58;aCols&#91; 1 &#93;&#58;cHeader = Padr&#40;"No&#46;", 3&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;cHeader = Padr&#40;"Start", 19&#41; oLbx1&#58;lHScroll &#58;= &#46;F&#46; oLbx1&#58;lVScroll &#58;= &#46;F&#46; oLbx1&#58;lFooter &#58;= &#46;F&#46; oLbx1&#58;bLClicked &#58;= &#123; | nRow, nCol | Bs_START &#58;= oLbx1&#58;nRowSel, ; Bs_COLOR1 &#58;= B_COLORS&#40;Bs_START&#41;, oB_COLOR1&#58;Refresh&#40;&#41;, ; oBMP3&#58;Refresh&#40;&#41;, oBMP4&#58;Refresh&#40;&#41;, oBMP5&#58;Refresh&#40;&#41;, oBMP6&#58;Refresh&#40;&#41;, ; oBMP7&#58;Refresh&#40;&#41;, oBMP8&#58;Refresh&#40;&#41;, oBMP9&#58;Refresh&#40;&#41;, ; oBMP10&#58;Refresh&#40;&#41;, oBMP11&#58;Refresh&#40;&#41;, oBMP12&#58;Refresh&#40;&#41;, ; oBMP18&#58;Refresh&#40;&#41; &#125; oLbx1&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Black"&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"White"&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Blue"&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Green"&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Red"&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Yellow"&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Magenta"&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Farbwahl"&#41; oLbx1&#58;aCols&#91; 2 &#93;&#58;bBmpData &#58;= &#123;|| oLbx1&#58;nArrayAt &#125; oLbx1&#58;aCols&#91; 2 &#93;&#58;bStrData &#58;= &#123;|| oLbx1&#58;aRow&#91;2&#93; &#125; oLbx1&#58;CreateFromResource&#40; 210 &#41; [/code:2hjug780] I notice this effect the first time. Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> [/code]
xBrowse and Windows Vista ( Question )
Hello Uwe,I have the same problem.As a workaround I use: oBrw:bClrSel := {|| { RGB(173,183,48),RGB(250,247,107) } }Regards,Otto
xBrowse and Windows Vista ( Question )
Hello Otto,thank you very much.The problem is solved.[img:cvsvlhm3]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrowse5&#46;jpg[/img:cvsvlhm3]Best RegardsUwe[/img]
xBrowse and a codeblock column
To All I have a listbox that I want to convert to xBrowse.. with using the COLUMNS syntax .. I have a code block that returns a value that populates a column. ( DispType( oRsVEH ) ) It is that codeblock that errors and I do not know of a way to return the value I want to display in the specific column .. here is the code : Also notice .. my old listbox code turned a row a specific color nased on a certain data condition .. i have not been able to figure that one out yet either .. Rick Lipkin [code=fw:3nhnba9s]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cTITLE := <span style="color: #ff0000;">"SELECT * from VEHICLES where AGENCY = '"</span>+xAGENCY+<span style="color: #ff0000;">"'"</span><br /><br />nWd := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> * .<span style="color: #000000;">50</span><br />nHt := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> * .<span style="color: #000000;">8</span><br /><br />lOK := .F.<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oICO <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"KEY"</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd1                        ;<br />      <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">to</span> nHt, nWd <span style="color: #0000ff;">PIXEL</span>         ;<br />      <span style="color: #0000ff;">TITLE</span> cTITLE                         ;<br />      <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span>oRsVEH<span style="color: #000000;">&#41;</span>               ;<br />      <span style="color: #0000ff;">ICON</span> oICO                            ;<br />      NOMINIMIZE                           ;<br />      NOZOOM                               ;<br />      <span style="color: #0000ff;">MDICHILD</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> oWnd1               ;<br />       RECORDSET oRsVeh                    ;<br />       COLUMNS <span style="color: #ff0000;">'VNUMBER'</span>,                  ;<br />               EVAL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span>|x|Disptype<span style="color: #000000;">&#40;</span> oRsVeh<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>,;   <span style="color: #B900B9;">//  <-- error here</span><br />              <span style="color: #ff0000;">'LICENSE'</span>,                   ;<br />              <span style="color: #ff0000;">'AGENCY'</span>,                    ;<br />              <span style="color: #ff0000;">'MAKE'</span>,                      ;<br />              <span style="color: #ff0000;">'TYPE'</span>,                      ;<br />              <span style="color: #ff0000;">'YEAR'</span>,                      ;<br />              <span style="color: #ff0000;">'PROG'</span>,                      ;<br />              <span style="color: #ff0000;">'MOTORPOOL'</span>,                 ;<br />              <span style="color: #ff0000;">'REGION'</span>,                    ;<br />              <span style="color: #ff0000;">'LASTSERVCE'</span>,                ;<br />              <span style="color: #ff0000;">'NEXTSERVCE'</span>,                ;<br />              <span style="color: #ff0000;">'NEXTMILAGE'</span>,                ;<br />              <span style="color: #ff0000;">'SERIALNUMB'</span>,                ;<br />              <span style="color: #ff0000;">'ACTIVE'</span>                     ;<br />       COLSIZES <span style="color: #000000;">48</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">55</span>,<span style="color: #000000;">95</span>,<span style="color: #000000;">95</span>,<span style="color: #000000;">140</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">190</span>,<span style="color: #000000;">30</span>  ;<br />       HEADERS <span style="color: #ff0000;">"Vnum"</span>,                     ;<br />               <span style="color: #ff0000;">"Type"</span>,                     ;<br />               <span style="color: #ff0000;">"License"</span>,                  ;<br />               <span style="color: #ff0000;">"Agency"</span>,                   ;<br />               <span style="color: #ff0000;">"Make"</span>,                     ;<br />               <span style="color: #ff0000;">"Model"</span>,                    ;<br />               <span style="color: #ff0000;">"Year"</span>,                     ;<br />               <span style="color: #ff0000;">"Program"</span>,                  ;<br />               <span style="color: #ff0000;">"Mtrpool"</span>,                  ;<br />               <span style="color: #ff0000;">"Location"</span>,                 ;<br />               <span style="color: #ff0000;">"LastServ"</span>,                 ;<br />               <span style="color: #ff0000;">"NextServ"</span>,                 ;<br />               <span style="color: #ff0000;">"NextMilage"</span>,               ;<br />               <span style="color: #ff0000;">"Serial#"</span>,                  ;<br />               <span style="color: #ff0000;">"Act"</span>                       ;<br />       AUTOSORT <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br />       oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       oWnd1:<span style="color: #000000;">oClient</span> := oBrw<br /><br />        oBrw:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">&#123;</span> |nRow,nCol | _VehView<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"V"</span>, oRsVeh <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     *  oBrw:<span style="color: #000000;">bKeyDown</span>   := <span style="color: #000000;">&#123;</span> |nKey| _Manual<span style="color: #000000;">&#40;</span> nKey,oRs <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />     *  oBrw:<span style="color: #000000;">nClrText</span>      := <span style="color: #000000;">&#123;</span> || SelColor<span style="color: #000000;">&#40;</span> oRsVEH:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"readonly"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #ff0000;">"F"</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     *  oBrw:<span style="color: #000000;">nClrPane</span>      := <span style="color: #000000;">&#123;</span> || SelColor<span style="color: #000000;">&#40;</span> oRsVEH:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"readonly"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #ff0000;">"B"</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     *  oBrw:<span style="color: #000000;">nClrForeFocus</span> := <span style="color: #000000;">&#123;</span> || SelColor<span style="color: #000000;">&#40;</span> oRsVEH:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"readonly"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #ff0000;">"F"</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     *  oBrw:<span style="color: #000000;">nClrBackFocus</span> := <span style="color: #000000;">&#123;</span> || SelColor<span style="color: #000000;">&#40;</span> oRsVEH:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"readonly"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #ff0000;">"B"</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWND1 ;<br />         <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .F. <span style="color: #000000;">&#41;</span> ;<br />         <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> IIF<span style="color: #000000;">&#40;</span> !lOK, _VehClose<span style="color: #000000;">&#40;</span>.T., oRsVEH<span style="color: #000000;">&#41;</span>, .F. <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//------------------------------</span><br /><span style="color: #00C800;">Static</span> FUnc SelColor<span style="color: #000000;">&#40;</span> cSTATUS, cTYPE, nTYPE <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> nCOLOR := CLR_BLACK<br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /><span style="color: #00C800;">CASE</span> cTYPE = <span style="color: #ff0000;">'F'</span> .and. nTYPE = <span style="color: #000000;">1</span>       <span style="color: #B900B9;">// foreground</span><br />     <span style="color: #00C800;">IF</span> cSTATUS = <span style="color: #ff0000;">"Y"</span><br />        nCOLOR := CLR_WHITE<br />     <span style="color: #00C800;">ELSE</span><br />        nCOLOR := CLR_BLACK<br />     <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">CASE</span> cTYPE = <span style="color: #ff0000;">'B'</span> .and. nTYPE = <span style="color: #000000;">1</span>       <span style="color: #B900B9;">// background</span><br />     <span style="color: #00C800;">IF</span> cSTATUS = <span style="color: #ff0000;">"Y"</span><br />        nCOLOR := RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">179</span>,<span style="color: #000000;">203</span>,<span style="color: #000000;">204</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">ELSE</span><br />        nCOLOR := CLR_WHITE<br />     <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">CASE</span> cTYPE = <span style="color: #ff0000;">'F'</span> .and. nTYPE = <span style="color: #000000;">2</span>       <span style="color: #B900B9;">// foreground</span><br />     <span style="color: #00C800;">IF</span> cSTATUS = <span style="color: #ff0000;">"Y"</span><br />        nCOLOR := RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//CLR_WHITE</span><br />     <span style="color: #00C800;">ELSE</span><br />        nCOLOR := CLR_BLACK<br />     <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">CASE</span> cTYPE = <span style="color: #ff0000;">'B'</span> .and. nTYPE = <span style="color: #000000;">2</span>       <span style="color: #B900B9;">// background</span><br />     <span style="color: #00C800;">IF</span> cSTATUS = <span style="color: #ff0000;">"Y"</span><br />        nCOLOR := RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">179</span>,<span style="color: #000000;">203</span>,<span style="color: #000000;">204</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">ELSE</span><br />        nCOLOR := rgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">192</span>,<span style="color: #000000;">192</span>,<span style="color: #000000;">192</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//CLR_WHITE</span><br />     <span style="color: #00C800;">ENDIF</span><br /><br /><br /><span style="color: #00C800;">ENDCASE</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> nCOLOR <span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #B900B9;">//----------------------</span><br /><span style="color: #00C800;">Static</span> Func DispType<span style="color: #000000;">&#40;</span> oRsVEH <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> cTYPE := SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /><span style="color: #00C800;">CASE</span> oRsVEH:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"V_TYPE"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> = <span style="color: #ff0000;">"V"</span><br />     cTYPE := <span style="color: #ff0000;">"VEH"</span><br /><span style="color: #00C800;">CASE</span> oRsVEH:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"V_TYPE"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> = <span style="color: #ff0000;">"E"</span><br />     cTYPE := <span style="color: #ff0000;">"EQUIP"</span><br /><span style="color: #00C800;">CASE</span> oRsVEH:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"V_TYPE"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> = <span style="color: #ff0000;">"B"</span><br />     cTYPE := <span style="color: #ff0000;">"BOAT"</span><br /><span style="color: #00C800;">OTHERWISE</span><br />     cTYPE := <span style="color: #ff0000;">"UNK"</span><br /><span style="color: #00C800;">ENDCASE</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> cTYPE <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------</span><br /><span style="color: #00C800;">Static</span> Func DispMemo<span style="color: #000000;">&#40;</span> oRsVEH <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> cMEMO, cMESSAGE<br /><br />cMEMO    := oRsVeh:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"memo"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />cMESSAGE := <span style="color: #ff0000;">"  "</span><br /><br /><span style="color: #00C800;">IF</span> empty<span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span>cMEMO<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ELSE</span><br />   cMESSAGE := <span style="color: #ff0000;">" see memo "</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> cMESSAGE <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:3nhnba9s]
xBrowse and a codeblock column
Mr Rick COLUMNS syntax can be used only if a field exactly by that name ( case insensitive ) exists in the recordset. In your case, I suggest the following alternatives: 1) Use a dummy name instead of the codeblock for the second column and after defining the xbrowse assign the codeblock as oBrw:aCols[ 2 ]:bEditValue := {|x|Disptype( oRs:Fields('Veh"):Value ) } 2) Omit defining the second column totally while initially defining the browse. Later add the second column with this syntax: ADD TO oBrw AT 2 DATA DispType( oRs:Fields('Veh'):Value ) HEADER 'Type', etc... Above statement *inserts* the column at 2nd position. 3) For defining columns with expressions, you can use FIELDS clause instead of COLUMNS clause. If you recollect that is the way earlier WBrowse and TCBrowse are defined with FIELDS clauses. We can also mix COLUMNS and FIELDS clauses in XBrowse, but that is a bit combursome. I personally advise the second method above
xBrowse and a codeblock column
Rao I origionaly used the FIELDS clause but the result was not the 'fields' I defined but each column in the recordset .. not what I had expected .. I went back to the COLUMN expression and that is where I ran the road-block. Let me soak up your suggestion and do some tests .. also, curious about the row colors based on a a specific result in a field .. your thoughts ?? Rick
xBrowse and a codeblock column
[code=fw:cz645sfs]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRsVeh:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'readonly'</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> = <span style="color: #ff0000;">'Y'</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> CLR_WHITE, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">179</span>,<span style="color: #000000;">203</span>,<span style="color: #000000;">204</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />oBrw:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRsVeh:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'readonly'</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> = <span style="color: #ff0000;">'Y'</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">179</span>,<span style="color: #000000;">203</span>,<span style="color: #000000;">204</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">192</span>,<span style="color: #000000;">192</span>,<span style="color: #000000;">192</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:cz645sfs]
xBrowse and a codeblock column
Rao Thank you .. worked great !! Rick
xBrowse and array
Hi all, i have a 4 column xBrowse over an array. 1.) After adding or deleting array elements i want to 'reset' the browse. I am uncertain if i have to do : oBrw:SetArray( aArray ) or oBrw:aArrayData := aArray or both ( if yes, which must be called first ? ) 2.) The xBrowse is set with AUTOCOLS and AUTOSORT. I found out that if i rebuild the array my column headers names change to Col1, Col2 .... and the sort order is wrong. How can i call the browse sort process? Thanks for all assistance. Regards, Detlef
xBrowse and array
In my opinion calling SetArray it's the only necesary thing to do. But it's not 100% true, it's depends of what version are using you. On the last version FWH0812, [quote:6q2y8uov]* Fix: Class TXBrowse Method SetArray() is properly assigning ::aArrayData in those cases that the new assign array has the same structure as the previous used one. [/quote:6q2y8uov] I don't remeber exactly what version have this bug, but I remember I had to change SetArray to direct assign into aArrayData, in the actual version this bug are fixed.
xBrowse and array
Biel, many thanks for your answer. In the meanwhile a made some more tests. I use FWH 8.12. Your are right, it's only necessary to call oBrw:SetArray( aArray ) to change the data source. [b:1y5z3zsn]Except[/b:1y5z3zsn] there is one glitch <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> if the array is of lenght 0 you have to code additionally oBrw:aArrayData := aArray. Otherwise your program will crash. May be Antonio might fix this. Thanks again, Biel, regards, Detlef
xBrowse and bChange
Hello , bChange in xBrowse is executed after a skip , is there a codeblock to use before a skip ? Regards Maurizio
xBrowse and bChange
oBrw:bOnRowLeave.
xBrowse and bChange
Hello Rao , <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> bOnRowLeave dosn't work Regards Maurizio [code=fw:1u3kq7pt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBrw<br /><br />&nbsp; &nbsp;use customer<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">'First'</span>, <span style="color: #ff0000;">'Last'</span>, <span style="color: #ff0000;">'Age'</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CUSTOMER'</span> ;<br />&nbsp; &nbsp; &nbsp; LINES CELL<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"After"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bOnRowLeave</span> := <span style="color: #000000;">&#123;</span>||Msginfo<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Before"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;END<br /><br /><br />&nbsp; oBrw:<span style="color: #000000;">nColDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; oBrw:<span style="color: #000000;">lColDividerComplete</span> := .T.<br />&nbsp; oBrw:<span style="color: #000000;">lRecordSelector</span> &nbsp; &nbsp; := .F. &nbsp; <br />&nbsp; oBrw:<span style="color: #000000;">nStretchCol</span> = STRETCHCOL_LAST<br /><br /><br />&nbsp; oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd &nbsp;<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1u3kq7pt]
xBrowse and bChange
You are right. bOnRowLeave is evaluated only when oBrw:lEdited := .t., i.e., when a cell is edited and row ( or even column is moved ). If you can tell me what you want to do in your application, I might come out with some working suggestion for you.
xBrowse and bChange
Hello Rao , execute a codeblock before making a skip ( :GoDown,:GoUp,:GoTop, ecc.. ) on the record [code=fw:1qc39rbx]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> GoDown<span style="color: #000000;">&#40;</span> nDown <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br />.<br />.<br />.<br />.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> bBefore != <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> bBefore<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nDown<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//Eval( ::bSkip, 1 ) == 1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nRowSel</span> < nLines<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />.<br />.<br />.<br />. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1qc39rbx] Regards Maurizio
xBrowse and bClrStd
Good morning RAO I have an array of colors and would like to apply it to the columns this example works [code=fw:2ju2ejrv]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">local</span> oDlg, oBrw<br />  <span style="color: #00C800;">local</span> aData    := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span> ,<span style="color: #ff0000;">"_111"</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Three"</span>, <span style="color: #ff0000;">"Four"</span>,<span style="color: #ff0000;">"_222"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Five"</span>, <span style="color: #ff0000;">"Six"</span>,<span style="color: #ff0000;">"_333"</span> <span style="color: #000000;">&#125;</span>  <span style="color: #000000;">&#125;</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;">300</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> FWVERSION<br /><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />         DATASOURCE aData <span style="color: #0000ff;">AUTOCOLS</span> ;<br />         CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">bClrStd</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_HGREEN <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_RED<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2ju2ejrv] if I change with array ,it doesn't work [code=fw:2ju2ejrv]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">local</span> oDlg, oBrw<br />  <span style="color: #00C800;">local</span> aData    := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span> ,<span style="color: #ff0000;">"_111"</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Three"</span>, <span style="color: #ff0000;">"Four"</span>,<span style="color: #ff0000;">"_222"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Five"</span>, <span style="color: #ff0000;">"Six"</span>,<span style="color: #ff0000;">"_333"</span> <span style="color: #000000;">&#125;</span>  <span style="color: #000000;">&#125;</span><br /><br />  <span style="color: #00C800;">lOCAL</span> aColor  := <span style="color: #000000;">&#123;</span>CLR_HGREEN , CLR_RED<span style="color: #000000;">&#125;</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;">300</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> FWVERSION<br /><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />         DATASOURCE aData <span style="color: #0000ff;">AUTOCOLS</span> ;<br />         CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">bClrStd</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">2</span><br />          :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK,:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>  <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      <span style="color: #00C800;">NEXT</span> <br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2ju2ejrv] Maurizio
xBrowse and bClrStd
Whatever be the context, you should not use index variable inside a codeblock created inside the loop. This is one fundamental rule we need to keep in mind since the clipper days.
xBrowse and bClrStd
thanks RAO there is workaraund for works with an array of color ? I need to parameterize the colors of the columns . Maurizio
xBrowse and bClrStd
At least, this is an error: [code=fw:3uwx3hzb]<div class="fw" id="{CB}" style="font-family: monospace;">:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK,:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>  <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span></div>[/code:3uwx3hzb] Replace it with this other: [code=fw:3uwx3hzb]<div class="fw" id="{CB}" style="font-family: monospace;">:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK,oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>  <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span></div>[/code:3uwx3hzb] EMG
xBrowse and bClrStd
Sorry Enrico I copied the wrong example, [code=fw:1im4ruf8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #00C800;">local</span> oDlg, oBrw<br />&nbsp; <span style="color: #00C800;">local</span> aData &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span> ,<span style="color: #ff0000;">"_111"</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Three"</span>, <span style="color: #ff0000;">"Four"</span>,<span style="color: #ff0000;">"_222"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Five"</span>, <span style="color: #ff0000;">"Six"</span>,<span style="color: #ff0000;">"_333"</span> <span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; <span style="color: #00C800;">lOCAL</span> aColor &nbsp;:= <span style="color: #000000;">&#123;</span>CLR_HGREEN , CLR_RED<span style="color: #000000;">&#125;</span> ,nColore<br /><br />&nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> FWVERSION<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DATASOURCE aData <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span> &nbsp;:= &nbsp; <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK,aColor<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span> <br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1im4ruf8]
xBrowse and bClrStd
Try this: [code=fw:3aa8rsrm]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #00C800;">local</span> oDlg, oBrw<br />&nbsp; <span style="color: #00C800;">local</span> aData &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span> ,<span style="color: #ff0000;">"_111"</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Three"</span>, <span style="color: #ff0000;">"Four"</span>,<span style="color: #ff0000;">"_222"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Five"</span>, <span style="color: #ff0000;">"Six"</span>,<span style="color: #ff0000;">"_333"</span> <span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; <span style="color: #00C800;">lOCAL</span> aColor &nbsp;:= <span style="color: #000000;">&#123;</span>CLR_HGREEN , CLR_RED<span style="color: #000000;">&#125;</span><br /><br />&nbsp; <span style="color: #00C800;">local</span> n<br /><br />&nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> FWVERSION<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DATASOURCE aData <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span> &nbsp;:= MAKEBLOCK<span style="color: #000000;">&#40;</span> aColor, n <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> MAKEBLOCK<span style="color: #000000;">&#40;</span> aColor, n <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK,aColor<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span></div>[/code:3aa8rsrm] EMG
xBrowse and bClrStd
Grazie Enrico , works as I wanted <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Maurizio
xBrowse and bDragBegin
Hello, following problem occurs when using bDragBegin with xBrowse: 2 Windows using xBrowse are opened, let's say a window with adresses and a window with articles. The window with articles has the focus. Now I click (once) into the window with adresses and the cursor changes to the cursor being used in the event of bDragBegin. It only happens, when enough data are available. And only if the click is a normal, short click. If I keep the button of the mouse down for about a second and then disengage the button, it doesn't happen. It looks to me, as if disengaging the left mouse button isn't being perceived by the system and so the dragging begins without intention of the user. With wBrowse this problem won't occur. For example, this is my code in the window with the adresses: [code=fw:2lmkutwo]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #B900B9;">//** Für Drag & Drop</span><br />   oLB:<span style="color: #000000;">oDragCursor</span> := oCursor        <span style="color: #B900B9;">// Select a Drag cursor</span><br />   oLB:<span style="color: #000000;">bDragBegin</span>  := <span style="color: #000000;">&#123;</span>|nRow, nCol, nKeyFlags| SetDropInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>DROP_ADRESSE,Adressen-><span style="color: #000000;">&#40;</span>RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></div>[/code:2lmkutwo]
xBrowse and bEditWhen
Antonio , bEditWhen dosn't work with nEditType := EDIT_LISTBOX Regards Maurizio
xBrowse and bEditWhen
Fixed in version 12.02. Thanks for pointing out.
xBrowse and bEditWhen
Hello Rao , I tried your fix [code=fw:3nz8kmq0]<div class="fw" id="{CB}" style="font-family: monospace;">elseif oCol:<span style="color: #000000;">nEditType</span> == EDIT_LISTBOX &nbsp; .and. oCol:<span style="color: #000000;">lEditable</span> <br />&nbsp;</div>[/code:3nz8kmq0] I can open the LISTBOX and the selection is not accepted , and it works . I think it would be better to prevent entry into the LISTBOX and do not open the LISTBOX . this is my proposal [code=fw:3nz8kmq0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> ShowBtnList<span style="color: #000000;">&#40;</span> nKey <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn<br /><br />   <span style="color: #00C800;">local</span> aBound<br />   <span style="color: #00C800;">local</span> xValue<br />   <span style="color: #00C800;">local</span> hBrush<br />   <span style="color: #00C800;">local</span> nAt, nRow, nCol, nWidth, nHeight, aColors, oFont<br />  <br />  <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bEditWhen</span> # <span style="color: #00C800;">nil</span> <br />     <span style="color: #00C800;">IF</span> !   Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bEditWhen</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span> <br />     <span style="color: #00C800;">ENDIF</span>  <br />  <span style="color: #00C800;">endif</span></div>[/code:3nz8kmq0] Regards MAurizio
xBrowse and bKeyDown
In the old browse ( in a edit cell ) to have the value of the GET I used oBrw:bKeyDown = { | nKey |msgvalue(oBrw)} Function MsgValue(oBrw) Val := Eval(oBrw:aColumns[1]:bData) msginfo(val) What I can use th have the same value in xBrowse bKeyDown ? Regards Maurizio
xBrowse and bKeyDown
Instead of [code=fw:1vth4xo9]<div class="fw" id="{CB}" style="font-family: monospace;">Val := Eval<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aColumns</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bData</span><span style="color: #000000;">&#41;</span></div>[/code:1vth4xo9] you can use [code=fw:1vth4xo9]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span></div>[/code:1vth4xo9]
xBrowse and bKeyDown
Thank Nage I had already try :Value but it return the value before the input Maurizio
xBrowse and bKeyDown
What do you want to know? Edit buffer of the current Get being edited? In that case you can query the Get object of the column, oCol:oEditGet.
xBrowse and bKeyDown
Nage , I solve with bEditValid , but it doesn't work correctly <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=18422">viewtopic.php?f=3&t=18422</a><!-- l --> Maurizio
xBrowse and bSetUp
Hello NagesWaraRao, would you please show me how to use Report() with a xBrowse of an ARRAY. I would like to hide some columns. I tried like this but with no success. Thanks in advance Otto [code=fw:32ngh3rr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> FILE <span style="color: #ff0000;">".<span style="color: #000000;">\b</span>mpMenu<span style="color: #000000;">\i</span>nfo.bmp"</span> &nbsp;<span style="color: #0000ff;">OF</span> oBar ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> &nbsp;oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'TestReport'</span>, , , &nbsp;<span style="color: #000000;">&#123;</span> |oRep, oBrw| MySetUp<span style="color: #000000;">&#40;</span> oRep, oBrw<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Info"</span> +CRLF + <span style="color: #ff0000;">"Druck"</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MySetUp<span style="color: #000000;">&#40;</span> oRep, oBrw<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> = .t.<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> = .t.<br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> = .t.<br />&nbsp; <span style="color: #00C800;">return</span> .t.<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />&nbsp;</div>[/code:32ngh3rr]
xBrowse and bSetUp
Alternative-1: [code=fw:1vksd0s8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> ...... <span style="color: #0000ff;">action</span> MyReport<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br />...<br />...<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MyReport<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> := .t.<br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> := .t.<br />   oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'Title'</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> := .f.<br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> := .f.<br />   oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1vksd0s8] This is simpler. But can occasionally show up the browse with columns hidden before the printing is finished. This works well when preview is used. Alternative - 2 is to define all your own report columns in the setup block and return .t.. When the bSetUp returns .t., the xbrowse does not add any columns by itself.
xBrowse and bSetUp
Hello Mr. NagegesWaraRao, thank you for your help. I tested alternative 1. It is working well. What I did not found out is if I could also change the width? oLbx:aCols[3]:nWidth := 20 This is not working for me. Maybe you have some more code how to use the alterantive 2. I am not clear how to use bSetUp. Thanks for taking time. Best regards, Otto
xBrowse and bSetUp
XBrowse widths are in screen pixels. Report column sizes are in number of characters. Chaning browse column size has no effect on the report column sizes. Actually xbrowse report method's bSetUp block is called twice ( from version 9.03 onwards ). First time it is called before creation of report columns. If the bsetup returns 2, it is called again after the columns are created. At that time, we can change the attributes of the report columns. [code=fw:2z5ol3b3]<div class="fw" id="{CB}" style="font-family: monospace;"><br />.... <span style="color: #0000ff;">action</span> oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> cTitle ....... <span style="color: #000000;">&#123;</span> | oRep, oBrw, n| RepSetUp<span style="color: #000000;">&#40;</span> oRep, oBrw, n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />....<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> RepSetUp<span style="color: #000000;">&#40;</span> oRep, oBrw, n <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> n == <span style="color: #000000;">1</span> &nbsp; <span style="color: #B900B9;">// called first time</span><br />      <span style="color: #00C800;">return</span> <span style="color: #000000;">2</span> &nbsp; <span style="color: #B900B9;">// by returning 2, we are asking for a second call</span><br />   <span style="color: #00C800;">else</span> &nbsp; <span style="color: #B900B9;">// called second time after report columns are created</span><br />      oRep:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nSize</span> := <span style="color: #000000;">20</span>   <span style="color: #B900B9;">// number of characters</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /> </div>[/code:2z5ol3b3]
xBrowse and bSetUp
Hello Mr. NagegesWaraRao, thank you for your help. I will try. Best regards, Otto