topic
stringlengths
1
63
text
stringlengths
1
577k
xBrowse new line for DBF ...
Hi Rimintas, Again a database object is going to be a good answer. It is automatically buffered. However, it is difficult to do spreadsheet style editing with cell level validation and control. Also, how does one trigger the save? On a cell by cell basis or only when they are done with the entire record? And how is the implimented in the interface, i.e. how does the user know how it works? For these reasons I rarely use in-browse editing. It is much easier to edit a record using a popup dialog when the record is double-clicked. I am attaching a sample program that does cell by cell editing using a database object. Each cell's edit is saved by the user pressing the Return key (most users won't like this since it does not work like a standard spreadsheet). With some work you may be able to adapt it to your desires. I did not write the code, nor do I know who the author is. James Bott [code=fw:27f6nz81]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />Purpose: XBrowse example with spreadsheet style editing<br />Note &nbsp; : Any alpha-numeric key triggers the edit, and up and down arrows exit the edit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Tested with FWH 8.08<br /><br />Update: If you use lFastEdit, then exiting with the Return key doesn't work anymore.<br />*/</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"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, oDbf, oBrw, oCol<br /><br />&nbsp; &nbsp;USE Customer<br />&nbsp; &nbsp;DATABASE oDbf<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 <span style="color: #0000ff;">OF</span> oWnd OBJECT oDbf<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lFastEdit</span>:=.t. &nbsp;<span style="color: #B900B9;">// any alpha-numeric key triggers the edit</span><br /><br />&nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #ff0000;">"First"</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #000000;">&#123;</span> || oDbf:<span style="color: #000000;">First</span> <span style="color: #000000;">&#125;</span><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;">nEditType</span> &nbsp; = EDIT_GET<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;">bOnPostEdit</span> = <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">First</span> := xVal, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>oDBF:<span style="color: #000000;">First</span>:= xVal, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #ff0000;">"Last"</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #000000;">&#123;</span> || oDbf:<span style="color: #000000;">Last</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span> &nbsp; = EDIT_GET<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">Last</span> := xVal, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>oDBF:<span style="color: #000000;">First</span>:= xVal, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &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<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:27f6nz81]
xBrowse new line for DBF ...
[quote="James Bott":1jzh1v8q]Hi Rimintas, Again a database object is going to be a good answer. It is automatically buffered. However, it is difficult to do spreadsheet style editing with cell level validation and control. Also, how does one trigger the save? On a cell by cell basis or only when they are done with the entire record? And how is the implimented in the interface, i.e. how does the user know how it works? For these reasons I rarely use in-browse editing. It is much easier to edit a record using a popup dialog when the record is double-clicked. I am attaching a sample program that does cell by cell editing using a database object. Each cell's edit is saved by the user pressing the Return key (most users won't like this since it does not work like a standard spreadsheet). With some work you may be able to adapt it to your desires. I did not write the code, nor do I know who the author is. James Bott [code=fw:1jzh1v8q]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />&nbsp; <br />Purpose: XBrowse example with spreadsheet style editing<br />Note   : Any alpha-numeric key triggers the edit, and up and down arrows exit the edit<br />         Tested with FWH 8.08<br /><br />Update: If you use lFastEdit, then exiting with the Return key doesn't work anymore.<br />*/</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"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> oWnd, oDbf, oBrw, oCol<br /><br />   USE Customer<br />   DATABASE oDbf<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br />   @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd OBJECT oDbf<br /><br />   oBrw:<span style="color: #000000;">lFastEdit</span>:=.t.  <span style="color: #B900B9;">// any alpha-numeric key triggers the edit</span><br /><br />   oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">cHeader</span>                = <span style="color: #ff0000;">"First"</span><br />   oCol:<span style="color: #000000;">bStrData</span>               = <span style="color: #000000;">&#123;</span> || oDbf:<span style="color: #000000;">First</span> <span style="color: #000000;">&#125;</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;">nEditType</span>   = EDIT_GET<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;">bOnPostEdit</span> = <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">First</span> := xVal, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>oDBF:<span style="color: #000000;">First</span>:= xVal, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">cHeader</span>                = <span style="color: #ff0000;">"Last"</span><br />   oCol:<span style="color: #000000;">bStrData</span>               = <span style="color: #000000;">&#123;</span> || oDbf:<span style="color: #000000;">Last</span> <span style="color: #000000;">&#125;</span><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span>   = EDIT_GET<br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">Last</span> := xVal, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>oDBF:<span style="color: #000000;">First</span>:= xVal, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   oWnd:<span style="color: #000000;">oClient</span> = oBrw<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1jzh1v8q][/quote:1jzh1v8q] Hi James , Thanks for the answer . I was working with an old Hernan TwBrowse . At this time I begin a new project and want to do all with xBrowse . With Hernan's browse I was using dialogs for a new records input . But that isn't comfortable . xBrowse is very poverfull thing and , in mine opinion , better avoid such solutions like dialog for inputs . It's very easy to do validation for a new record - lets say that xBrowse class extends with some features - lNewRecord - logical ( or bMarkNew for sample ) and bValidNewRecord - codeblock . So adding a new record we can mark that with lNewRecord and let to stay here until to press button "Save" or keystroke "Ctr-S" and then validate - it's OK with a new record or not ? That isn't dicifult to do . In mine opinion all management can be done with xBrowse ... I reviewed TDatabase class . It seems that this is a solution . Here is aBuffer and I can manage that . It seems that leaves to solve problem , how to fill related data for others alias in xBrowse ... Regards !
xBrowse new line for DBF ...
Rimintas, [quote:edsz481m]It's very easy to do validation for a new record - lets say that xBrowse class extends with some features - lNewRecord - logical ( or bMarkNew for sample ) and bValidNewRecord - codeblock . So adding a new record we can mark that with lNewRecord and let to stay here until to press button "Save" or keystroke "Ctr-S" and then validate - it's OK with a new record or not ? That isn't dicifult to do . In mine opinion all management can be done with xBrowse ...[/quote:edsz481m] You still have the design issues that I mentioned. Plus you have to add a new record to the DBF before you can edit it. Then if the user doesn't want it, then you have to delete it. This gets messy--you end up with a bunch of deleted records. Also it gets very complex validating and each cell--you can't use bounded controls like radios etc. I'm not saying it is not possible, it is just not easy to implement and I have not found a compelling reason to do so. I think you can do what you want with lNewRecord and bValidateNewRecord by putting them in a subclass of TDatabase. You can add a new Save() method something like: [code=fw:edsz481m]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Method</span> Save<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> MyData<br />&nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lNewRecord</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bValidateNewRecord</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">super</span>:<span style="color: #000000;">save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:edsz481m] Regards, James
xBrowse new line for DBF ...
[quote="James Bott":14wzskk3]Rimintas, You still have the design issues that I mentioned. Plus you have to add a new record to the DBF before you can edit it. Then if the user doesn't want it, then you have to delete it. This gets messy--you end up with a bunch of deleted records. Also it gets very complex validating and each cell--you can't use bounded controls like radios etc. I'm not saying it is not possible, it is just not easy to implement and I have not found a compelling reason to do so. I think you can do what you want with lNewRecord and bValidateNewRecord by putting them in a subclass of TDatabase. You can add a new Save() method something like: [code=fw:14wzskk3]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Method</span> Save<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> MyData<br />    <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lNewRecord</span><br />        <span style="color: #00C800;">if</span> eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bValidateNewRecord</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">super</span>:<span style="color: #000000;">save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">endif</span><br />    <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:14wzskk3] Regards, James[/quote:14wzskk3] James , I agree with you , with natural DBF it's complicated to do what I want . I mentioned that if user will refuse for new record , then it must be deleted and that is not a way . So I asked this question - maybe exist other solutions ? You directed me to a true way - now I'm trying TDatabase class and it seems that this will do the job ! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Alreday tried something and can to say , that extends aren't needful - with alreday existing codeblocks of column object we can do all . Simply in edits and postedit codeblock it's needful to direct it's buffer or not . So it's all right ! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> With best regards !
xBrowse new looks
Hello, Is it posible to create an example that shows latest xBrowse new look/styles? Thank you.
xBrowse new looks
what's mean
xBrowse new looks
Hi, This code does not change the look: [code=fw:66rcmdbg]<div class="fw" id="{CB}" style="font-family: monospace;"> WITH OBJECT oBrowse<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStretchCol</span> &nbsp; &nbsp; &nbsp;:= STRETCHCOL_WIDEST<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">SetStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2018</span> <span style="color: #000000;">&#41;</span><br /><br />END</div>[/code:66rcmdbg] Thank you.
xBrowse new looks
here make it [img:pv2d0dq7]https&#58;//i&#46;postimg&#46;cc/3NsNwdgZ/here&#46;png[/img:pv2d0dq7] only recordsel is not with style If I press on header it is colorized with green color
xBrowse new looks
Hi, Don´t see changes. Thanks
xBrowse new looks
on header, on footer... [size=150:3gxr139e][b:3gxr139e]2007[/b:3gxr139e][/size:3gxr139e] [img:3gxr139e]https&#58;//i&#46;postimg&#46;cc/qB1PHVW6/2007&#46;png[/img:3gxr139e] [size=150:3gxr139e][b:3gxr139e]2010[/b:3gxr139e][/size:3gxr139e] [img:3gxr139e]https&#58;//i&#46;postimg&#46;cc/D0VQGzMY/2010&#46;png[/img:3gxr139e] [size=150:3gxr139e][b:3gxr139e]2013[/b:3gxr139e][/size:3gxr139e] [img:3gxr139e]https&#58;//i&#46;postimg&#46;cc/WzjBnsDX/2013&#46;png[/img:3gxr139e] [size=150:3gxr139e][b:3gxr139e]2015[/b:3gxr139e][/size:3gxr139e] [img:3gxr139e]https&#58;//i&#46;postimg&#46;cc/WbKVkFm7/2015&#46;png[/img:3gxr139e] [size=150:3gxr139e][b:3gxr139e]2018[/b:3gxr139e][/size:3gxr139e] [img:3gxr139e]https&#58;//i&#46;postimg&#46;cc/L55zG0bL/2018&#46;png[/img:3gxr139e] [size=150:3gxr139e][b:3gxr139e]2019[/b:3gxr139e][/size:3gxr139e] [size=150:3gxr139e][b:3gxr139e]FUTURE[/b:3gxr139e][/size:3gxr139e]
xBrowse new looks
[quote="Silvio.Falconi":w1ana5yw]on header, on footer... [size=150:w1ana5yw][b:w1ana5yw]FUTURE[/b:w1ana5yw][/size:w1ana5yw][/quote:w1ana5yw] these Color come from Theme which you get when use XP Manifest. they have change with every Windows Version so next Version might ... Darkmode <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) --> now with Windows 10 Darkmode you also can use Classic Style which make not much Difference in Darkmode. the Difference without XP Manifest is that you also have no visual Effect like "hover" Color. --- you can change Theme Color for 30 Parts of Control with SetSysColors() [url:w1ana5yw]https&#58;//docs&#46;microsoft&#46;com/en-us/windows/win32/api/winuser/nf-winuser-setsyscolors[/url:w1ana5yw] but it will "work" an All App as long as you login. re-login will use default Value from [code=fw:w1ana5yw]<div class="fw" id="{CB}" style="font-family: monospace;">HKEY_CURRENT_USER\Control Panel\Colors</div>[/code:w1ana5yw] so if you want you can force all Apps look like your App <!-- s:idea: --><img src="{SMILIES_PATH}/icon_idea.gif" alt=":idea:" title="Idea" /><!-- s:idea: -->
xBrowse no ajusta al limite derecho del browse
Hola buenas tardes a todos, tengo el siguiente problema con xBrowse, no me ajusta las columnas al limite derecho del browse hasta completar toda la pantalla ya sea utilizando cualquiera de las dos opciones, deje una imagen para que la vean [code=fw:17tc2bgy]<div class="fw" id="{CB}" style="font-family: monospace;">                 oBrw:<span style="color: #000000;">nStretchCol</span>         := STRETCHCOL_LAST<br /><br />                 oBrw:<span style="color: #000000;">nStretchCol</span>         := STRETCHCOL_WIDEST <br /> </div>[/code:17tc2bgy] [img] <!-- m --><a class="postlink" href="https://ibb.co/dqvKRc">https://ibb.co/dqvKRc</a><!-- m --> [/img] February 2018
xBrowse no ajusta al limite derecho del browse
Saludos, eso viene sucediendo desde hace mucho, hay que ajustar las columnas al ancho del xbrowse, que no deberia de ser, pero bueno...gracias... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
xBrowse no ajusta al limite derecho del browse
nStretchCol works from version 8.12 onwards.
xBrowse no ajusta al limite derecho del browse
[quote="nageswaragunupudi":q9d605p4]nStretchCol works from version 8.12 onwards.[/quote:q9d605p4] from version 8.12...? saludos...gracias... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
xBrowse no muestra bitmaps desde recurso
Hola. Tengo una serie de bitmaps en un archivo .rc y xbrowse no me los muestra. Los defino de la siguiente manera: local aBitmaps[5] aBitmaps[ 1 ] := LoadBitMap( GetResources(), "ON") aBitmaps[ 2 ] := LoadBitMap( GetResources(), "OFF") aBitmaps[ 3 ] := LoadBitMap( GetResources(), "CHECK2") aBitmaps[ 4 ] := LoadBitMap( GetResources(), "MARCADO") aBitmaps[ 5 ] := LoadBitMap( GetResources(), "NARANJA") ADD COLUMN TO oBrw HEADER "Ag" WIDTH 30 BITMAP DATA EVAL( {|| if( ( fCabecond)->CONDAGEN, aBitmaps[5], NIL) }) ADD COLUMN TO oBrw NOBAR BITMAP HEADER "Marc" WIDTH 30 DATA EVAL( {|| if( ( fCabecond)->SELECTED, aBitmaps[ 4 ], NIL) }) ADD COLUMN TO oBrw NOBAR BITMAP HEADER "OK" WIDTH 25 DATA EVAL( {|| if( ConduceCorrecto(), aBitmaps[ 1 ], aBitmaps[ 2 ]) }) ¿Alguna pista? Gracias y un saludo, Fernando Morales
xBrowse no muestra bitmaps desde recurso
Please try: [code=fw:2f4v1tj8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*<br />local aBitmaps[5]<br />aBitmaps[ 1 ] := LoadBitMap( GetResources(), "ON")<br />aBitmaps[ 2 ] := LoadBitMap( GetResources(), "OFF")<br />aBitmaps[ 3 ] := LoadBitMap( GetResources(), "CHECK2")<br />aBitmaps[ 4 ] := LoadBitMap( GetResources(), "MARCADO")<br />aBitmaps[ 5 ] := LoadBitMap( GetResources(), "NARANJA")<br />*/</span><br /><br /><br />ADD COLUMN <span style="color: #0000ff;">TO</span> oBrw HEADER <span style="color: #ff0000;">"Ag"</span> WIDTH <span style="color: #000000;">30</span> ;<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>fCabecond<span style="color: #000000;">&#41;</span>->CONDAGEN, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> BITMAP IN <span style="color: #ff0000;">'NARANJA'</span><br /><br />ADD COLUMN <span style="color: #0000ff;">TO</span> oBrw NOBAR HEADER <span style="color: #ff0000;">"Marc"</span> WIDTH <span style="color: #000000;">30</span> ;<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> fCabecond<span style="color: #000000;">&#41;</span>->SELECTED, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> BITMAP IN <span style="color: #ff0000;">'MARCADO'</span> <br /><br />ADD COLUMN <span style="color: #0000ff;">TO</span> oBrw NOBAR HEADER <span style="color: #ff0000;">"OK"</span> WIDTH <span style="color: #000000;">25</span> ;<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ConduceCorrecto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> BITMAP IN <span style="color: #ff0000;">'ON'</span>, <span style="color: #ff0000;">'OFF'</span><br />&nbsp;</div>[/code:2f4v1tj8]
xBrowse no muestra bitmaps desde recurso
Thank you very much for your help. It works fine! Regards Fernando Morales
xBrowse no refresca correctamente con índice condicional.
Hola. Tengo un xBrowse con registros cuyo índice es condicional: for ! empty(FECHA). Bien, se supone que si modifico el campo FECHA y ya no está vacio, despues de hacer oBrw:Refresh() debería desaparecer, pero no, sigue en la rejilla, salvo que haga click en ella y entonces si desaparece. La solución la he encontrado haciendo un oBrw:Skip(-1) antes del oBrw:Refresh(), entonces sí refresca correctamente, pero creo que no debería ser así ¿cierto? Nota: después de modificar FECHA hago dbCommit().
xBrowse no refresca correctamente con índice condicional.
que tal Fernando simplemente pon oBrw:refresh(.t.) obliga a repintar todo.... saludos
xBrowse no salta a la siguiente línea con MOVE_FAST_RIGHT
SI no hay más columnas editables después de la que se edita (porque lo impiden los :bEditWhen), xBrowse no salta a la siguiente línea con MOVE_FAST_RIGHT, como lo hace desde la última columna cuando es editable. Solución: En el METHOD GoNextCtrl(hWnd) CLASS TXBrowse [code=fw:16mgo6a0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />     <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lFastEdit</span><br /><br />          <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br />             <span style="color: #00C800;">CASE</span> ::<span style="color: #000000;">nMoveType</span> == MOVE_FAST_RIGHT<br />                  <span style="color: #B900B9;">// This is the standard default post cursor movement behavior in Fast Edit Mode</span><br />                  nNextPos    := <span style="color: #000000;">0</span><br />                  <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nColSel</span> < Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDisplay</span> <span style="color: #000000;">&#41;</span><br />                     <span style="color: #B900B9;">//nNextPos := AScan( ::aDisplay, { |i| ::aCols[ i ]:nEditType > 0 }, ::nColSel + 1 ) // comentar</span><br />                     nNextPos := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDisplay</span>, <span style="color: #000000;">&#123;</span> |i| ::<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lEditable</span>  <span style="color: #000000;">&#125;</span>, ::<span style="color: #000000;">nColSel</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>           <span style="color: #B900B9;">// agregar</span><br />                  <span style="color: #00C800;">endif</span><br />                  <br /> </div>[/code:16mgo6a0] Saludos.
xBrowse no salta a la siguiente línea con MOVE_FAST_RIGHT
Thanks for the suggestion. Implemented in FWH 10.10
xBrowse no se ajusta al ancho del Browse
Hola buenos días, les explico lo que me pasa. Tengo un xBrowse dentro de un Folder y el Folder esta dentro un Layout, explico esto porque tengo un xBrowse dentro de un Layout solamente y se ajusta al ancho y en este caso que les explico no. [code=fw:34vpwj47]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nStretchCol</span>:=STRETCHCOL_WIDEST</div>[/code:34vpwj47] Cuando ensancho con el mouse una de las columnas ahi si se ajusta. Espero haberme explicado y ver si alguien puede decirme si hay algo especial que hacer cuando el browse esta contenido dentro de un folder Saludos Marcelo
xBrowse no se pinta
Hola Algunos de Uds. no le ha pasado que tratando de usar xBrowse y no hay ningun registro no se pinta.. <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Alguien ha solucionado esto, si es asi me podrian pasar la solución, de antemano muchas gracias.. <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> Saludos Marco A. Delgado.
xBrowse not display the contents of the column
Hi FiveWinners. PRIVATE aMOVTOS:={" ","FALTA","PERMISO","ASISTENCIA","RETARDO","DESCANSO","ENFERMEDAD","MATERNIDAD","LABORIESGO","INCAXAT","VACACION","TXTIEMPO"} ADD COLUMN oComb TO oBrw DATA (cNAlias)->NA_TIPMOV ; HEADER "Movimiento" ; SIZE 120 EDITABLE oComb:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( NW_REPLACE("NA_TIPMOV", v, .F., cNAlias ) ), ) } WITH OBJECT oBrw:Movimiento :nEditType := EDIT_LISTBOX :aEditListTxt := ArrTranspose( aMOVTOS ) [ 1 ] :aEditListBound := ArrTranspose( aMOVTOS ) [ 1 ] END This code allows me to show a combobox column , but when I select a value from the list , this is not displayed in the column, however, replacing the data in table is correct. As I show the data in the column? Thank You
xBrowse not display the contents of the column
[code=fw:36kieuz9]<div class="fw" id="{CB}" style="font-family: monospace;">WITH OBJECT oBrw:<span style="color: #000000;">Movimiento</span><br />&nbsp; &nbsp;:<span style="color: #000000;">nEditType</span> := EDIT_LISTBOX<br />&nbsp; &nbsp;:<span style="color: #000000;">aEditListTxt</span> := aMOVTOS<br />END<br />&nbsp;</div>[/code:36kieuz9]
xBrowse not display the contents of the column
Hello Mr. Nages could you give me your email ? Thank You
xBrowse not display the contents of the column
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
xBrowse not showing at all with MinGw and Harbour
I am triing to program a browse using xBrowse without success. The window shows up empty with no messages at all. I was unable to figure out what am I doing wrong... I am using FiveWin with MinGw and Harbour. I made a small self contained sample of what I am coding. Could someone inspect the code above and point what's wrong ? [code=fw:lxs2lfva]<div class="fw" id="{CB}" style="font-family: monospace;"><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: #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 />   DBCREATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"BTESTE.DBF"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CODIGO"</span>    , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">08</span>, <span style="color: #000000;">00</span> <span style="color: #000000;">&#125;</span>,;<br />                             <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DESCRICAO"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   USE BTESTE.DBF EXCLUSIVE <span style="color: #0000ff;">ALIAS</span> BTESTE<br /><br />   <span style="color: #00C800;">FOR</span> I:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span><br />     BTESTE-><span style="color: #000000;">&#40;</span> DBAPPEND<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     BTESTE->CODIGO     := STRZERO<span style="color: #000000;">&#40;</span>I,<span style="color: #000000;">8</span><span style="color: #000000;">&#41;</span><br />     BTESTE->DESCRICAO  := REPLICATE<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"X"</span>,<span style="color: #00C800;">MOD</span><span style="color: #000000;">&#40;</span>I,<span style="color: #000000;">39</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">+1</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">NEXT</span><br /><br />   BTESTE -> <span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   oDLG := TWINDOW<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">NEW</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">100</span> ,<span style="color: #ff0000;">"xBrowse Test"</span> <span style="color: #000000;">&#41;</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;">ALIAS</span> <span style="color: #ff0000;">"BTESTE"</span> <span style="color: #0000ff;">OF</span> oDLG<br /><br />   ADD COLUMN <span style="color: #0000ff;">TO</span> oBRW <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CODIGO"</span>    <span style="color: #00C800;">DATA</span> BTESTE->CODIGO    <span style="color: #0000ff;">SIZE</span>  <span style="color: #000000;">80</span><br />   ADD COLUMN <span style="color: #0000ff;">TO</span> oBRW <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DESCRICAO"</span> <span style="color: #00C800;">DATA</span> BTESTE->DESCRICAO <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">320</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oDLG<br /><br />   CLOSE DATABASES<br /><br /><span style="color: #00C800;">RETURN</span></div>[/code:lxs2lfva]
xBrowse not showing at all with MinGw and Harbour
You missed the code <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> [code=fw:31eqcx4v]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:31eqcx4v] [code=fw:31eqcx4v]<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 /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   DBCREATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"BTESTE.DBF"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CODIGO"</span>    , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">08</span>, <span style="color: #000000;">00</span> <span style="color: #000000;">&#125;</span>,;<br />                             <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DESCRICAO"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   USE BTESTE.DBF EXCLUSIVE <span style="color: #0000ff;">ALIAS</span> BTESTE<br /><br />   <span style="color: #00C800;">FOR</span> I:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span><br />     BTESTE-><span style="color: #000000;">&#40;</span> DBAPPEND<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     BTESTE->CODIGO     := STRZERO<span style="color: #000000;">&#40;</span>I,<span style="color: #000000;">8</span><span style="color: #000000;">&#41;</span><br />     BTESTE->DESCRICAO  := REPLICATE<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"X"</span>,<span style="color: #00C800;">MOD</span><span style="color: #000000;">&#40;</span>I,<span style="color: #000000;">39</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">+1</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">NEXT</span><br /><br />   BTESTE -> <span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   oDLG := TWINDOW<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">NEW</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">100</span> ,<span style="color: #ff0000;">"xBrowse Test"</span> <span style="color: #000000;">&#41;</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;">ALIAS</span> <span style="color: #ff0000;">"BTESTE"</span> <span style="color: #0000ff;">OF</span> oDLG <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><br /><br />   ADD COLUMN <span style="color: #0000ff;">TO</span> oBRW <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CODIGO"</span>    <span style="color: #00C800;">DATA</span> BTESTE->CODIGO    <span style="color: #0000ff;">SIZE</span>  <span style="color: #000000;">80</span><br />   ADD COLUMN <span style="color: #0000ff;">TO</span> oBRW <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DESCRICAO"</span> <span style="color: #00C800;">DATA</span> BTESTE->DESCRICAO <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">320</span><br />   <br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oDLG<br /><br />   CLOSE DATABASES<br /><br /><span style="color: #00C800;">RETURN</span></div>[/code:31eqcx4v] Regards Anser
xBrowse not showing at all with MinGw and Harbour
Very thanks Anser ! Thats it.
xBrowse numeric formats ( To: G.N.Rao )
Linares, Is there any parameter to reset all the numeric formats xBrowse for Brazilian (999,999.99) standard? If so this parameter also changes the format of the exported to Excel numbers?
xBrowse numeric formats ( To: G.N.Rao )
XBrowse (and FWH in general) support 3 kinds of numeric formats, which can be automatically reset during execution, if we do not hard-code numeric formats in our xbrowse program. A. American format used by most countries "999,999,999.99" E. European format "999.999.999,99", widely used in Europe I. Indian forat: "99,99,999.99" used in Indian sub-continent. To set / change the format, call the function: FWNumFormat( cInternational, ; // 'A' or 'E' .or. 'I" lUseThousandSep ) It is desirable to set the format at the beginning of the program Example: FWNumFormat( 'A', .t. ) XBrowse automatically builds picture clause of Numeric data on the basis of this specification, appropriate the Field Length and Field Decimals, if "we do not" provide hard-coded formats.
xBrowse numeric formats ( To: G.N.Rao )
Thanks Rao, I used FwNumFormat ('E',. T.) and, in fact, the numbers in xBrowse already were properly disposed. However, when exporting to Excel does not recognize the formatting. Example: Number [12,1234] (two integers and four decimal) exported [121.234,0000] (six integers and four decimal) to excel.
xBrowse numeric formats ( To: G.N.Rao )
No one is having this same problem when exporting numbers in European format to Excel? Please, see this example: [code=fw:y0ikqkex]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oWnd, oBar, oBrw, nTotal:=<span style="color: #000000;">0</span><br />   <span style="color: #B900B9;">/*<br />   A. American format: "999,999,999.99"<br />   E. European format: "999.999.999,99"<br />   I. Indian   format: "99,99,999.99"<br />   */</span><br />   FwNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'E'</span>, .T. <span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// European Format</span><br />   DBCREATE<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TESTXLS"</span>,<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"DESC   "</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">010</span>,<span style="color: #000000;">000</span><span style="color: #000000;">&#125;</span>,;<br />                       <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"VAL1   "</span>,<span style="color: #ff0000;">"N"</span>,<span style="color: #000000;">010</span>,<span style="color: #000000;">001</span><span style="color: #000000;">&#125;</span>,;<br />                       <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"VAL2   "</span>,<span style="color: #ff0000;">"N"</span>,<span style="color: #000000;">010</span>,<span style="color: #000000;">002</span><span style="color: #000000;">&#125;</span>,;<br />                       <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"VAL3   "</span>,<span style="color: #ff0000;">"N"</span>,<span style="color: #000000;">010</span>,<span style="color: #000000;">003</span><span style="color: #000000;">&#125;</span>,;<br />                       <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"VAL4   "</span>,<span style="color: #ff0000;">"N"</span>,<span style="color: #000000;">010</span>,<span style="color: #000000;">004</span><span style="color: #000000;">&#125;</span>,;<br />                       <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"VAL5   "</span>,<span style="color: #ff0000;">"N"</span>,<span style="color: #000000;">010</span>,<span style="color: #000000;">005</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />   USE TESTXLS <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> TESTXLS<br />   <span style="color: #00C800;">FOR</span> nTotal=<span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> <span style="color: #000000;">20</span><br />      APPEND BLANK<br />      REPL <span style="color: #0000ff;">DESC</span> WITH <span style="color: #ff0000;">"Linha "</span>+STRZERO<span style="color: #000000;">&#40;</span>nTotal,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />      REPL VAL1 WITH <span style="color: #000000;">99999</span> * nTotal / <span style="color: #000000;">777</span><br />      REPL VAL2 WITH <span style="color: #000000;">99999</span> * nTotal / <span style="color: #000000;">777</span><br />      REPL VAL3 WITH <span style="color: #000000;">99999</span> * nTotal / <span style="color: #000000;">777</span><br />      REPL VAL4 WITH <span style="color: #000000;">99999</span> * nTotal / <span style="color: #000000;">777</span><br />      REPL VAL5 WITH <span style="color: #000000;">99999</span> * nTotal / <span style="color: #000000;">777</span><br />   <span style="color: #00C800;">NEXT</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ownd<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">32</span> <span style="color: #000000;">2007</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">'Excel'</span> ;<br />          <span style="color: #0000ff;">ACTION</span> MsgMeter<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> |oMeter, oText, oDlg, lEnd | ;<br />          Export2Excel<span style="color: #000000;">&#40;</span> oBrw, oMeter, oText, oDlg, @lEnd <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">'Quit'</span>  <span style="color: #0000ff;">ACTION</span> WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">2007</span><br /><br />   @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'TESTXLS'</span> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES<br /><br />   <span style="color: #B900B9;">// Realmente nao funciona quando exporto para o Broffice/Excel</span><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">&#123;</span>|| TRANSFORM<span style="color: #000000;">&#40;</span>Field->VAL1, <span style="color: #ff0000;">"@E 9.999.999,99"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">&#123;</span>|| TRANSFORM<span style="color: #000000;">&#40;</span>Field->VAL2, <span style="color: #ff0000;">"@E 9.999.999,99"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">&#123;</span>|| TRANSFORM<span style="color: #000000;">&#40;</span>Field->VAL3, <span style="color: #ff0000;">"@E 9.999.999,99"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><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;">bFooter</span> = <span style="color: #000000;">&#123;</span>|| TRANSFORM<span style="color: #000000;">&#40;</span>Field->VAL4, <span style="color: #ff0000;">"@E 9.999.999,99"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   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;">bFooter</span> = <span style="color: #000000;">&#123;</span>|| TRANSFORM<span style="color: #000000;">&#40;</span>Field->VAL5, <span style="color: #ff0000;">"@E 9.999.999,99"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   oWnd:<span style="color: #000000;">oClient</span>      := oBrw<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><br />   CLOSE <span style="color: #00C800;">DATA</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Export2Excel<span style="color: #000000;">&#40;</span> oBrw, oMeter, oText, oDlg, lEnd <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">ToExcel</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> |n,t| oMeter:<span style="color: #000000;">nTotal</span> := t, ;<br />                         oMeter:<span style="color: #000000;">Set</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span>, ;<br />                         oText:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span>n<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'/'</span> + Str<span style="color: #000000;">&#40;</span>t<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />                         oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /> </div>[/code:y0ikqkex]
xBrowse numeric formats ( To: G.N.Rao )
[url:apirklz1]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=29499[/url:apirklz1]
xBrowse oBrw:ToExcel method doesn't runs with Excel 97
Hi all, a customer reported me this error that appairs using the oBrw:ToExcel() method in xbrowse. It seem to be related to the ole object languagesettings, perhaps it doesn't exist in Excel 97. Any solution ? Thanks in advance Marco Application =========== Path and name: C:\pigc\pigc.exe (32 bits) Size: 8,111,920 bytes Time from start: 1 hours 6 mins 15 secs Error occurred at: 12/06/09, 06:33:20 Error description: Error Excel.Application/0 S_OK: LANGUAGESETTINGS Args: Stack Calls =========== Called from: source\rtl\win32ole.prg => TOLEAUTO:LANGUAGESETTINGS(0) Called from: K:\pigc\ADDON32\UPDATED2\XBROWSE.PRG => SETEXCELLANGUAGE(6258) Called from: K:\pigc\ADDON32\UPDATED2\XBROWSE.PRG => TXBROWSE:TOEXCEL(5175)
xBrowse oBrw:ToExcel method doesn't runs with Excel 97
Marco, We did not test it with Excel97. We shall try to release a version with appropriate switch to suit excel97
xBrowse oBw:ToExcel()
To escape from error if ListSeparator is changed on the PC i use this function GetListSeparator() in xBrowse class cFormula:= "SUBTOTAL(" + ; LTrim( Str( FW_DeCode( IfNil( oCol:nFooterType, 0 ), AGGR_SUM, 9, AGGR_MAX, 4, AGGR_MIN, 5, ; AGGR_COUNT, 3, AGGR_AVG, 1, AGGR_STDEV, 7, AGGR_STDEVP, 8, 9 ) ) ) + ; [b:2btrxe4n]// "," + ;[/b:2btrxe4n] [b:2btrxe4n]GetListSeparator() + ;[/b:2btrxe4n] oSheet:Range( oSheet:Cells( 2, nCol ), ; oSheet:Cells( nRow - 1, nCol ) ):Address( .f., .f. ) + ; ")" [code=fw:2btrxe4n]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">/*<br />   New Function GetListSeparator()<br />   used to return "List Separator" from "Regional and Language Options"<br />   This character is used in oBw:ToExcel() METHOD<br />   by default in XBROWSE.PRG is ","<br />   but if it is changed in "Regional and Language Options" for example with "|"<br />   program crash<br />*/</span><br /><br /><span style="color: #00C800;">Function</span> GetListSeparator<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Returning "List Separator" from "Regional and Language Options"</span><br /><br /><span style="color: #B900B9;">// Managing Register services from FiveWin</span><br /><br /><span style="color: #00D7D7;">#define</span>  HKEY_CLASSES_ROOT       <span style="color: #000000;">2147483648</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_CURRENT_USER       <span style="color: #000000;">2147483649</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_LOCAL_MACHINE      <span style="color: #000000;">2147483650</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_USERS              <span style="color: #000000;">2147483651</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_PERFORMANCE_DATA   <span style="color: #000000;">2147483652</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_CURRENT_CONFIG     <span style="color: #000000;">2147483653</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_DYN_DATA           <span style="color: #000000;">2147483654</span><br /><br /><br />   <span style="color: #00C800;">local</span> cListSeparator := <span style="color: #ff0000;">","</span>  <span style="color: #B900B9;">// Default value</span><br />   <span style="color: #00C800;">local</span> hKey, cName, uValue, n := <span style="color: #000000;">0</span><br /><br />   <span style="color: #00C800;">if</span> RegOpenKey<span style="color: #000000;">&#40;</span> HKEY_CURRENT_USER,;<br />         <span style="color: #ff0000;">"Control Panel<span style="color: #000000;">\I</span>nternational"</span>, @hKey <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />      <span style="color: #00C800;">while</span> RegEnumValue<span style="color: #000000;">&#40;</span> hKey, n++, @cName, @uValue <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />            <span style="color: #00C800;">if</span> cName = <span style="color: #ff0000;">"sList"</span><br />               cListSeparator := <span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span> uValue, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endif</span><br />      end<br /><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cListSeparator<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:2btrxe4n] Best regards,
xBrowse oBw:ToExcel()
The formula that is built above is translated by the function ExcelTranslate( cFormula ) before assigning to the cell in the next line. The function ExcelTranslate replaces "," with the proper ListSeparator. This function is in olefuncs.prg. Here ListSepator is obtained from Excel Object than from the Registry. May I know if the version of FWH you are using contains this ExcelTranslate() function?
xBrowse oBw:ToExcel()
Mr. Rao, I use FWH 14.12 xHarbour (Build 20141124) bcc582 yes, FWH i am using contains this ExcelTranslate() function. BUT program crash at line 7545 [b:2q0iggf0]oSheet:Cells( nRow, nCol ):Formula := '=' + ExcelTranslate( cFormula )[/b:2q0iggf0] ListSeparator to my PC is "|" Error description: Error Excel.Application:ACTIVESHEET:CELLS/0 S_OK: _FORMULA Args: [ 1] = C =SUBTOTAL(9,I2:I87) Stack Calls =========== Called from: => TOLEAUTO:_FORMULA( 0 ) Called from: .\xbrowse.PRG => TXBROWSE:TOEXCEL( 7545 ) Best regards,
xBrowse oBw:ToExcel()
Can you help ? Can you check the result of oExcel:International[ 5 ] ?
xBrowse oBw:ToExcel()
Yes I put msginfo just before line 7545 (where program crash) the value of oExcel:International[ 5 ] is "|" Regards,
xBrowse oBw:ToExcel()
That is correct. Then please also put another msginfo msginfo( ExcelTranslate( cFormula ) ) // without applying your correction
xBrowse oBw:ToExcel()
Result, SUBTOTAL(9,I2:I87) Here is source of the ExcelTranslate() function [code=fw:3h0lpw84]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ExcelTranslate<span style="color: #000000;">&#40;</span> cFunc <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cRet, nAt, cName<br /><br />   <span style="color: #B900B9;">// 1 English, 2 Spanish, 3 French, 4 Portugese, 5 German, 6 Italian</span><br />   <span style="color: #00C800;">local</span> aTranslates := <span style="color: #000000;">&#123;</span> ;<br />   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"TRUE"</span>,      <span style="color: #ff0000;">"VERDADERO"</span>,   <span style="color: #ff0000;">"VRAI"</span>,        <span style="color: #ff0000;">"VERDADEIRO"</span>, <span style="color: #ff0000;">"WAHR"</span>,          <span style="color: #ff0000;">"VERO"</span> <span style="color: #000000;">&#125;</span>, ;<br />   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"FALSE"</span>,     <span style="color: #ff0000;">"FALSO"</span>,       <span style="color: #ff0000;">"FAUX"</span>,        <span style="color: #ff0000;">"FALSO"</span>,      <span style="color: #ff0000;">"FALSCH"</span>,        <span style="color: #ff0000;">"FALSO"</span> <span style="color: #000000;">&#125;</span>, ;<br />   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SUM("</span>,      <span style="color: #ff0000;">"SUMA("</span>,       <span style="color: #ff0000;">"SOMME("</span>,      <span style="color: #ff0000;">"SOMA("</span>,      <span style="color: #ff0000;">"SUMME("</span>,        <span style="color: #ff0000;">"SOMMA("</span> <span style="color: #000000;">&#125;</span>, ;<br />   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SUBTOTAL("</span>, <span style="color: #ff0000;">"SUBTOTALES("</span>, <span style="color: #ff0000;">"SOUS.TOTAL("</span>, <span style="color: #ff0000;">"SUBTOTAL("</span>,  <span style="color: #ff0000;">"TEILERGEBNIS("</span>, <span style="color: #ff0000;">"SUBTOTALE("</span> <span style="color: #000000;">&#125;</span>, ;<br />   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">','</span>,         <span style="color: #ff0000;">';'</span>,           <span style="color: #ff0000;">';'</span>,           <span style="color: #ff0000;">';'</span>,          <span style="color: #ff0000;">';'</span>,              <span style="color: #ff0000;">';'</span> <span style="color: #000000;">&#125;</span> ;<br />   <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #00C800;">if</span> nExcelLangNo == <span style="color: #00C800;">nil</span><br />      ExcelLangID<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br />   cFunc       := Upper<span style="color: #000000;">&#40;</span> cFunc <span style="color: #000000;">&#41;</span><br />   cRet        := cFunc<br />   <span style="color: #00C800;">if</span> nExcelLangNo > <span style="color: #000000;">1</span> .and. nExcelLangNo <= <span style="color: #000000;">6</span><br />      <span style="color: #B900B9;">// Translation required</span><br />      cName    := cFunc<br />      <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nAt := <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'('</span>, cFunc <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />         cName    := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cFunc, nAt <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nAt := AScan<span style="color: #000000;">&#40;</span> aTranslates, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == cName <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />         cRet     := StrTran<span style="color: #000000;">&#40;</span> cFunc, cName, aTranslates<span style="color: #000000;">&#91;</span> nAt, nExcelLangNo <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />         cRet     := StrTran<span style="color: #000000;">&#40;</span> cRet, <span style="color: #ff0000;">','</span>, ATAIL<span style="color: #000000;">&#40;</span> aTranslates <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> nExcelLangNo <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />   elseif nExcelLangNo != <span style="color: #000000;">1</span><br />      <span style="color: #00C800;">if</span> cRet == <span style="color: #ff0000;">"TRUE"</span>;  cRet := <span style="color: #ff0000;">"1=1"</span>; <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">if</span> cRet == <span style="color: #ff0000;">"FALSE"</span>; cRet := <span style="color: #ff0000;">"1=0"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cRet<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /> </div>[/code:3h0lpw84] Regards,
xBrowse oBw:ToExcel()
We need to fix exceltranslate function. I'll get back
xBrowse oBw:ToExcel()
Please use this revised function [code=fw:30mx21l8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> ExcelTranslate<span style="color: #000000;">&#40;</span> cFunc <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cRet, nAt, cName<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// 1 English, 2 Spanish, 3 French, 4 Portugese, 5 German, 6 Italian</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aTranslates := <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"TRUE"</span>, &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"VERDADERO"</span>, &nbsp; <span style="color: #ff0000;">"VRAI"</span>, &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"VERDADEIRO"</span>, <span style="color: #ff0000;">"WAHR"</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"VERO"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"FALSE"</span>, &nbsp; &nbsp; <span style="color: #ff0000;">"FALSO"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"FAUX"</span>, &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"FALSO"</span>, &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"FALSCH"</span>, &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"FALSO"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SUM("</span>, &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"SUMA("</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"SOMME("</span>, &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"SOMA("</span>, &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"SUMME("</span>, &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"SOMMA("</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SUBTOTAL("</span>, <span style="color: #ff0000;">"SUBTOTALES("</span>, <span style="color: #ff0000;">"SOUS.TOTAL("</span>, <span style="color: #ff0000;">"SUBTOTAL("</span>, &nbsp;<span style="color: #ff0000;">"TEILERGEBNIS("</span>, <span style="color: #ff0000;">"SUBTOTALE("</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">','</span>, &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">';'</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">';'</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">';'</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">';'</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">';'</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nExcelLangNo == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; ExcelLangID<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;cFunc &nbsp; &nbsp; &nbsp; := Upper<span style="color: #000000;">&#40;</span> cFunc <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cRet &nbsp; &nbsp; &nbsp; &nbsp;:= cFunc<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nExcelLangNo > <span style="color: #000000;">1</span> .and. nExcelLangNo <= <span style="color: #000000;">6</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Translation required</span><br />&nbsp; &nbsp; &nbsp; cName &nbsp; &nbsp;:= cFunc<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nAt := <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'('</span>, cFunc <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cName &nbsp; &nbsp;:= <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cFunc, nAt <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nAt := AScan<span style="color: #000000;">&#40;</span> aTranslates, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == cName <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cRet &nbsp; &nbsp; := StrTran<span style="color: #000000;">&#40;</span> cFunc, cName, aTranslates<span style="color: #000000;">&#91;</span> nAt, nExcelLangNo <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;elseif nExcelLangNo != <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> cRet == <span style="color: #ff0000;">"TRUE"</span>; &nbsp;cRet := <span style="color: #ff0000;">"1=1"</span>; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> cRet == <span style="color: #ff0000;">"FALSE"</span>; cRet := <span style="color: #ff0000;">"1=0"</span>; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> cListSeparator != <span style="color: #ff0000;">','</span><br />&nbsp; &nbsp; &nbsp; cRet &nbsp; &nbsp; := StrTran<span style="color: #000000;">&#40;</span> cRet, <span style="color: #ff0000;">','</span>, cListSeparator <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cRet<br />&nbsp;</div>[/code:30mx21l8]
xBrowse oBw:ToExcel()
I replaced the function and included file olefuncs.prg in program This error occured Error description: Error BASE/1003 Variable does not exist: CLISTSEPARATOR Stack Calls =========== Called from: .\olefuncs.PRG => EXCELTRANSLATE( 184 ) Called from: .\xbrowse.PRG => SETEXCELLANGUAGE( 8791 ) Called from: .\xbrowse.PRG => TXBROWSE:TOEXCEL( 7339 ) Regards,
xBrowse oBw:ToExcel()
Up,
xBrowse oBw:ToExcel()
We are using cListSeparator in versions subsequent to your version. We are deriving cListSeparator from oExcel:International[ 5 ]. We made suitable modification as proposed above in the next version and is working. For older versions you may need to use oExcel:International[ 5 ] or your Regstry function to replace comma
xBrowse oCol:nHeadBmpNo Problem
Hi, Is there anything specifically to be taken care of to display the Up and Down symbol displayed on the xBrowse Column Header using the oCol:nHeadBmpNo. I am using the following function to Sort the RecordSet Data displayed on the xBrowse. The sorting is working fine, but it never displays the Up and Down arrow on the Header Column. I don't know where I am wrong. [code=fw:1auzld8m]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">50</span> &nbsp; <br />oBrw:<span style="color: #000000;">nHeaderLines</span> &nbsp;:= <span style="color: #000000;">3</span> &nbsp;<span style="color: #B900B9;">// No. of Lines Required on Header Column</span><br />oBrw:<span style="color: #000000;">nFreeze</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">3</span> &nbsp;<span style="color: #B900B9;">// Freeze columns till 3</span><br />AEval<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aCols</span>,<span style="color: #000000;">&#123;</span>|oCol|oCol:<span style="color: #000000;">bLClickHeader</span>:=<span style="color: #000000;">&#123;</span>|f,c,h,oCol|SortStkList<span style="color: #000000;">&#40;</span>oBrw,oRecset,oCol<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />*-------------------------------------------*<br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> SortStkList<span style="color: #000000;">&#40;</span>oBrw,oRs,oCol,cFld<span style="color: #000000;">&#41;</span><br />*-------------------------------------------*<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cSort:=oRs:<span style="color: #000000;">Sort</span>,nLen,nFor<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cFld:=oCol:<span style="color: #000000;">cHeader</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">&#40;</span>oCol:<span style="color: #000000;">cOrder</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oCol:<span style="color: #000000;">cOrder</span>:=<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>oCol:<span style="color: #000000;">cOrder</span>==<span style="color: #ff0000;">'ASC'</span>,<span style="color: #ff0000;">'DESC'</span>,<span style="color: #ff0000;">'ASC'</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oCol:<span style="color: #000000;">nHeadBmpNo</span>:=<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>oCol:<span style="color: #000000;">cOrder</span>==<span style="color: #ff0000;">'ASC'</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; := len<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; oCol:<span style="color: #000000;">cOrder</span>:=<span style="color: #ff0000;">'ASC'</span><br />&nbsp; &nbsp; &nbsp; oCol:<span style="color: #000000;">nHeadBmpNo</span>:=<span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;oRs:<span style="color: #000000;">Sort</span>:=cFld+Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>+oCol:<span style="color: #000000;">cOrder</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span>oCol:<span style="color: #000000;">nHeadBmpNo</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// To see the Value of nHeadBmpNo</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1auzld8m] I tried using MsgInfo(oCol:nHeadBmpNo) and found that the value of oCol:nHeadBmpNo is changing perfectly ie either 1 or 2. I am using Multiple line on Headers oBrw:nHeaderLines := 3 // No. of Lines Required on Header Column Any help ? Regards Anser
xBrowse oCol:nHeadBmpNo Problem
First Point: It is enough to assign oCol:cOrder := 'A' or 'D'. You do not have to have any headerbmpno. XBrowse automatically paints up arrow or down arrow ( built-in bitmaps) depending of whether oCol:cOrder is 'A' or 'D'. Second Point: If you are browsing a recordset, it is not necessary to code a detailed function for sorting. It is enough to set oCol:cSortOrder := <SortColumnsList> and do not define any codeblock for header click. XBrowse automatically sorts ascending or descending when header is clicked. Example: oCol:cSortOrder := 'DUE,DATE' xBrowse takes care of appending ASC or DESC depending on the header click and displays built-in bitmaps. Do you think you can not manage with the built-in sort ability of xBrowse?
xBrowse oCol:nHeadBmpNo Problem
Dear Mr.Rao, [quote:2oimryjg]It is enough to assign oCol:cOrder := 'A' or 'D'. You do not have to have any headerbmpno. XBrowse automatically paints up arrow or down arrow ( built-in bitmaps) depending of whether oCol:cOrder is 'A' or 'D'.[/quote:2oimryjg] You are right. I used oCol:cOrder := 'ASC' or 'DESC' instead of oCol:cOrder := 'A' or 'D', and that was the reason for the painting problem of the Up Arrow/Down Arrow bmp. So the correct usage is oCol:cOrder := 'A' or 'D [quote:2oimryjg]If you are browsing a recordset, it is not necessary to code a detailed function for sorting. It is enough to set oCol:cSortOrder := <SortColumnsList> and do not define any codeblock for header click. XBrowse automatically sorts ascending or descending when header is clicked.[/quote:2oimryjg] This is also working but the problem faced is that the first click on the Header activates the Sort on Descending order and the second click on the same column does not reverse the sort order ie Toggle option is not functioning. Do I have to code anything extra for this ie the fist click on the header should make the sort on that column in Ascending order and the second click on the header of the same column should sort in Descending order. The Function which I pasted on my previous post does that perfectly. This is the code which I have used as per your advice. [code=fw:2oimryjg]<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;">cSortOrder</span>:=<span style="color: #ff0000;">"Item_Code"</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cSortOrder</span>:=<span style="color: #ff0000;">"Item_Name"</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cSortOrder</span>:=<span style="color: #ff0000;">"Total"</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>aBranches<span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// aBranches contains Column names of the Recordset</span><br />    oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">+3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cSortOrder</span>:=aBranches<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">Next</span></div>[/code:2oimryjg] Any idea where I have gone wrong OR is this the expected default xBrowse behavior regarding oBrw:aCols[]:cSortOrder ? Regards Anser
xBrowse oCol:nHeadBmpNo Problem
Your syntax is right. I just want to inform you that there is another way of userdefined sort. You can also assign a codeblock to cSortOrder. The codeblock does the actual sorting and returns 'A' or 'D'. Behavior of XBrowse is if the column is unsorted, it sorts ascending and if it is already sorted, it toggles the sort.
xBrowse oCol:nHeadBmpNo Problem
[quote:389vgb52]Behavior of XBrowse is if the column is unsorted, it sorts ascending and if it is already sorted, it toggles the sort.[/quote:389vgb52] I don't know where I have gone wrong. Regards Anser
xBrowse oCol:nHeadBmpNo Problem
Dear Mr.Rao, [quote="Mr.Rao":2v3ah1k1][quote:2v3ah1k1]Your syntax is right. I just want to inform you that there is another way of user defined sort. You can also assign a codeblock to cSortOrder. The codeblock does the actual sorting and returns 'A' or 'D'. Behavior of XBrowse is if the column is unsorted, it sorts ascending and if it is already sorted, it toggles the sort.[/quote:2v3ah1k1][/quote:2v3ah1k1] When I compiled my app using 10.1, Sort is working fine as per your suggested code. Regards Anser
xBrowse on a Dlg OF oWnd MDI does not respond
Hi everyone. I need help finding out what I'm doing wrong with this xbrowse. It is housed on a dialog built from resources. The app is an MDI app. I have been able to reproduce the problem on a reduced self-contained sample as shown below. When you execute the app you must resize the window in order to view the xbrowse. That is not the problem I'm looking to solve. The problem I need help with is that once the xbrowse is visible it responds to keyboard input but not to mouse clicks. Can someone please help? Thank you, First the .rc file needed: [code=fw:k82d39wy]<div class="fw" id="{CB}" style="font-family: monospace;"><br />GRID_DLG <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">113</span>, <span style="color: #000000;">70</span>, <span style="color: #000000;">105</span>, <span style="color: #000000;">0</span><br /><span style="color: #0000ff;">STYLE</span> DS_3DLOOK |DS_SETFONT |WS_CHILD |WS_SYSMENU <br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br />LANGUAGE LANG_NEUTRAL, <span style="color: #000000;">0</span><br />BEGIN<br />  CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,<span style="color: #ff0000;">"Txbrowse"</span>,WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,<span style="color: #000000;">2</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">269</span>,<span style="color: #000000;">207</span><br />END<br /> </div>[/code:k82d39wy] And now the actual .prg that reproduces the problem. [code=fw:k82d39wy]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ads.ch"</span><br /><br /><span style="color: #00C800;">STATIC</span> cAlias <br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> oTest<br />   <br />   rddRegister<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADS"</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />   rddSetDefault<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADS"</span> <span style="color: #000000;">&#41;</span><br />   adsSetServerType<span style="color: #000000;">&#40;</span> ADS_LOCAL_SERVER <span style="color: #000000;">&#41;</span><br />   AdsLocking<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//NON-compatible locking mode</span><br /><br />   oTest := Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------</span><br />procedure RddInit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   REQUEST HB_LANG_EN<br />   REQUEST DBFCDX, DBFFPT<br />   REQUEST OrdKeyCount, OrdKeyNo, OrdKeyGoto<br />   REQUEST ADSKeyNo, ADSKeyCount<br />   REQUEST ADS<br /><br /><span style="color: #00C800;">RETURN</span> <br /><br /><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------</span><br /><span style="color: #00C800;">CLASS</span> Test <br /><br />   <span style="color: #00C800;">DATA</span> oGridViewDlg<br />   <span style="color: #00C800;">DATA</span> oGrid<br />   <span style="color: #00C800;">DATA</span> oDbf <br />   <span style="color: #00C800;">DATA</span> oWnd, oWndChild<br />   <br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #00C800;">METHOD</span> OpenDlg<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #00C800;">METHOD</span> SetSize<span style="color: #000000;">&#40;</span> nType, nW, nH <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> CreateTables<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />END <span style="color: #00C800;">CLASS</span> <br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> Test <br />   <span style="color: #00C800;">LOCAL</span> oSelf := <span style="color: #00C800;">SELF</span> <br />   <span style="color: #00C800;">LOCAL</span> oMenu<br /><br />   ::<span style="color: #000000;">CreateTables</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #0000ff;">MENU</span> oMenu <br />      <span style="color: #0000ff;">MenuItem</span> <span style="color: #ff0000;">"hide dlg"</span> <span style="color: #0000ff;">action</span> ::<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #000000;">hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MenuItem</span> <span style="color: #ff0000;">"show dlg"</span> <span style="color: #0000ff;">action</span> ::<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #000000;">show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ENDMENU</span>   <br /><br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">MDI</span> <span style="color: #0000ff;">MENU</span> oMenu <br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> ;<br />           <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oSelf:<span style="color: #000000;">OpenDlg</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />         <span style="color: #0000ff;">ON</span> RESIZE oSelf:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> nSizeType, nWidth, nHeight <span style="color: #000000;">&#41;</span> ;<br />             <span style="color: #0000ff;">VALID</span> oSelf:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">SELF</span><br /><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> Test<br /><br />   <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">RETURN</span> .T.<br /><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> OpenDlg<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> Test<br />   <span style="color: #00C800;">LOCAL</span> oSelf := <span style="color: #00C800;">SELF</span> <br /><br /><br /><span style="color: #B900B9;">//   DEFINE WINDOW ::oWndChild MDICHILD OF ::oWnd FROM 5,5 TO 6,6 COLOR "N/W" BORDER NONE NOMAXIMIZE NOMINIMIZE</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> ::<span style="color: #000000;">oGridViewDlg</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Grid_Dlg"</span> TRANSPARENT <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">240</span>, <span style="color: #000000;">240</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">240</span>, <span style="color: #000000;">240</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">//OF ::oWndChild</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> ::<span style="color: #000000;">oGrid</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oGridViewDlg</span> <span style="color: #0000ff;">ALIAS</span> cAlias ;<br />            COLUMNS <span style="color: #ff0000;">'mrec'</span>, <span style="color: #ff0000;">'guid'</span>, <span style="color: #ff0000;">'Subject'</span>, <span style="color: #ff0000;">'Last_Name'</span>, <span style="color: #ff0000;">'First_Name'</span>, ;<br />                     <span style="color: #ff0000;">'schedule'</span>, <span style="color: #ff0000;">'insurance'</span> ;<br />             HEADER <span style="color: #ff0000;">'MedRecord'</span>, <span style="color: #ff0000;">'guid'</span>, <span style="color: #ff0000;">'SubjectLine'</span>, <span style="color: #ff0000;">'LastName'</span>, <span style="color: #ff0000;">'FirstName'</span>, <span style="color: #ff0000;">'Schedule'</span>, <span style="color: #ff0000;">"Insurance"</span> ;<br />              SIZES <span style="color: #000000;">70</span>, <span style="color: #000000;">120</span>, <span style="color: #000000;">150</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">150</span> <br /><br /><br />   WITH OBJECT ::<span style="color: #000000;">oGrid</span><br /><br />    :<span style="color: #000000;">lAllowRowSizing</span>     := .T.<br />    :<span style="color: #000000;">lAllowColSwapping</span>   := .T.<br />      :<span style="color: #000000;">nStretchCol</span>         := <span style="color: #000000;">2</span> <br />    :<span style="color: #000000;">nMarqueeStyle</span>       := MARQSTYLE_HIGHLROW<br />    :<span style="color: #000000;">lRecordSelector</span>     := .F.<br />    :<span style="color: #000000;">nHeaderHeight</span>       := <span style="color: #000000;">25</span><br /><br />      :<span style="color: #000000;">MedRecord</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">&#123;</span>|nR, nC, nF, o| SelectOrder<span style="color: #000000;">&#40;</span> o , <span style="color: #ff0000;">"mrec"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">guid</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">&#123;</span>|nR, nC, nF, o| SelectOrder<span style="color: #000000;">&#40;</span> o , <span style="color: #ff0000;">"guid"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">LastName</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">&#123;</span>|nR, nC, nF, o| SelectOrder<span style="color: #000000;">&#40;</span> o , <span style="color: #ff0000;">"Last_Name"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />      :<span style="color: #000000;">bPastEof</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      <br />   END <br /><br />   SelectOrder<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGrid</span>:<span style="color: #000000;">MedRecord</span>, <span style="color: #ff0000;">"mrec"</span> <span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #000000;">oClient</span>    := ::<span style="color: #000000;">oGrid</span><br />   ::<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || ::<span style="color: #000000;">oGrid</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> ::<span style="color: #000000;">oGridViewDlg</span> <span style="color: #0000ff;">NOWAIT</span> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span> ;<br />          <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oSelf:<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #0000ff;">move</span><span style="color: #000000;">&#40;</span> oSelf:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nBottom</span> - oSelf:<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #000000;">nheight</span>, ;<br />                                             oSelf:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nRight</span> - oSelf:<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">//::oWndChild:nWidth := ::oGridViewDlg:nWidth+7</span><br />   <span style="color: #B900B9;">//::oWndChild:nHeight := ::oGridViewDlg:nHeight+32</span><br /><br />   <span style="color: #B900B9;">//ACTIVATE WINDOW ::oWndchild ON INIT ::oWnd:Paint()</span><br /><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> SetSize<span style="color: #000000;">&#40;</span> nType, nWidth, nHeight <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> Test<br /><span style="color: #00C800;">LOCAL</span> aClient := GetClientRect <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, i<br /><br />   <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">oGridViewDlg</span> == <span style="color: #00C800;">NIL</span>  ;RETURN <span style="color: #00C800;">NIL</span>  ; <span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #B900B9;">//::oWndchild:SetSize( ::oWnd:nWidth, ::oWnd:nHeight, .T. )</span><br />   <span style="color: #B900B9;">//::oWndchild:Move( 0, 0, ::oWnd:nWidth, ::oWnd:nHeight )</span><br />   ::<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> , ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nWidth</span>, nHeight <span style="color: #000000;">&#41;</span><br />         <br />   ::<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> aClient<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> - <span style="color: #000000;">1</span>, nHeight, .T. <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> aClient<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">oGrid</span> == <span style="color: #00C800;">NIL</span>    ;RETURN <span style="color: #00C800;">NIL</span>       ;ENDIF<br /><br />   ::<span style="color: #000000;">oGrid</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">oGrid</span>:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> aClient<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>, ::<span style="color: #000000;">oGridViewDlg</span>:<span style="color: #000000;">nHeight</span> , .T. <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">oGrid</span>:<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 /><br /><br /><span style="color: #B900B9;">//------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> CreateTables<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> Test<br />   <span style="color: #00C800;">LOCAL</span> cTable := <span style="color: #ff0000;">"EvntColl"</span><br />   <span style="color: #00C800;">LOCAL</span> aStruc := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"GUID"</span>              ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">24</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"mrec"</span>         ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;            <span style="color: #B900B9;">//key</span><br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Subject"</span>       ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;           <span style="color: #B900B9;">//key</span><br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Last_Name"</span>     ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">24</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;           <span style="color: #B900B9;">//key</span><br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"First_Name"</span>    ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;           <span style="color: #B900B9;">//key</span><br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"eMail"</span>         ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;           <br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Tel"</span>           ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">13</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;           <br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"More_Info"</span>     ,<span style="color: #ff0000;">"M"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Event"</span>         ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;   <span style="color: #B900B9;">//FK into events.adt (predifined events)</span><br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Schedule"</span>      ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;   <span style="color: #B900B9;">//FK into Schedules.adt</span><br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Label"</span>         ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;   <span style="color: #B900B9;">//FK into schdl_lbls</span><br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"isEmail"</span>       ,<span style="color: #ff0000;">"L"</span>, <span style="color: #000000;">01</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"isReminder"</span>    ,<span style="color: #ff0000;">"L"</span>, <span style="color: #000000;">01</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Reminder"</span>      ,<span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">09</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;      <span style="color: #B900B9;">//in minutes</span><br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"isNoShow"</span>      ,<span style="color: #ff0000;">"L"</span>, <span style="color: #000000;">01</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Insurance"</span>     ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Contract"</span>      ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Group"</span>         ,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />   AdsSetFileType<span style="color: #000000;">&#40;</span> ADS_ADT <span style="color: #000000;">&#41;</span><br />   cAlias := <span style="color: #ff0000;">"MyAlias"</span><br />   <br />   <span style="color: #00C800;">IF</span> !FILE<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span><br />   <br />      dbCreate<span style="color: #000000;">&#40;</span> cTable, aStruc,, .T., cAlias <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdCreate<span style="color: #000000;">&#40;</span> cTable, <span style="color: #ff0000;">"guid"</span>, <span style="color: #ff0000;">"guid"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-> <span style="color: #000000;">&#40;</span>OrdCreate<span style="color: #000000;">&#40;</span> cTable, <span style="color: #ff0000;">"mrec"</span>, <span style="color: #ff0000;">"mrec"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdCreate<span style="color: #000000;">&#40;</span> cTable, <span style="color: #ff0000;">"Last_Name"</span>, <span style="color: #ff0000;">"Last_Name"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />   <br />      <span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> rLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->Guid := <span style="color: #ff0000;">"1234567890"</span><br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->mRec := <span style="color: #ff0000;">"00000001"</span><br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->Subject := <span style="color: #ff0000;">"Test subject"</span><br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->Last_Name := <span style="color: #ff0000;">"Doe"</span><br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->First_Name := <span style="color: #ff0000;">"John"</span> <br />        <br />      <span style="color: #00C800;">ENDIF</span> <br />      <br />      <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbUnlock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />   <br />      <span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> rLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->Guid := <span style="color: #ff0000;">"4567890123"</span><br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->mRec := <span style="color: #ff0000;">"00000002"</span><br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->Subject := <span style="color: #ff0000;">"Test subject 2"</span><br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->Last_Name := <span style="color: #ff0000;">"Doe"</span><br />         <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->First_Name := <span style="color: #ff0000;">"Joann"</span> <br />        <br />      <span style="color: #00C800;">ENDIF</span> <br />      <br />      <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbUnlock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">ELSE</span> <br />   <br />      Dbusearea<span style="color: #000000;">&#40;</span> .T., <span style="color: #ff0000;">"ADSADT"</span>, cTable , cAlias , .T. , .F. <span style="color: #000000;">&#41;</span><br />      <br />   <span style="color: #00C800;">ENDIF</span> <br />   <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">FUNCTION</span> selectOrder<span style="color: #000000;">&#40;</span> oCol, cOrd <span style="color: #000000;">&#41;</span><br /><br />   AEVAL<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span>|o| o:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> CLR_BLUE, <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">bClrHeader</span>      := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span>CLR_HRED, <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #000000;">&#40;</span>oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span> -> <span style="color: #000000;">&#40;</span> OrdSetFocus<span style="color: #000000;">&#40;</span> cOrd <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:k82d39wy] Notice how the xbrowse does responde to keyboard input but not to mouse clicks. Can someone shed some light? Thank you, Reinaldo.
xBrowse on a Dlg OF oWnd MDI does not respond
Well, never mind. I was able to figure out the solution. I will be glad to share if anyone is interested. I'm sure someone would've helped so thank you anyway. Reinaldo.
xBrowse on a Dlg OF oWnd MDI does not respond
I gave up on MDI designs a long time ago, and with it all the associated problems. I think single document interfaces (SDI) are much better UI's anyway. Glad you solved your problem though. James
xBrowse on a Dlg OF oWnd MDI does not respond
James; Totally with you here. I try to avoid them all the time. AMOF, I imitate MDI using SDI + modeless dialogs and keep better control of the GUI and -IMHO -provide a better enduser experience. Reinaldo.
xBrowse on array - headers disappear.
I have problem with xBrowse on array. When I first time call a dialog with xBrowse all look correctly. [img:15zuxmie]http&#58;//www&#46;3ct-phototeam&#46;pl/FWH/xbrowse-step-1&#46;jpg[/img:15zuxmie] but when I add one record to array headers disappear [img:15zuxmie]http&#58;//www&#46;3ct-phototeam&#46;pl/FWH/xbrowse-step-2&#46;jpg[/img:15zuxmie] After append on database I call this three lines oBRWF:SetArray( xTABBAD ) oBRWF:Refresh(.T.) oBRWF:SetFocus() Any idea what I'm doing wrong? R.
xBrowse on array - headers disappear.
Please remove the line oBRWF:SetArray( xTABBAD ) and try.
xBrowse on array - headers disappear.
[quote="nageswaragunupudi":375lzune]Please remove the line oBRWF:SetArray( xTABBAD ) and try.[/quote:375lzune] I done it and happend nothing. I saw headers but i didn't see my new record. I have to use SetArray becouse I rebuild table and sort it by special order.
xBrowse on array - headers disappear.
SetArray again recreates all the columns "without headers' Can you post here lines of code creating the array first and then appending the row ?
xBrowse on array - headers disappear.
This is a working sample [code:9rxyw0dh] #include "FiveWin&#46;Ch" #include "xbrowse&#46;ch" FUNCTION Main&#40;&#41; LOCAL oWnd, oBrw, oCol LOCAL aArray, n aArray &#58;= &#123; &#123; 1, 'AAA' &#125;, &#123; 2, 'BBB' &#125;, &#123; 3, 'CCC' &#125; &#125; n &#58;= LEN&#40; aArray &#41; // used to create append row DEFINE WINDOW oWnd oBrw &#58;= TXBrowse&#40;&#41;&#58;New&#40; oWnd &#41; oBrw&#58;SetArray&#40; aArray &#41; oBrw&#58;aCols&#91;1&#93;&#58;cHeader &#58;= 'First' oBrw&#58;aCols&#91;2&#93;&#58;cHeader &#58;= 'Second' // right click on browse appends a row oBrw&#58;bRClicked &#58;= &#123;|| n++, ; AADD&#40; aArray, &#123; n, REPLICATE&#40;CHR&#40;64+n&#41;,3&#41; &#125; &#41;, ; oBrw&#58;Refresh&#40;&#41;, ; oBrw&#58;GoBottom&#40;&#41; ; &#125; oBrw&#58;CreateFromCode&#40;&#41; oWnd&#58;oClient &#58;= oBrw ACTIVATE WINDOW oWnd RETURN NIL [/code:9rxyw0dh] Please test this sample. It has to work and it works. Modify your code in the same manner.
xBrowse on array - headers disappear.
[quote="nageswaragunupudi":3144fgqf]sample[/quote:3144fgqf] Thank you for answer. When I work on WINDOW my code working ok, but I want in on DIALOG. Yours code work on dialog too, my blame is that I wanted to put another table instead original "in fly". xBrowse doesn't like it. In TSBrowse I used methods DrawHeader and DrawFooter to correct this kind of situaction, I can't find something equal in xBrowse. R.
xBrowse on array - headers disappear.
Creating a browse: Function LISTA_BADAN() Local oBTN:=Array(20) Local xPOZB:= 0 Local yPOZB:= 0 Local xPOZE:=800 // szerokosc Local yPOZE:=550 // wysokosc Local xRECT Local oBRUSH DEFINE BRUSH oBRUSH FILENAME "BACKGRND\TLO_DG.BMP" DEFINE DIALOG oWNDF ; FROM yPOZB,xPOZB TO yPOZE,xPOZE PIXEL ; BRUSH oBRUSH ; TITLE AllTrim(OemToAnsi(RR->NAZW))+' '+AllTrim(OemToAnsi(RR->IMIE))+' '+AllTrim(Str(RR->RECNO,8,0))+' / '+AllTrim(Str(RR->BARCODE,8,0)) Select("FF") TABBAD_INIT(RR->RECNO) oBRWF := TXBrowse():New( oWNDF ) oBRWF :SetArray( xTABBAD,.F.) // nie szukaj po badaniach oBRWF :nHeaderLines := 2 oBRWF :nDataLines := 1 oBRWF :lFooter :=.t. oBRWF :aCols[3]:cHeader := "Nazwa"+sCRLF+"badania" oBRWF :aCols[3]:cFooter := "RAZEM : " oBRWF :aCols[4]:cHeader := "Cena"+sCRLF+"badania" oBRWF :aCols[4]:cFooter := Transform(nRABAT,"#####.##") oBRWF :aCols[6]:cHeader := "Cena"+sCRLF+"amb." oBRWF :aCols[6]:cFooter := Transform(nRAZEM,"#####.##") oBRWF :aCols[5]:cHeader := "Pracownia" oBRWF :aCols[5]:cFooter := IIF(nRAZEM=0,"",AllTrim(Transform(ABS((nRABAT/nRAZEM)*100-100),"#####.##"))+"%") oBRWF :aCols[7]:cHeader := "Data i godzina akceptacji" oBRWF :aCols[7]:cFooter := "-" oBRWF :aCols[8]:cHeader := "Tube" oBRWF :aCols[8]:cFooter := "-" oBRWF :aCols[9]:cHeader := "Pozycja" oBRWF :aCols[9]:cFooter := "-" oBRWF :bClrHeader := {|| { nRGB(0,0,0), nRGB(222,227,247) } } oBRWF :bClrFooter := oBRWF:bClrHeader oBRWF :bClrStd := oBRWF:bClrHeader oBRWF :nMarqueeStyle := MARQSTYLE_HIGHLROW oBRWF :nColDividerStyle := LINESTYLE_DARKGRAY oBRWF :nRowDividerStyle := LINESTYLE_DARKGRAY oBRWF :nHeaderHeight :=50 oBRWF :CreateFromCode() oBRWF :nTop = 22 oBRWF :nLeft = 0 oBRWF :nWidth = 600 oBRWF :nHeight =300 oBRWF:bKeyDown:={|nKEY| JAKIFFDown(nKEY) } //oBRWF:bKeyChar:={|nKEY| JAKIFFChar(nKEY) } @0, 0 BTNBMP oBTN[ 1] FILE "BMP\B_REB_1.BMP" OF oWNDF NOBORDER ; ACTION (F_EDYCJA("N"),oBRWF:SetFocus()) oBTN[ 1]:cToolTip:="Dodaj badanie" oBTN[ 1]:lTransparent:=.T. @0, 20 BTNBMP oBTN[ 2] FILE "BMP\B_REB_2.BMP" OF oWNDF NOBORDER ; ACTION (F_DODAJP(),oBRWF:SetFocus()) oBTN[ 2]:cToolTip:="Dodaj profil" oBTN[ 2]:lTransparent:=.T. @0, 40 BTNBMP oBTN[ 3] FILE "BMP\B_REB_3.BMP" OF oWNDF NOBORDER ; ACTION (F_SKASUJ(),oBRWF:SetFocus()) oBTN[ 3]:cToolTip:=Ptxt("Usu~n badanie") oBTN[ 3]:lTransparent:=.T. @0, 60 BTNBMP oBTN[ 4] FILE "BMP\B_REB_4.BMP" OF oWNDF NOBORDER ; ACTION FAKTURA() oBTN[ 4]:cToolTip:="Wydruk faktury" oBTN[ 4]:lTransparent:=.T. @0, 80 BTNBMP oBTN[ 5] FILE "BMP\B_REB_5.BMP" OF oWNDF NOBORDER ; ACTION DRUKUJ() oBTN[ 5]:cToolTip:="Wydruk KP" oBTN[ 5]:lTransparent:=.T. @0,100 BTNBMP oBTN[ 6] FILE "BMP\B_REB_6.BMP" OF oWNDF NOBORDER ; ACTION FISZKA() oBTN[ 6]:cToolTip:=Ptxt("Wydruk przyj~etych zlece~n") oBTN[ 6]:lTransparent:=.T. @0,120 BTNBMP oBTN[ 7] FILE "BMP\B_REB_7.BMP" OF oWNDF NOBORDER ; ACTION DAJ_RABAT() oBTN[ 7]:cToolTip:=Ptxt("Udzielenie rabatu za wykonywane us~lugi") oBTN[ 7]:lTransparent:=.T. @0,140 BTNBMP oBTN[ 8] FILE "BMP\B_REB_8.BMP" OF oWNDF NOBORDER ; ACTION COFNIJ_RABAT() oBTN[ 8]:cToolTip:=Ptxt("Przywr~ocenie cen pierwotnych") oBTN[ 8]:lTransparent:=.T. @0,160 BTNBMP oBTN[ 9] FILE "BMP\ILOSC.BMP" OF oWNDF NOBORDER ; ACTION ILOSC_BADAN() oBTN[ 9]:cToolTip:=Ptxt("Ilo~s~c bada~n") oBTN[ 9]:lTransparent:=.T. @0,180 BTNBMP oBTN[10] FILE "BMP\B_REB_9.BMP" OF oWNDF NOBORDER ; ACTION oWNDF:End() oBTN[10]:cToolTip:=Ptxt("Zamkni~ecie bie~z~acego okna") oBTN[10]:lTransparent:=.T. @0,200 BTNBMP oBTN[11] FILE "BMP\DRUKKK.BMP" OF oWNDF NOBORDER ; ACTION REJ_KK('',Str(RR->RECNO),{RR->NAZW,RR->IMIE},xTABBAD) oBTN[11]:cToolTip:=Ptxt("Drukuj kod kreskowy dla punktu pobra~n") oBTN[11]:lTransparent:=.T. @0,220 BTNBMP oBTN[12] FILE "BMP\DRUKKKM.BMP" OF oWNDF NOBORDER ; ACTION FF_WYDRUKUJ_KODY(RR->RECNO,RR->BARCODE,xTABBAD) oBTN[12]:cToolTip:=Ptxt("Drukuj kody kreskowy dla zlecenia") oBTN[12]:lTransparent:=.T. If .NOT. CZY_MA_PRAWO(17) oBTN[7]:Disable() oBTN[8]:Disable() oBTN[9]:Disable() EndIf ACTIVATE DIALOG oWNDF VALID ZWOLNIJ() ON INIT (ODSWIEZ(),oBRWF:SetSize( 799, 490 ),oBRWF:SetFocus()) CENTERED Return NIL
xBrowse on array - headers disappear.
Initialisation of table Static Function TABBAD_INIT(xRECNO) nRABAT:=0 nRAZEM:=0 xTABBAD:={{0,0,'Brak danych','-','-','-','-',0,0}} If FF->(DbSeek(xRECNO)) xTABBAD:={} Do While FF->RECNO=xRECNO .AND. .NOT. FF->(Eof()) AADD(xTABBAD,{; FF->NR_G,; FF->NR_T,; OemToAnsi(FF->NAZWA),; Str(FF->ILOSC*FF->CENA_S,8,2),; Get_Naz_Pra(FF->NR_S),; Str(FF->ILOSC*GET_xTABCENN(FF->NR_T,4),8,2),; DToC(FF->A_DATA)+FF->A_TIME,; 5->PROBOWKA,; FF->POZYCJA }) // zeby dobrze sortowal w czasie rejestracji nRABAT+=FF->ILOSC*FF->CENA_S nRAZEM+=FF->ILOSC*GET_xTABCENN(FF->NR_T,4) FF->(DbSkip(1)) EndDo FF->(DbSeek(xRECNO)) Else FF->(DbGoTop()) EndIf cRABAT:=Str(nRABAT,8,2) cRAZEM:=Str(nRAZEM,8,2) // tutaj posortowac tak jak bedzie na wydruku xTABBAD:=ASORT(xTABBAD,,,{ |X,Y| x[9]<y[9] }) Return .T.
xBrowse on array - headers disappear.
Post append: Function APPEND_TO_TABLE() ....... TABBAD_INIT(RR->RECNO) oBRWF:SetArray( xTABBAD ) ODSWIEZ() Return (NIL) Static Function ODSWIEZ() oBRWF:Refresh(.T.) oBRWF:SetFocus() Return .T.
xBrowse on array - headers disappear.
Nageswaragunupudi What do you think, should it works? R.
xBrowse on array - headers disappear.
Everytime you are appending you are recreating the array. Better would be to modify the same array whose reference the browse object knows. Once you SetArray in the beginning pl dont use it again. SetArray removes all existing columns and creates all columns again without headers. Please try this change [code:13evlnyg] unction APPEND_TO_TABLE&#40;&#41; &#46;&#46;&#46;&#46;&#46;&#46;&#46; TABBAD_INIT&#40;RR->RECNO&#41; oBRWF&#58;aArrayData &#58;= xTABBAD // oBRWF&#58;SetArray&#40; xTABBAD &#41; ODSWIEZ&#40;&#41; Return &#40;NIL&#41; [/code:13evlnyg] Pl see it fhis works
xBrowse on array - headers disappear.
[quote="nageswaragunupudi":1sdfhpo1]Pl see it fhis works[/quote:1sdfhpo1] You're GREAT It works correctly. Very,very thanks for it. Robert
xBrowse on array - headers disappear.
Glad it is working. Nothing great, it is only that I've been using xbrowse for long
xBrowse on array - headers disappear.
[quote="nageswaragunupudi":2sqizbou]Glad it is working. Nothing great, it is only that I've been using xbrowse for long[/quote:2sqizbou] I use it for week <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Thank you
xBrowse position on append
I have an interesting problem that is consistent with several different browses. I'm curious if anyone has a solution. My dialog box has data displayed in the uppper half, and a browse ( xbrowse ) in the lower half. The data in the top corresponds to the selected browse record. If I open the dialog, and have several records already displayed, they are shown correctly. Now, if I append a record, I don't have a problem with the display until I do a Save, at which time the browse resets with only the newly added item displayed at the top of the browse. A page up will show the other items, but that will also repostion the focus. The Save button does the following ACTION ( oInv:save( ), oDiw:update( ), oLbxin:setfocus( ) ) oInv is the database object ( TDATA ) oDiw is the dialog which contains both edit fields and the browse oLbxin is the browse What we want to happen is to have the new record simply added to the bottom of the displayed items already showing on the browse. I've tried repositioning commands, but sometimes that doesn't make the browse highlighted item match the database item. I would appreciate any thoughts anyone might have on this. It really annoys my clients.
xBrowse position on append
Hello Tim, First, Thank You for Your Response on my Tool-Update <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> . There is a Indexorder on FIRST. With SET ORDER TO, there is no Sort anymore ( Natural Sort ) it means a APPEND BLANK will show the new Record on xBrowse-Bottom. [img:39bhu8h8]http&#58;//www&#46;pflegeplus&#46;com/pictures/setorder&#46;jpg[/img:39bhu8h8] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse position on append
That would be problematic because I use a scope ... and I dont go into an append mode ! However, I just discovered that it happens the first time when I enter the browse because the highlight is on the first record. If I go to the bottom of the browse first, then it adds/displays correctly ! oLbx:gobottom(), oRec:append() etc. Thanks ... problem fixed and tested !
xBrowse possibilities and impromevents ...
Hi ! In xBrowses classes , concrety TxBrwColumn() , I missed which field of oCol object is assigned . I added in main program "EXTEND CLASS TxBrwColumn WITH DATA cColField" . But maybe I passed something and alreday exist something like that ? Why it's needfull ? Let's say I'm getting "Items" table , in which are ItemNum , ItemCode and ItemName fieds . ItemNum is hidden , this is a counter - 1,2,3,4,5... User can see ItemCode and ItemName fields only . In "SalesOrder" table exist only ItemNum code . In browse I'm using like that : oCol:bStrData := { ||ret_field( "ITEMS", SALESODER->ITEMNUM, "ITEMCODE", 1 ) } . This ret_field function returns from Items table ItemCode value researching with ItemNum . All that is working . But this column of SalesOrder xBrowse contains this codeblock and others , but don't know which field is related REALLY . So I added this DATA cColField . I have request for sample with xBrowse - how to insert at the end of xBrowse a blank line , a la buffer , to fill fields , validate write and etc. ? Exist codeblock , with which I can write a really value to field , like SalesOrtder->ItemNum ? How to mark which fields are mandatory ? Many thanks in advance for any related sample ! With best regards !
xBrowse problem
Hi, We have an xbrowse which is displaying filtered data from a SQL Server database. The browse displays the data correctly until the down arrow is pressed until it goes past the end record or if the 'end' and 'home' buttons are pressed alternatively. Additional duplicate records then seem to be displayed. In the case of home and end, one extra record when you press 'end' which then clears when you press 'home'. In the case of the down arrow, each time you go past the last record another is added. Has anybody come across a similar problem before? Thanks in advance Gary
xBrowse problem
I extensively use xbrowse with ADO ( SQL Server, Oracle, MSAccess, etc ) XBrowse behaves correctly. Are you assigning any value to oBrw:bPastEof ? Can you post a small self contained example ?
xBrowse questions
I'm converting tsBrowse controls to xbrowse ( 9.05 FWH ). I've gone through the samples, etc. and people have a variety of ways to setup the xbrowse control. In my case, I use it on a dialog with other data displayed, so I am using it with a REDEFINE. Using tsbrowse, the following code allows me to add a column using an array: oLbxd:setArray( aParItm ) ADD COLUMN TO BROWSE oLbxd DATA ARRAY ELEMENT 2 HEADER "Number" SIZE 130 ALIGN 0,1 ADD COLUMN TO BROWSE oLbxd DATA ARRAY ELEMENT 3 HEADER "Description" SIZE 250 ALIGN 0,1 ADD COLUMN TO BROWSE oLbxd DATA ARRAY ELEMENT 4 HEADER "Charge" SIZE 130 ALIGN 2,1 What would be the equivalent code in txbrowse ? Also, using tsbrowse, I can add a bitmap by first defining it: aBmp := { LoadBitMap( GetResources( ) , "CM1" ), ; LoadBitMap( GetResources( ), "CM2" ), LoadBitMap(GetResources( ), "CM3") } And then in the browse, I can use: add column to oLbxo header aBmp[1] data IIF( oWrkOrd:totals,aBmp[3],; IIF( oWrkOrd:ordnot, aBmp[ 1 ], aBmp[ 2 ] )) ALIGN 0,1 size 30 BITMAP What would be the equivalent code in txbrowse ? Samples are great, but they all seem to use the same methodology,. I sure wish we had some newer documentation on xbrowse ? It would be a major boost. Thanks for the input.
xBrowse questions
Tim, In FWH\samples\TestXBrw.prg you can find this code: [code=fw:osdc4oc4]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"TEST"</span> <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;oBrw := TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">/* Another way:<br />&nbsp; &nbsp;oBrw:CreateFromResource( 101 )<br /><br />&nbsp; &nbsp;oBrw:SetArray( { { "first", "row" }, { "second", "row" } } )<br />&nbsp; &nbsp;oBrw:aCols[ 1 ]:cHeader = "An array"<br />&nbsp; &nbsp;oBrw:aCols[ 2 ]:cHeader = "test"<br />&nbsp; &nbsp;oBrw:aCols[ 1 ]:bClrStd = { || { CLR_WHITE, CLR_BLUE } }<br />&nbsp; &nbsp;oBrw:aCols[ 2 ]:bClrStd = { || { CLR_WHITE, CLR_BLUE } }<br />*/</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"An array"</span>, <span style="color: #ff0000;">"test"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; ARRAY <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"first"</span>, <span style="color: #ff0000;">"row"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"second"</span>, <span style="color: #ff0000;">"row"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; COLORS CLR_WHITE, CLR_BLUE<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:osdc4oc4]
xBrowse questions
I was trying to stay with the ADD COLUMN command syntax. I have so many browses to replace that I wanted to keep the coding as similar as possible. So far, arrays and bitmaps were the only issues ... everything else is transfering nicely. Note the array in this case is multidimensional ... 4 elements x the number of data records.
xBrowse questions
Tim, You can also use: [code=fw:2f67eof9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />ADD <span style="color: #000000;">&#91;</span> COLUMN <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#91;</span><oCol><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">XBROWSE</span> <span style="color: #000000;">&#93;</span> <oBrw> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #00C800;">AT</span> <nAt> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <dat: <span style="color: #00C800;">DATA</span>, SHOWBLOCK> <uData> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...<br />&nbsp;</div>[/code:2f67eof9] Please review FWH\include\xbrowse.ch to see the complete syntax, thanks
xBrowse questions
Here is an example ( prepared for a different purpose ) showing 1. Using ADD TO oBrw syntax for adding data, bitmaps 2. Different picture clauses for date formats 3. Editing numbers and automatic maintenance of totals in footers [img:34q4vksd]http&#58;//img93&#46;imageshack&#46;us/img93/6262/xbr&#46;jpg[/img:34q4vksd] I hope this sample covers the issues raised in this post. [code=fw:34q4vksd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br /><span style="color: #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> ;<br />     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #ff0000;">'One   '</span>, <span style="color: #00C800;">nil</span>, date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">23456</span> <span style="color: #000000;">&#125;</span>, ;<br />     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'Two   '</span>, <span style="color: #ff0000;">'2222'</span>, date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span>, <span style="color: #000000;">345</span> <span style="color: #000000;">&#125;</span> , ;<br />     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #ff0000;">'Three'</span>, <span style="color: #ff0000;">'3333'</span>, date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-2</span>, <span style="color: #000000;">789</span> <span style="color: #000000;">&#125;</span>, ;<br />     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">4</span>, <span style="color: #ff0000;">'Four'</span>, <span style="color: #ff0000;">'4444'</span>, date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-3</span>, <span style="color: #000000;">234</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;">540</span>,<span style="color: #000000;">340</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Xbrowse'</span><br /><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">250</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      ARRAY aData ;<br />      CELL LINES FOOTERS FASTEDIT<br /><br />   ADD <span style="color: #0000ff;">TO</span> oBrw ARRAY ELEMENT <span style="color: #000000;">1</span> HEADER <span style="color: #ff0000;">'SlNo'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span> <span style="color: #0000ff;">CENTER</span><br /><br />   <span style="color: #B900B9;">// In XBrowse, ALIGN clause is mostly not necessary</span><br />   <span style="color: #B900B9;">// Date and numeric values are automatically right aligned</span><br />   <span style="color: #B900B9;">// and other types are left aligned</span><br />   <span style="color: #B900B9;">// We need to use ALIGN clause if (a) we want a different</span><br />   <span style="color: #B900B9;">// behavior</span><br />   <span style="color: #B900B9;">// In the above line, we can write 'ALIGN CENTER' or</span><br />   <span style="color: #B900B9;">// simply 'CENTER'</span><br />   <span style="color: #B900B9;">// By default all headers, footers and data are aligned</span><br />   <span style="color: #B900B9;">// same way. We can change the behaviour by assiging</span><br />   <span style="color: #B900B9;">// oCol:nHeadStrAlign := AL_RIGHT, etc.</span><br /><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> oBrw:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> % <span style="color: #000000;">2</span> + <span style="color: #000000;">1</span> BITMAP IN <span style="color: #ff0000;">'OPEN'</span>, <span style="color: #ff0000;">'CLOSE'</span><br />   WITH OBJECT ATail<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'FOLDER'</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">3</span><br />   END<br /><br />   ADD <span style="color: #0000ff;">TO</span> oBrw ARRAY ELEMENT <span style="color: #000000;">1</span> BITMAP IN <span style="color: #ff0000;">'OPEN'</span>,<span style="color: #ff0000;">'CLOSE'</span>,<span style="color: #ff0000;">'FOLDER'</span>,<span style="color: #ff0000;">'FIND'</span><br />   WITH OBJECT ATail<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">2</span><br />   END<br /><br />   ADD <span style="color: #0000ff;">TO</span> oBrw ARRAY ELEMENT <span style="color: #000000;">2</span> HEADER <span style="color: #ff0000;">'Description'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span> ;<br />      BITMAP BMPDATA oBrw:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> IN <span style="color: #ff0000;">'FOLDER'</span>,<span style="color: #ff0000;">'OPEN'</span>,<span style="color: #ff0000;">'FIND'</span>,<span style="color: #ff0000;">'CLOSE'</span><br /><br />   WITH OBJECT ATail<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">1</span><br />   END<br /><br /><br />   ADD <span style="color: #0000ff;">TO</span> oBrw ARRAY ELEMENT <span style="color: #000000;">4</span> HEADER <span style="color: #ff0000;">'Date'</span><br />   ADD <span style="color: #0000ff;">TO</span> oBrw ARRAY ELEMENT <span style="color: #000000;">4</span> HEADER <span style="color: #ff0000;">'Date2'</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">'mmm dd, yyyy'</span><br />   <span style="color: #B900B9;">// can use even these kinds of date formats</span><br /><br />   ADD <span style="color: #0000ff;">TO</span> oBrw ARRAY ELEMENT <span style="color: #000000;">5</span> HEADER <span style="color: #ff0000;">'Amount'</span> ;<br />      <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">'99,999.99'</span> EDITABLE<br /><br />   WITH OBJECT ATail<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">lTotal</span>     := .t.<br />      :<span style="color: #000000;">nTotal</span>     := <span style="color: #000000;">0</span><br />   END<br />   <span style="color: #B900B9;">// This will show total as footer</span><br />   <span style="color: #B900B9;">// Any edit of column automatically changes the total</span><br />   <span style="color: #B900B9;">// MakeTotals() method computes totals</span><br /><br />   oBrw:<span style="color: #000000;">nStretchCol</span>  := STRETCHCOL_WIDEST<br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:34q4vksd] RC file [code=fw:34q4vksd]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">FOLDER</span>     BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>older3.bmp"</span><br />CLOSE    BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>older.bmp"</span><br />OPEN     BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\O</span>pen.bmp"</span><br />FIND     BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>ind.bmp"</span><br /> </div>[/code:34q4vksd]
xBrowse questions
Rao Interesting column total routine .. I have a numeric column already defined in an ado recordset .. how would I use maketotals() in that scenario ? Rick
xBrowse questions
[quote="Rick Lipkin":2glhr5ny]Rao Interesting column total routine .. I have a numeric column already defined in an ado recordset .. how would I use maketotals() in that scenario ? Rick[/quote:2glhr5ny] Same syntax works for any data (ado, rdd, array ). After defining the columns either in @ .. xbrowse command or in ADD TO oBrw command, oCol:lTotal := .t. oCol:nTotal := 0 // if we already know the total, we can assign the total value. There is no need to separately assign cFooter or bFooter. XBrowse knows :ntotal is to be shown as footer with the same picture format applicable to the column. ( Note: In case of ADO and RDD, there is no need to specify the picture clause / column size. XBrowse makes a picture clause based on the field width and decimals and also the column size ) After this whenever we call oBrw:MakeTotals(), XBrowse calculates totals for all columns into oCol:nTotal, where oCol:lTotal is .t. and oCol:ntotal is numeric. oBrw:RefreshFooters() redraws footers only If a column is edited and if that columns lTotal is true and nTotal is numeric, the xbrowse automatically changes the oCol:nTotal with the difference between the original value and the edited value and redraws that columns footer. We do not have to write any special code in our program to recompute totals and repaint the footer.
xBrowse questions
Rao I worked thru the same solution earlier today .. I looked at the \samples.. testtxx examples .. I did a quick loop and got my totals and placed them in the correct footer column .. As far as any dynamic re-calc .. not really necessary .. however, I may need to re-visit that decision. Rick
xBrowse questions
> I did a quick loop and got my totals > Instead of our doing it, xbrowse does it for us.
xBrowse questions
Rao I tried .. could not get any results .. here is my code : Rick [code=fw:1gii8q1f]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------</span><br /><span style="color: #00C800;">Static</span> Func _Hhimport<span style="color: #000000;">&#40;</span> oRsImport, xDATE, oPCAS, oBtn3 <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> oDlg1,oLbx1,cTITLE,oBtn1,oBtn2<br /><span style="color: #00C800;">LOCAL</span> SAYING, nHOURS, nMINUTES<br /><br />SAYING := <span style="color: #ff0000;">"There are Encore Records that can be Imported in PCAS"</span>+chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />SAYING += <span style="color: #ff0000;">"Would you like to view them now ?"</span>+chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> MsgYesNo<span style="color: #000000;">&#40;</span> SAYING <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp;<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 /><span style="color: #00C800;">ENDIF</span><br /><br />nHOURS &nbsp; := <span style="color: #000000;">0</span><br />nMINUTES := <span style="color: #000000;">0</span><br /><br />oRsImport:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> .not. oRsImport:<span style="color: #000000;">eof</span><br /><br />&nbsp; &nbsp;nHOURS &nbsp; := nHOURS+oRsImport:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"hours"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />&nbsp; &nbsp;nMINUTES := nMINUTES+oRsImport:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"minutes"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />&nbsp; &nbsp;oRsImport:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDDO</span><br /><br />oRsImport:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />cTITLE := <span style="color: #ff0000;">"Potential PCAS Import records for Date "</span>+DTOC<span style="color: #000000;">&#40;</span>xDATE <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"PCASIMPT"</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"N/W"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> cTITLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbx1 ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">of</span> oDlg1 &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; RECORDSET oRsImport ;<br />&nbsp; &nbsp; &nbsp; AUTOSORT <span style="color: #0000ff;">AUTOCOLS</span> FOOTERS LINES CELL<br /><br />&nbsp; &nbsp;oLbx1:<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HOURS"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">nTOTAL</span> &nbsp;:= nHOURS<br />&nbsp; &nbsp;oLbx1:<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HOURS"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">lTOTAL</span> &nbsp;:= .t.<br />&nbsp; &nbsp;oLbx1:<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"MINUTES"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">nTOTAL</span> &nbsp;:= nMINUTES<br />&nbsp; &nbsp;oLbx1:<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"MINUTES"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">lTOTAL</span> &nbsp;:= .t.<br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBTN1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">112</span> <span style="color: #0000ff;">of</span> oDLG1 &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _Loadum<span style="color: #000000;">&#40;</span> oRsImport, oDlg1, oBtn3 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBTN2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">118</span> <span style="color: #0000ff;">of</span> oDLG1 &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oDlg1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">&#40;</span> oLbx1:<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 /><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 />&nbsp;</div>[/code:1gii8q1f]
xBrowse questions
Mr Rick Please include oLbx1:MakeTotals() in the INIT clause [code=fw:3gplhs8n]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">&#40;</span> oLbx1:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oLbx1:<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 />&nbsp;</div>[/code:3gplhs8n] Also you may initialize :nTotal := 0, to know that the totals are really made by xbrowse.
xBrowse questions from newbie
Just starting to use FW to convert an old DOS program and have a couple of initial questions on xBrowse Is there a way of splitting the column headers over two rows e.g. "Stock Code" & "Cost Price" to display as headers Stock Cost Code Price I would also like to display entries for logical fields as "Y" or "N" Many thanks Peter
xBrowse questions from newbie
you can see yunus.prg for create xbrowse or if you post the structure of dbf I can help you to build it
xBrowse questions from newbie
to answer Your questions : [quote:85v0y5m6]Is there a way of splitting the column headers over two rows e.g. "Stock Code" & "Cost Price" to display as headers Stock Cost Code Price I would also like to display entries for logical fields as "Y" or "N" [/quote:85v0y5m6] syntax-sample : ( completed with header-splitting ( next post from Mr. Rao ) and shows the different results of logical field-syntax ) [img:85v0y5m6]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Xbrwpaint11&#46;jpg[/img:85v0y5m6] [code=fw:85v0y5m6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />HEADERS <span style="color: #ff0000;">"Recno()"</span>, <span style="color: #ff0000;">"  Last"</span> + CRLF + <span style="color: #ff0000;">"( Index )"</span>, <span style="color: #ff0000;">"First"</span>, <span style="color: #ff0000;">"Age"</span>, <span style="color: #ff0000;">"HireDate"</span>, <span style="color: #ff0000;">"Married"</span> <br /><br />WITH OBJECT oBrw<br />     <span style="color: #B900B9;">// header linefeed</span><br />     :<span style="color: #000000;">nHeaderLines</span> := <span style="color: #000000;">2</span><br /><br />     <span style="color: #B900B9;">// images for YES / NO</span><br />     :<span style="color: #000000;">Married</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> c_path1 + <span style="color: #ff0000;">"Checkon.bmp"</span>, c_path1 + <span style="color: #ff0000;">"Checkoff.bmp"</span> <span style="color: #000000;">&#125;</span>, EDIT_GET <span style="color: #000000;">&#41;</span>       <br />     <span style="color: #B900B9;">// or a checkbox</span><br />     :<span style="color: #000000;">Married</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <br />     <br />     <span style="color: #B900B9;">// group-header </span><br />     :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Name"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// 'Recno()', 'FIRST', 'LAST'</span><br />     :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Data"</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// 'AGE', 'HIREDATE', 'MARRIED'</span><br /><br />     :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END<br /> </div>[/code:85v0y5m6] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
xBrowse questions from newbie
[quote="reds":2wn406m1]Just starting to use FW to convert an old DOS program and have a couple of initial questions on xBrowse Is there a way of splitting the column headers over two rows e.g. "Stock Code" & "Cost Price" to display as headers Stock Cost Code Price I would also like to display entries for logical fields as "Y" or "N" Many thanks Peter[/quote:2wn406m1] Specify the header as "Stock Code" + CRLF + "Cost Price" Specify oBrw:nHeaderLines := 2
xBrowse questions from newbie
Many thanks all,now sorted Regards Peter
xBrowse record en blanco
Que tal foro, tengo una tabla de mysql con registros, creo una window child con un xbrowse y resulta que al final me agrega un registro en blanco, aparte cuando navego con el scroll del raton ó las teclas, al llegar al inicio ó al fin el xbrowse como que se bloquea,,,, algunas pistas? saludos paco
xBrowse record en blanco
se paso poner el codigo, estoy usando tmysql [color=#BF0040:2wtvva2y] cSelect := "SELECT * FROM " + cTabla + " ORDER BY nombre" oQry := oServer:Query( cSelect ) DEFINE WINDOW oChild ; TITLE cTitle ; MDICHILD WITH OBJECT oBrw := TXBrowse():New(oChild) :SetMySQL( @oQry, .F. ) :bSkip := { | n | oQry:Skip( n ) } :lFooter := .T. :bKeyCount := { | | oQry:RecCount() } :CreateFromCode() END WITH OBJECT oChild <!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o -->Client := oBrw :SetControl( oBrw ) END WITH ACTIVATE WINDOW oChild[/color:2wtvva2y] agrego la imagen: [url=http&#58;//img696&#46;imageshack&#46;us/i/capturakf&#46;jpg/:2wtvva2y][img:2wtvva2y]http&#58;//img696&#46;imageshack&#46;us/img696/8798/capturakf&#46;th&#46;jpg[/img:2wtvva2y][/url:2wtvva2y] <!-- m --><a class="postlink" href="http://img696.imageshack.us/i/capturakf.jpg/">http://img696.imageshack.us/i/capturakf.jpg/</a><!-- m --> gracias saludos paco
xBrowse redrawn
Hi, all ! On the dialog A is xBrowse. Open another dialog B. If the mouse to move the dialog B over dialog A, then the xBrowse on dialog A is redrawn very slowly. FWH 16.12
xBrowse redrawn
When a dialog is moved over xbrowse, the xbrowse gets refreshed during the top dialog's movement. Speed of refresh depends on the data-access speeds.