topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
xBrowse TAB navigation wish | To All
It would be nice if the TAB key would navigate through a row ( cell to cell ) much like the right arrow key ..
I have been looking at xBrowse.prg .. if someone could tell me how to modify the navigation keys, I would be most grateful.
Thanks
Rick Lipkin |
xBrowse TAB navigation wish | Rick,
write your own method 'KeyDown()', like:
[code=fw:18vpj16f]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">CLASS</span> ClTXBrowse <span style="color: #0000ff;">FROM</span> TXBrowse<br /> CLASSDATA lRegistered AS LOGICAL<br /> <span style="color: #00C800;">METHOD</span> KeyDown<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> KeyDown<span style="color: #000000;">(</span> nKey, nFlags <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> ClTXBrowse<br /> <span style="color: #B900B9;">// subtyping, polymorphism or overriding the Method in the class TXBrowse (xbrowse.prg)</span><br /> <span style="color: #00C800;">IF</span> nKey == VK_RIGHT<br />...<br /> </div>[/code:18vpj16f] |
xBrowse TAB navigation wish | Rick,
Tab is a key that in Windows is used to change the focus to the next control. You can modify its behavior if you want to, but your app will not behave as a Windows app <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
In case you want to, simply assign oBrowse:bKeyDown = { | nKey | MsgInfo( nKey ) } and check if you get the MsgInfo() when you press it. |
xBrowse TAB navigation wish | Antonio
The Tab key is ignored using the bKeyDown code block <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> .. However, I did add this code to the nKeyDown method in xBrowse and it works quite nicely... but I do not like modifying FWH code because it makes it difficult to upgrade.
Antonio .. is there an easier way to subtype this method in my code without having to modify xBrowse ?
Rick
[code=fw:3jxcjkig]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">case</span> nKey == VK_TAB <span style="color: #B900B9;">// added rick lipkin</span><br /><br /> <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">(</span> VK_CONTROL <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">GoRightMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">GoRight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> </div>[/code:3jxcjkig] |
xBrowse TAB navigation wish | Subclassing xbrowse is the easiest of all.
fwh\samples\xbrchild.prg explains how to subclass xbrowse.prg
Once you have made your own subclass say TXBrowseRick, then at the beginning of your project
SET XBROWSE TO TXBrowseRick()
All xbrowse commands in your entire application will now refer to TXBrowseRick().
In case you still adopt the syntax " oBrw := TXBrowse():New()", please change all those statements to "oBrw := TXBrows():New(oWnd)"
PS: I too personally recommend not to modify the Windows' native behavior. |
xBrowse TAB navigation wish | Rao, Antonio
Just to test the behavior of the tab key, I opened MS Excel 2003 and hi-lited the first cell and hit the tab key and the cursor moved to the right to the next cell just like using the right arrow key.
The same behavior can be duplicated in Access as well .. Open a table and you can verify that tab navigates to the right of the current row within the grid.
I also verified the default cursor movement inside an active cell of both Excel and Access .. when data is in an active cell data is inserted from the cursor-right ( like having the insert key active ) rather than in an over-strike mode.
I can live with making the changes myself and do not want to cause any un-forseen changes that may give other developers any problems.
As Always .. I appreciate everyone help and support.
Thanks
Rick Lipkin |
xBrowse TAB navigation wish | Rick,
I have reviewed Class TXBrowse, TControl and TWindow and there are several places in Method KeyDown() where we assume that VK_TAB is going to be used to switch focus between controls.
If you can modify the method yourself, that would be the easier, or as Rao has pointed, you can always inherit a new Class from TXBrowse and modify the method so when you upgrade to a more recent FWH, your code will continue working fine <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
xBrowse TAB navigation wish | Antonio
Thank you for personally looking into this .. I appreciate all your help and advice.
Rick Lipkin |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
Recently something has changed with xBrowse with the EDIT_GET block .. using :lTabLikeExcel := .t. .. when I put a price 69.95 in this block :
[code=fw:eb8kvurn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Price</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>|o,p| _GetPrice<span style="color: #000000;">(</span> p,oLbxB,oRsDetail,oRsRepair,lTaxable,oTaxable,;<br /> oLabor,oParts,oMisc,oTax,oTotal,cTaxSet<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:eb8kvurn]
and Hit the TAB key .. the block resolved 69.00 .. If I hit the ENTER key, the block resolves 69.95 ... I am using FWH 1705 ... this behavior recently showed up either in 1705 or 1704.
Appreciate your help!
Rick Lipkin |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | There is no change in xbrowse code.
I am unable to comment because I do not know what is inside the postedit code.
It is desirable and safer if we leave XBrowse to work with its own default codeblock for bOnPostEdit.
If you write your own codeblock you should be able to resolve these complexities
If we press Enter key, any pending edit is confirmed
If we press TAB, if there is any pending edit, CancelEdit() is called and the cursor moves to the next cell |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
My code has not changed in years .. here is what is happening .. I tab thru the cells to the Price column .. I enter 69.95 as you see here
[url=https://ibb.co/iZkViQ:4k41zzcu][img:4k41zzcu]https://preview.ibb.co/c8xMq5/xBrowse1.jpg[/img:4k41zzcu][/url:4k41zzcu]
Then when I hit the TAB key ... and I pass P to the EDIT_GET code block and I trap the value with msginfo
[url=https://ibb.co/jTGv05:4k41zzcu][img:4k41zzcu]https://preview.ibb.co/h9Oa05/xbrowse2.jpg[/img:4k41zzcu][/url:4k41zzcu]
The value for the decimals is truncated to .00 ...
[url=https://ibb.co/cGsPtQ:4k41zzcu][img:4k41zzcu]https://preview.ibb.co/kEG67k/xbrowse3.jpg[/img:4k41zzcu][/url:4k41zzcu]
If I repeat the same process and use the Enter key I get the expected 69.95 with the full decimal ... here is the code block that has not changed ...
[code=fw:4k41zzcu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">// Price</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>|o,p| _GetPrice<span style="color: #000000;">(</span> p,oLbxB,oRsDetail,oRsRepair,lTaxable,oTaxable,;<br /> oLabor,oParts,oMisc,oTax,oTotal,cTaxSet<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">// extention</span><br /> ADD oCol <span style="color: #0000ff;">TO</span> oLbxB <span style="color: #00C800;">AT</span> <span style="color: #000000;">9</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">{</span>|x| x := _CalcExt<span style="color: #000000;">(</span> oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Qty"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span>,;<br /> oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Price"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">)</span><span style="color: #000000;">}</span> HEADER <span style="color: #ff0000;">'Ext'</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">65</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">9</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_NONE<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">9</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_RIGHT<br /><br /><br /><span style="color: #B900B9;">//--------------------------------</span><br /><span style="color: #00C800;">Static</span> Func _GetPrice<span style="color: #000000;">(</span> nP,oLbxMain,oRsDetail,oRsRepair,lTaxable,oTaxable,;<br /> oLabor,oParts,oMisc,oTax,oTotal,cTaxSet<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Local</span> nOldPrice,nQ,Saying<br /><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span>nP<span style="color: #000000;">)</span> <span style="color: #B900B9;">// nP should be 69.95 .. not 69.00</span><br /><br /><br /><span style="color: #00C800;">If</span> oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"IsLabor"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> = .t.<br /> Saying := <span style="color: #ff0000;">"Sorry .. you can not EDIT this Price because there is Itemization"</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /> Saying += <span style="color: #ff0000;">"under the Labor Column. In order to Change this Price you must go"</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /> Saying += <span style="color: #ff0000;">"back to the Labor column and Edit or Delete your Changes there"</span>+chr<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> Saying <span style="color: #000000;">)</span><br /> oLbxMain:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oLbxMain:<span style="color: #000000;">nColSel</span><span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.f.<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Endif</span><br /><br />nOldPrice := oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Price"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span><br />nQ := oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Qty"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span><br /><br /><span style="color: #00C800;">If</span> nP = nOldPrice<br /> oLbxMain:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oLbxMain:<span style="color: #000000;">nColSel</span><span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> oLbxMain:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Endif</span><br /><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Price"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := nP<br />oRsDetail:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />_ReCalcTotals<span style="color: #000000;">(</span> oRsDetail,oRsRepair,@lTaxable,oTaxable, ,oLbxMain,;<br /> oLabor,oParts,oMisc,oTax,oTotal,cTaxSet <span style="color: #000000;">)</span><br /><br />oLbxMain:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oLbxMain:<span style="color: #000000;">nColSel</span><span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span><br />oLbxMain:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//--------------------------------------</span><br /><span style="color: #00C800;">Static</span> Func _CalcExt<span style="color: #000000;">(</span> nQuantity,nPrice <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//recalcs ext to paint listbox</span><br /><br /><span style="color: #00C800;">Local</span> nExtension<br /><br />nExtension := <span style="color: #0000ff;">Round</span><span style="color: #000000;">(</span><span style="color: #000000;">(</span>nQuantity * nPrice<span style="color: #000000;">)</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span> nExtension <span style="color: #000000;">)</span><br /><br /> </div>[/code:4k41zzcu] |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | What was the existing value before entering 69.95?
The behavior of xbrowse is this:
If you press Enter, you will see 69.95
If you press Tab, you will see the value existing already |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
This was a new row created by the function _AddNewRow() .. the value of Price was 0 before anyone traverses into the cell.
Rick Lipkin
[code=fw:2stvi5ch]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------</span><br /><span style="color: #00C800;">Static</span> Func _AddNewRow<span style="color: #000000;">(</span> oRsDetail,nRN,nTech,cLocation,oBrw,cAsk,oRsRepair,cReturn <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Local</span> Saying,nEid,nLine,nUpdated<br /><br /><span style="color: #00C800;">If</span> empty<span style="color: #000000;">(</span> cAsk <span style="color: #000000;">)</span><br /> cAsk := <span style="color: #ff0000;">"Y"</span><br /><span style="color: #00C800;">Endif</span><br /><br /><span style="color: #00C800;">If</span> Empty<span style="color: #000000;">(</span>cReturn<span style="color: #000000;">)</span><br /> cReturn := <span style="color: #ff0000;">"ADD"</span><br /><span style="color: #00C800;">ENdif</span><br /><br /><br /><span style="color: #00C800;">If</span> cAsk = <span style="color: #ff0000;">"Y"</span><br /><br /> Saying := <span style="color: #ff0000;">"Do you wish to Add a New Record ?"</span><br /> <span style="color: #00C800;">If</span> MsgYesNo<span style="color: #000000;">(</span> Saying <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Else</span><br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.f.<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span><br /><br /><span style="color: #00C800;">Endif</span><br /><br />nEid := _GenEid<span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">If</span> nEid = <span style="color: #000000;">-1</span><br /> Saying := <span style="color: #ff0000;">"Error in Creating Unique EID for Repair Detail"</span><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span> Saying <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.f.<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Endif</span><br /><br />nLine := _GenLine<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">If</span> nLine = <span style="color: #000000;">-1</span><br /> Saying := <span style="color: #ff0000;">"Error in Creating Unique LINE for Repair Detail"</span><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span> Saying <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.f.<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Endif</span><br /><br /><span style="color: #B900B9;">// update the concurrent counter in repair header</span><br /><br />nUpdated := oRsRepair:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Updated"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span><br /><br /><span style="color: #00C800;">If</span> Empty<span style="color: #000000;">(</span>nUpdated<span style="color: #000000;">)</span><br /> nUpdated := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">Else</span><br /> nUpdated++<br /><span style="color: #00C800;">Endif</span><br /><br />oRsRepair:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Updated"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := nUpdated<br />oRsRepair:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />oRsDetail:<span style="color: #000000;">AddNew</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"RepDetailEid"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := nEid<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Unique Line"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := nLine<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Repair Number"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := nRn<br /><br /><span style="color: #00C800;">If</span> cReturn = <span style="color: #ff0000;">"RETURN"</span><br /> oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Qty"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">-1</span><br /><span style="color: #00C800;">Else</span><br /> oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Qty"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">Endif</span><br /><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Item Description"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">(</span><span style="color: #000000;">100</span><span style="color: #000000;">)</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Price"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">0</span> <span style="color: #B900B9;">// <--------------------- here is the value of Price </span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Tech Number"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := nTech<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Inventory Id"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">(</span><span style="color: #000000;">50</span><span style="color: #000000;">)</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Inventory Type"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">(</span><span style="color: #000000;">50</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//"Labor"+space(45)</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Cost"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">0</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Covered By Warranty"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := .f.<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Location"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := cLocation<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Code"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">(</span><span style="color: #000000;">25</span><span style="color: #000000;">)</span><br />*oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Shipping Ref"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">(</span><span style="color: #000000;">64</span><span style="color: #000000;">)</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Serial Number"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">(</span><span style="color: #000000;">50</span><span style="color: #000000;">)</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"NoTax"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">0</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Warranty Provider"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">(</span><span style="color: #000000;">50</span><span style="color: #000000;">)</span><br />*oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Quote Price"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">0</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"LockedDown"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := .f.<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"IsSerial"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := .f.<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"IsLabor"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := .f.<br />oRsDetail:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />oBrw:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oBrw:<span style="color: #000000;">nColSel</span><span style="color: #000000;">(</span><span style="color: #000000;">3</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// move to part number on add</span><br />oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span><br /><br /> </div>[/code:2stvi5ch] |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
You were on the right track ... I added 0.00 ( decimal ) to Price in _AddNewRow() .... and now it WORKS !!
Thanks for pointing me in the right direction ..
Rick Lipkin |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
I just compiled your sample and changed the Salary to 69.95 and Tabbed thru the cell and your msginfo resolved 69.00 instead of 69.95... and the previous existing value decimal value was .00
At least we are able to re-create the tabbed behavior.
Rick Lipkin
[url=https://imgbb.com/:hqvbolan][img:hqvbolan]https://image.ibb.co/m4gpSk/xbrowse.jpg[/img:hqvbolan][/url:hqvbolan] |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | The best way is to test with as small program as possible
I am testing with this program
[code=fw:2i8bgcps]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> XBROWSER <span style="color: #ff0000;">"CUSTOMER.DBF"</span> FASTEDIT ;<br /> COLUMNS <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"SALARY"</span>, <span style="color: #ff0000;">"CITY"</span> ;<br /> <span style="color: #0000ff;">TITLE</span> FWVERSION ;<br /> SETUP <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">lTabLikeExcel</span> := .t., ;<br /> oBrw:<span style="color: #000000;">Salary</span>:<span style="color: #000000;">lAutoSave</span> := .f., ; <span style="color: #B900B9;">// toggle and check</span><br /> oBrw:<span style="color: #000000;">Salary</span>:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span> |o,x,k| <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> x <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2i8bgcps]
I find difference in the behavior between 17.03 and 17.05.
I try to locate the change and let you know.
I did not save 17.04 version. |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
Unfortunately adding 0.00 to Price in _AddNewRow() made NO difference ... I still get 69.00 when I trap the EDIT_GET code block value nP ... <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Rick Lipkin
ps I just updated to FWH 1706 a few minutes ago |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
Any News ?
Thanks
Rick Lipkin |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Mr Rick
I need some more time please |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
Hope you enjoyed the conference ... have you had a chance to re-examine this issue ?
Thanks
Rick Lipkin |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
Forgive me .. just wanted to keep this on your radar ... Thanks for your Help !
Rick Lipkin |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Sorry for the delay.
Please locate static function EditGetkeyDown( Self, nKey ) in xbrowse.prg.
In that function please locate the code
[code=fw:2rzv0uhj]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">case</span> nKey == VK_RETURN</div>[/code:2rzv0uhj]
Modify this line as
[code=fw:2rzv0uhj]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">case</span> nKey == VK_RETURN .or. nKey == VK_TAB</div>[/code:2rzv0uhj]
Please let us know the result |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
case nKey == VK_RETURN was found in two places
1) KeyChar()
2) EditGetKeyDown()
I made the change in both places to case nKey == VK_RETURN .or. nKey == VK_TAB
You modification WORKED !!
Thank You VERY Much
Rick Lipkin |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Do not change in KeyChar()
EditGetKeyDown() is to be changed. |
xBrowse TAB vs ENTER key EDIT_GET ( rao ) | Rao
I took out the mod in KeyChar() and left the mod in EditGetKeyDOwn() ... it WORKS !
Thanks Again!
Rick Lipkin |
xBrowse Table records with a subtree | Hi everyone;
I'm interested on xbrowsing a table and then possibly show a subtree under each record. I should avoid reading the whole table into tree branches as the table may contain hundreds of thousands (if not millions) of records. The idea is to respond to a double click on a record by opening a subtree under it.
This would be perfect to show records from a master table with childs from a different table as a subtree of each master record.
Is this even possible?
Thank you,
Reinaldo. |
xBrowse Table records with a subtree | No ideas or is it a bad question?
Reinaldo. |
xBrowse Table records with a subtree | Reinaldo,
See if \FWH\SAMPLES\XBRWDISK.PRG can help.
Regards, Euclides |
xBrowse Table records with a subtree | Euclides /All;
Thank you for participating on this thread.
The sample you make reference to, as well as any other I've seen so far, pre-builds the tree and subtree in memory. That, surely, will not work when you need to xbrowse a table with millions of records.
Imagine, for example, that you have an xbrowse on the customers table with 1M records and that by Right-clicking on the customerID cell, you open a sub-tree with a list of detail transactions from a sales table. The sub-tree of transactions could be built in memory since it is unlikely that the number of transactions will overflow memory limits, but you CAN NOT load the 1M customers into a tree to be xbrowsed, as it would take for ever to load and no amount of memory would handle it.
I think xbrowse needs to be expanded to allow creation of a subtree on the fly on an existing aliased (table) xbrowse. I wish the argument will persuade Mr. Rao or whomever is in charge of xbrowse now days.
Reinaldo. |
xBrowse Table records with a subtree | Reinaldo,
is it something like this you want:
I use here 2 xBrowse.
Best regards,
Otto
[img:wc0k1jyl]http://www.atzwanger-software.com/fw/rao_notes.jpg[/img:wc0k1jyl]
[img:wc0k1jyl]http://www.atzwanger-software.com/fw/RAONOTES.jpg[/img:wc0k1jyl]
[img:wc0k1jyl]http://www.atzwanger-software.com/fw/2xbrw.jpg[/img:wc0k1jyl] |
xBrowse Table records with a subtree | Otto;
Hi. Instead of having two xbrowses, like in your picture, imagine that the info on the 2nd xbrowse shows only if you right click on the parent xbrowse line, and that the detail info shows on indented rows right underneath the parent row on the same xbrowse. Just like a tree on a single xbrowse.
Speaking in "tree" terms, in your sample picture, the branches of the tree shows on the left while the leaves of the tree shows on the right. you move on the branches, and the leaves changes. That's nice. But is not like a tree on a single xbrowse. Imagine one single xbrowse with branches, at some keyboard or mouse action, the leaves shows underneath the branch. Elegant and beautiful.
Don't think that don't appreciate the current implementation of fw xbrowse control. We do have the ability to load a tree on an xbrowse that works well if you can load the whole parent (branches) table into the tree before xbrowsing. But that won't work for any production size table, such as any master table -say the customers table that might contain 1M records.
The control I'm describing here exists for other development languages. I was hoping I could get fwh developers interested un further enhancing xbrowse to do the same.
Thank you for posting,
Reinaldo. |
xBrowse Table records with a subtree | Reinaldo,
look at the right xBrowse in RAO notes.
Here I use
:bIndent := { ||20 + ( ::cAlias )->TREELEVEL * 20 } .
With this it is easy to reach what you want.
:bIndent block and original xBrowse is much more flexible .
Please post a screen to demonstrate what exactly you want.
Best regards, |
xBrowse Table records with a subtree | Sure. Here is a screen shot.
[img:3hogwne3]http://ssfl.dynalias.com/temp_files/remittances_screen_shot.png[/img:3hogwne3]
I thought it would be easier to see and appreciate; ---have a large master table on an xbrowse, at some keyboard or mouse action, let the detailed child transactions open-up and show just underneath the master record they belong to. It is possible the that contents of the cells on the detailed records will not exactly match those of the parent record but that's ok. The idea is to be able to show detailed transactions at-hoc on the same xbrowse. Keep in mind that detail transactions may come from a different table.
Currently you can do this with fwh by xbrowsing a tree. But you can't make a tree out of large table -such as any real world master table. After about 10k records, an in memory linklist stops being practical. Any real world master table will be 20 times that size.
Reinaldo. |
xBrowse Table records with a subtree | Reinaldo,
Can’t you insert a field in your database “ShowonTree” .
When browsing you show only these fields with true.
Then on click you search for the releted products what you call in you post subtree open the database again and set “ShowonTree” to true.
The refresh() method of xBrowse does the rest.
With
<!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o -->DataFont := { || }
:aCols[ 1 ]:bIndent := { || }
you can make the treeview look.
You can make a relation between the two databases to show the “subtrees”.
Best regards,
Otto |
xBrowse Table records with a subtree | Otto /Everyone;
hummm, I'm afraid I haven't done a good job at exposing how a tree on an xbrowse works. Surely no one on the forum is getting what I've been trying to explain. I will try to do better on a new thread.
Thank you very much
Reinaldo. |
xBrowse Text editing wish list | To All
Is there a way to modify xBrowse to do two things ..
1- On EDIT_GET to have the cursor move to position 0 or to the beginning of the text field
2 - Instead of overstrike when editing the text .. have the text insert turned on .. that way when you make a change to the field .. you do not over write the text .. just togle insert ?
Thanks
Rick Lipkin |
xBrowse Text editing wish list | Rick:
For your second question, I use this code with TSBrowse, perhaps it can help you
with TXBrowse on EDIT method.
[code=fw:1lcuhtod]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">aColumns</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bPrevEdit</span> := <span style="color: #000000;">{</span> | uVar | Set<span style="color: #000000;">(</span> _SET_INSERT, ! Set<span style="color: #000000;">(</span> _SET_INSERT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> </div>[/code:1lcuhtod]
Best regards |
xBrowse Text editing wish list | Armando
Thank you for your suggestion .. there does not appear to be a prepostget code block in xBrowse unless I have just missed it ?
I am still trying to come up with a solution and will share it when I get an answer.
Rick Lipkin |
xBrowse Text editing wish list | Rick:
Perhaps in ONPREVEDIT Method,
[code=fw:2ctnstlm]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">aColumns</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPrevEdit</span> := <span style="color: #000000;">{</span> | uVar | Set<span style="color: #000000;">(</span> _SET_INSERT, ! Set<span style="color: #000000;">(</span> _SET_INSERT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> </div>[/code:2ctnstlm]
Just an idea.
Regards |
xBrowse Text editing wish list | Armando
Thank you once again .. no such code block bOnPrevEdit exists in xBrowse <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Rick |
xBrowse Text editing wish list | oCol:bOnPreEdit |
xBrowse Text editing wish list | Rao and Armando
Thank you both for your answers .. here is the solution to the long edit string using the bOnPreEdit code block. This takes the cursor to position 0.
Rick Lipkin
[code=fw:2rnc1ky4]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPreEdit</span> := <span style="color: #000000;">{</span> || __Keyboard<span style="color: #000000;">(</span> Chr<span style="color: #000000;">(</span> VK_HOME <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:2rnc1ky4] |
xBrowse ToExcel formulado con FormulaR1C1 | Tengo problemas con el método FormulaR1C1
No calcula la formula. En la celda de excel aparace #¿NOMBRE? teniendo la celda la formula =SUBTOTALES(9;R2C11:R3C11)
Lo que tendría que hacer es sumar de la columna k fila 2 a la columna k fila 3
La columna k es la 11 por lo que la formulación es correcta pero excel no lo interpreta.
Uso Excel 2003
He probando cambiando en el método ToExcel
[code=fw:2ihfksoe]<div class="fw" id="{CB}" style="font-family: monospace;">oSheet:<span style="color: #000000;">Cells</span><span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span>:<span style="color: #000000;">Formula</span> := <span style="color: #ff0000;">"="</span> + cxlAggr + excelRange2<span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, nCol, nRow - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">')'</span> <span style="color: #B900B9;">// FWH 9.11 + ')' added //...fgondi</span><br /><span style="color: #B900B9;">//oSheet:Cells( nRow, nCol ):FormulaR1C1 := "=" + cxlAggr + excelRange( 2, nCol, nRow - 1 ) + ')' // FWH 9.11 + ')' added</span></div>[/code:2ihfksoe]
Siendo la función ExcelRange2
[code=fw:2ihfksoe]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> excelCell2<span style="color: #000000;">(</span> r, c <span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> Chr<span style="color: #000000;">(</span> <span style="color: #000000;">65</span>+c<span style="color: #000000;">-1</span> <span style="color: #000000;">)</span> + LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> r <span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:2ihfksoe]
Y funciona correctamente.
¿Tengo que cambiar algo en excel para que funciones?, si es así, sería un problema gordo, porque no puedo ir verificando equipo por equipo de los clientes. |
xBrowse ToExcel formulado con FormulaR1C1 | ToExcel() method is fully tested and working well in English installations, but not well tested on other language installations. From your posting it appears R1C1 style is not working well in some installations.
With the corrections you made already, ToExcel() should work correctly if the total columns are not more than 26. No other corrections are necessary.
This is a better replacement for the code. This new code is language indepedant and should work correctly in all installations.
[code=fw:tpok7j7k]<div class="fw" id="{CB}" style="font-family: monospace;"> oSheet:<span style="color: #000000;">Cells</span><span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span>:<span style="color: #000000;">Formula</span> := <span style="color: #ff0000;">"="</span> + cxlAggr + ;<br /> oSheet:<span style="color: #000000;">Range</span><span style="color: #000000;">(</span> oSheet:<span style="color: #000000;">Cells</span><span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, nCol <span style="color: #000000;">)</span>, oSheet:<span style="color: #000000;">Cells</span><span style="color: #000000;">(</span> nRow - <span style="color: #000000;">1</span>, nCol <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Address</span> + <span style="color: #ff0000;">")"</span><br /> </div>[/code:tpok7j7k]
Can you please try and inform if this change is working correctly? |
xBrowse ToExcel formulado con FormulaR1C1 | nageswaragunupudi,
Con ese cambio, funciona correctamente. |
xBrowse Tooltip | All,Is there any way to show a tooltip when the mouse is over a particular cell?Thanks,Randal |
xBrowse Tooltip | Randal,With xbrowse, you can set a tooltip for each column, but it will be shown when the mouse is over the column header.Are you looking to show a tooltip when the mouse is over a cell ? oBrw:ShowToolTip( nRow, nCol, cToolTipText) could be used |
xBrowse Tooltip | Antonio,Yes, I want to show a tooltip when the mouse is over a cell. How do I get the values for nRow, nCol?Thanks,Randal[quote="Antonio Linares":1msys745]Randal,
With xbrowse, you can set a tooltip for each column, but it will be shown when the mouse is over the column header.
Are you looking to show a tooltip when the mouse is over a cell ?
oBrw:ShowToolTip( nRow, nCol, cToolTipText) could be used[/quote:1msys745] |
xBrowse Tooltip | this change for fw 8.10 i dont know it work for other versionnew DATA into CLASS TXBrwColumn[b:33kjg9z6]DATA bToolTip // codeblock to be evaluated for each columns after header[/b:33kjg9z6]add new local variable and change this lines in METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TXBrowse[b:33kjg9z6]local cTxt [/b:33kjg9z6][code:33kjg9z6]
nFor := If( nRow < ::HeaderHeight(), ::MouseColPos( nCol ), 0 )
if nFor > 0 .and. nFor <= nLen
oCol := ::ColAtPos( nFor )
CursorArrow()
if Empty( oCol:cToolTip )
::DestroyToolTip()
else
if ::oColToolTip == nil .or. ::oColToolTip:nCreationOrder != oCol:nCreationOrder
::DestroyToolTip()
::ShowToolTip( ,, oCol:cToolTip )
::oColToolTip := oCol
endif
endif
return 0
else
if ::oColToolTip != nil
::DestroyToolTip()
endif
::CheckToolTip()
endif
[/code:33kjg9z6]
[b:33kjg9z6]FOR THIS LINES[/b:33kjg9z6]
[code:33kjg9z6]
nFor := If( nRow < ::HeaderHeight(), ::MouseColPos( nCol ), 0 )
if nFor > 0 .and. nFor <= nLen
oCol := ::ColAtPos( nFor )
CursorArrow()
if Empty( oCol:cToolTip )
::DestroyToolTip()
else
if ::oColToolTip == nil .or. ::oColToolTip:nCreationOrder != oCol:nCreationOrder
::DestroyToolTip()
::ShowToolTip( nRow,nCol, oCol:cToolTip )
::oColToolTip := oCol
endif
endif
return 0
elseif ( nFor := If( nRow > ::HeaderHeight(), ::MouseColPos( nCol ), 0 ) ) > 0
if nFor > 0 .and. nFor <= nLen
oCol := ::ColAtPos( ::MouseColPos( nCol ) )
CursorArrow()
if ::MouseColPos( nCol ) > 0
if Empty( oCol:bToolTip )
::DestroyToolTip()
else
if ::oColToolTip == nil .or. ::oColToolTip:nCreationOrder != oCol:nCreationOrder
cTxt := eval( oCol:bToolTip, Self )
if !empty( cTxt )
::DestroyToolTip()
::ShowToolTip( nRow,nCol, cTxt )
::oColToolTip := oCol
endif
endif
endif
endif
return 0
endif
else
if ::oColToolTip != nil
::DestroyToolTip()
endif
::CheckToolTip()
endif
[/code:33kjg9z6]i think it allexample...oBrw:aCols[ 1 ]:bToolTip := {|oBr| if( oBr:aRow[ 1 ]==1,"This a Test",) }[b:33kjg9z6]parameter in for codeblock is Browse Objet (self)[/b:33kjg9z6] |
xBrowse Trap Down Arrow key | To All
I am trying to trap the down arrow key in an xBrowse .. and this does not work
oLbxB:bKeyDown := { |nKey| MsgInfo(nKey) }
It traps 'Enter', "Insert' .. any ideas ?
Thanks
Rick Lipkin |
xBrowse Trap Down Arrow key | XBrowse does not allow this.
You need to write your own KeyDown() method and override and have a derived class. |
xBrowse Trap Down Arrow key | Hi Rick.
Do you resolved it?
Can share your solution?
Best regards. |
xBrowse Trap Down Arrow key | I faced this problem this days and solved using bChange.
EMG |
xBrowse Trap Down Arrow key | Enrico.
Can you post a litle sample?
Thanks |
xBrowse Trap Down Arrow key | Here it is:
[code=fw:39cet7yg]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oBrw<br /><br /> USE CUSTOMER<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>, <span style="color: #000000;">600</span><br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw<br /><br /> oBrw:<span style="color: #000000;">bChange</span> = <span style="color: #000000;">{</span> || Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">AdjClient</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">CENTER</span><br /><br /> CLOSE<br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> GETKEYSTATE<span style="color: #000000;">(</span> VK_UP <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"VK_UP"</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">IF</span> GETKEYSTATE<span style="color: #000000;">(</span> VK_DOWN <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"VK_DOWN"</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:39cet7yg]
EMG |
xBrowse Trap Down Arrow key | Great! Enrico.
Thanks |
xBrowse Trap Down Arrow key | Francisco
Enrico's solution is much better than mine .. I actually modified the xBrowse.prg code ..
Rick Lipkin |
xBrowse Trap Down Arrow key | Rick.
Got it.
Thanks for your kindly. |
xBrowse Tree (SKIPPER) urgent help | Dear All,
Dear Mr. RAO,
How can I filter oTree of xbrowse... say the tree has text = 'FIVEWIN' and I want all tree item with 'FIVEWIN' text only..
How can I show that on already processed tree?
Kind Regards,
Frances |
xBrowse Tree (SKIPPER) urgent help | Dear All, MR. RAO,
Maybe a skipper to :bSkip ?? skip when <!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o -->TreeItem:Cargo <> cCondition?
Anyone with sample?
Kind Regards,
Frances |
xBrowse Tree (SKIPPER) urgent help | Dear Mr. Antonio,
Can you help for xbrowse:otree skipper or xbrowse skipper to check if <!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o -->treeitem:cargo == condition?
Kind regards,
Frances |
xBrowse Tree (SKIPPER) urgent help | How about just filtering the database and redisplaying the tree?
Regards,
James |
xBrowse Tree (SKIPPER) urgent help | [quote="James Bott":2cj9rtqf]How about just filtering the database and redisplaying the tree?
Regards,
James[/quote:2cj9rtqf]
Hello Mr. James,
I tried that but if user chooses to search for certain 'string' on ::otreeitem:cargo or on the otree .. the tree created was rubbish... it doesnt meet criteria.
Better if generated xbrowse tree has some custom skipper where I can skip ::otreeitem or tree item not to display so user can select from supposed to be long list (500 items) out of say.. 5 items matching
the criteria.
Kind Regards,
Frances |
xBrowse Tree (SKIPPER) urgent help | Frances,
>I tried that but if user chooses to search for certain 'string' on ::otreeitem:cargo or on the otree .. the tree created was rubbish... it doesnt meet criteria.
Well, I have to wonder, if filtering the database didn't work, then how is using bSkip going to solve the problem? I think perhaps that your filter was incorrect. You still need a working filter to use bSkip.
Regards,
James |
xBrowse Tree (SKIPPER) urgent help | [quote="James Bott":2dey1zwa]Frances,
>I tried that but if user chooses to search for certain 'string' on ::otreeitem:cargo or on the otree .. the tree created was rubbish... it doesnt meet criteria.
Well, I have to wonder, if filtering the database didn't work, then how is using bSkip going to solve the problem? I think perhaps that your filter was incorrect. You still need a working filter to use bSkip.
Regards,
James[/quote:2dey1zwa]
Dear Mr. James,
Perhaps you are right... I also wonder how to solve this..
The xBrowse Tree hasmultiple level.. and filtering those 'strings' somehow not easy at least to me.
I will post screenshots of current xbrowse tree I have.
Kind Regards... |
xBrowse Tree (SKIPPER) urgent help | Dear Mr. James,
Here's the xBrowse tree I wish to re-filter or by :bskip with condition
[img:y7sp31bx]http://i208.photobucket.com/albums/bb82/fraxzi/COA.png[/img:y7sp31bx]
Say... I want to see items with only string 'Telephone'... user should only see items with that string.. 'Telephone'.
Kind Regards,
Frances |
xBrowse Tree (SKIPPER) urgent help | Frances,
OK, I have not used xbrowse as a tree before so I don't have any knowledge of how it works.
I am guessing that (for your example) you just want to see the three lines in the first column that contain "telephone?" If so, it seem like you just need a simple two column display for that. Or, did you want to display also some of the tree headings above these records also? In that case the headings don't contain the keyword.
Also are the different headings (Expense, Capital Expenditure, etc.) different fields of the database? As I said, I don't quite understand how this works.
Regards,
James |
xBrowse Tree (SKIPPER) urgent help | Dear Mr. James,
If user search for string like 'Telephone' it doesn't matter if headings are shown as long as the searched string displays (ONLY) and go back to normal tree when skip up or skip down
much like of incremental search..
Kind regards,
Frances |
xBrowse Tree (SKIPPER) urgent help | Francis,
Well, I think you just need to do a filter something like this:
set filter to upper( cKeyword) $ upper( [fieldname] )
Where [fieldname] is replaced by the fieldname you wish to search.
Regards,
James |
xBrowse Tree (SKIPPER) urgent help | Dear Mr. James,
Thanks for all your inputs...
I trashed the Idea on filtering already processed xBrowse oTree.. seems skipper is not easy.. I need to deploy this app today.
What I did is to dump or export the xBrowse oTree to temporary dbf file.. and use that file as the xbrowse... looks like tree. From there i can filter what user's string wishes to find.
Only drawback is that I loose the real Tree Object.. no expandable/collapsible line item... Not Ideal to me... BUT users accept it better than the real xBrowse oTree.
I think FiveWin/Xbrowse developers should have a way to filter-out tree items or similar data source displayed by xBrowse (if not RDD).. just my 2 cents.
I will post similar results under XP my previous screenshot was from my win7 PC back home. I'm in the office right now. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
[img:y0o7plmd]http://i208.photobucket.com/albums/bb82/fraxzi/COA_after.png[/img:y0o7plmd]
Kind Regards,
Frances |
xBrowse Tree (SKIPPER) urgent help | [quote="fraxzi":2mpq7e6s]Dear Mr. Antonio,
Can you help for xbrowse:otree skipper or xbrowse skipper to check if <!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o -->treeitem:cargo == condition?
Kind regards,
Frances[/quote:2mpq7e6s]
It is not impossible to change LinkList ( oTree ) skipper. But providing filtering mechanism in the Trees involves more changes to the class including number of rows, serial number of any row and repositioning to a given row number. Then only the filter works in xbrowse. While there is nothing that is impossible, it involves a lot of changes to the class.
I personally prefer ( and in fact that is what I do in my own programs ), is to set filter to the original dbf ( or the datasource ) and read the filtered data into the tree and set oBrw:oTree := oNewTree and oBrw:oTreeItem := oBrw:oTree:oFirst
Please also note that at present xbrowse does not support empty trees. |
xBrowse Tree (SKIPPER) urgent help | Dear Mr. RAO,
Thank you for your explanation.
It seems the only solution is workable.
Kind Regards,
Frances |
xBrowse Tree Drag and Drop | Dear Mr. RAO
I have an xBrowse Tree as shown here:
[img:iz8ynj2h]http://i208.photobucket.com/albums/bb82/fraxzi/xBrowseTreeDragDrop.png[/img:iz8ynj2h]
How can I drag and drop a particular item to sub-tree item? |
xBrowse Tree Drag and Drop | Up.. |
xBrowse Tree de 3 niveles | Saludos,
Alguien que tenga un ejemplo de un tree con xbrowse desde un array para tres niveles
ej.
[code=fw:1pfckroj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> A<br /> |-- |--A1<br /> | | |--A11<br /> | | |--A12<br /> | |--A2<br /> | |--A21<br /> | |--A22<br /> B<br /> |-- |--B1<br /> | | |--B11<br /> | | |--B12<br /> | |--B2<br /> | |--B21<br /> | |--B22<br /> </div>[/code:1pfckroj] |
xBrowse Tree de 3 niveles | See this post
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23029#p123328">viewtopic.php?f=3&t=23029#p123328</a><!-- l -->
Regards
Anser |
xBrowse Tree de 3 niveles | Thanks,..... Very Good |
xBrowse Tree with Checkbox | Dear All,
Anyone has this created Tree with xbrowse with checkbox on tree item?
Kind Regards,
Frances |
xBrowse Tree with Checkbox | Using ADD TO oBrw, add a column with appropriate logical expression as DATA and use method oCol:SetCheck() |
xBrowse Tree with Checkbox | [quote="nageswaragunupudi":18w5fn4c]Using ADD TO oBrw, add a column with appropriate logical expression as DATA and use method oCol:SetCheck()[/quote:18w5fn4c]
Dear Mr. RAO,
That is what I have right now... I mean the checkbox integrated with oTreeitem... as image?
Kind Regards,
Frances |
xBrowse Tree with Checkbox | Do you want it as a bitmap inside the column displaying treeitem:cPrompt ?
In that case, add bmpdata to oBrw:aCols[ 1 ] and add bitmaps to this column |
xBrowse Tree with Checkbox | [quote="nageswaragunupudi":kquzuub3]Do you want it as a bitmap inside the column displaying treeitem:cPrompt ?
In that case, add bmpdata to oBrw:aCols[ 1 ] and add bitmaps to this column[/quote:kquzuub3]
Dear Mr. RAO,
Thank you for your reply.. This is my situation..
Here's the screenshoot of what I have right now..
[img:kquzuub3]http://i208.photobucket.com/albums/bb82/fraxzi/Tree_Checkbox.png[/img:kquzuub3]
There is bitmap for each tree Item.. can I put another bitmap after the other indicating check/uncheck? then no more :setcheck() on the second column..
Kind Regards,
Frances |
xBrowse Tree with Checkbox | You may need two bitmaps ( selected and unselected ) for the last level. Once you add bitmaps, it is a matter of changing the bBmpData of the first column. You may copy the original codeblock from the settree method and suitably modify it.
Still I personally feel that it may not look good aesthetically. My personal preference would be to insert a separate column before the present first column to show the checkboxes. This would also look similar to Windows 7 selection check boxes. |
xBrowse Treeview drag&drop | Is it possible to have drag&drop inside a xBrowse with Treeview.
Thanks in advance
Otto |
xBrowse Treeview drag&drop | Should be possible the same way. |
xBrowse Treeview drag&drop | Hello Mr. Rao,
I didn‘t found a way how to handle the index once for the group and once for the row.
I would like to order the treeitems with the mouse also to make a child a parent or a parent a child.
Would you be so kind to help on that.
Thanks in advance
Otto |
xBrowse Treeview drag&drop | Mr Otto
Our main first issue is why the drag is not working in xbrowse. May be we are missing something.
I understand your requirement. Not very easy, but that can be done. I shall work out and post some functions with which you can get the functionality you want |
xBrowse Treeview drag&drop | Dear Mr. Rao,
I would need drag&drop + treeview for a DMS system.
May I ask if you had had time to have a closer look into xBrowser if this could be done?
Thanks in advance
Otto |
xBrowse Treeview drag&drop | Drag and drop in xbrowse works from FWH 9.11 onwards. Even in some earlier versions, this should work if Kinetic scrolling is disabled. |
xBrowse VScroll from Resource doesn't work without HScroll ? | Hello,
testing the same Controls from Code and Resources,
I noticed a problem in xBrowse with [color=#FF0000:2vt6ts6g]VScroll from RESOURCE.[/color:2vt6ts6g]
From Code with [color=#FF0000:2vt6ts6g]NO HScroll[/color:2vt6ts6g], NO Problems
[img:2vt6ts6g]http://www.pflegeplus.com/pictures/xbr1.jpg[/img:2vt6ts6g]
From Resource :
without Focus, the VScroll-button ( bottom ) is not visible.
[img:2vt6ts6g]http://www.pflegeplus.com/pictures/xbr2.jpg[/img:2vt6ts6g]
xBrowse with Focus, shows the Button, but disabled and not working.
[img:2vt6ts6g]http://www.pflegeplus.com/pictures/xbr3.jpg[/img:2vt6ts6g]
With a added HScroll, VScroll works as well.
[img:2vt6ts6g]http://www.pflegeplus.com/pictures/xBr4.jpg[/img:2vt6ts6g]
Best Regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse VScroll from Resource doesn't work without HScroll ? | Mr Uwe
When using resources, we also need to set lVScroll and lHScroll to .t. or .f. depending on whether the resource has VSCROLL / HSCROLL. Have you considered this aspect please? |
xBrowse VScroll from Resource doesn't work without HScroll ? | Mr. Rao,
Thank You very much.
Yes, tested and works.
oBrw:lVScroll := .T.
[color=#FF0000:xxp4w8ll]oBrw:lHScroll := .F.[/color:xxp4w8ll]
Both must be defined using Resources, even with NO visible HScroll inside the Resource.
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse VScroll from Resource doesn't work without HScroll ? | [quote:fg7sjcm3]oBrw:lVScroll := .T.
oBrw:lHScroll := .F.
Both must be defined using Resources, even with NO visible HScroll inside the Resource.
[/quote:fg7sjcm3]
Yes. Assignments to lVScroll and lHScroll in the code should match the style of the resource. |
xBrowse W7 vs WinXP | Buenas tardes,
Se renovó una de las pc en las que trabaja mi sistema. Está nueva pc tiene Win7 y el resto WinXP.
Además de la cuestión que planteó Aida del color en los tooltips, tengo una cuestión más importante (por lo menos para mí) que es sobre el color de fondo que toma la celda que estaba activa en un xBrowse cuando el dialog pierde el foco.
En WinXP queda de un color celeste claro pero en Win7 de un gris oscuro que no deja visualizar lo escrito dentro de la celda.
Adjunto fotos mostrando lo que indico.
¿Se puede solucionar?. Gracias.
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Esto es en Win XP (funciona OK)
[img:e46e6rer]http://img801.imageshack.us/img801/3734/xbrowsewinxp.jpg[/img:e46e6rer]
Esto es en Win7 (NO se ve lo contenido en la celda del dialog que perdió el foco)
[img:e46e6rer]http://img818.imageshack.us/img818/9713/xbrowsew7.jpg[/img:e46e6rer] |
xBrowse W7 vs WinXP | Hola, Rolando.
En mi red casera tengo 1 equipo con XP y otro con W7. Los xbrowse me trabajan igual.
Te dejo aqui mi codigo: (no se si lo harás igual)
[code=fw:1jw48djo]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> aGradBarSelFocus:= <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">(</span><span style="color: #000000;">252</span>,<span style="color: #000000;">232</span>,<span style="color: #000000;">171</span><span style="color: #000000;">)</span> , RGB<span style="color: #000000;">(</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><span style="color: #00C800;">local</span> aGradBarSel:= <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #000000;">1</span>, RGB<span style="color: #000000;">(</span><span style="color: #000000;">252</span>,<span style="color: #000000;">235</span>, <span style="color: #000000;">184</span><span style="color: #000000;">)</span>, RGB<span style="color: #000000;">(</span><span style="color: #000000;">251</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">88</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">118</span> <span style="color: #0000ff;">OF</span> oDlg .....<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span>, aGradBarSel <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br /> :<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> CLR_BLACK, aGradBarSelFocus <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br /> END<br /> </div>[/code:1jw48djo]
Saludos. |
xBrowse W7 vs WinXP | Gracias Francisco.
No usaba :bClrSel, siempre dejé los colores de fondo y tinta por defecto. Ahora lo implementé y, como dices, funciona bien en ambos Win.
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
xBrowse With DatePicker & TimePicker | Saludos/Regards
Hoy les dejo otra contribucion para la xBrowse, uso de DatePicker y TimePicker en edicion de celdas.
Other contribution for xbrowse class, use datepicker and timepicker in celledition
Comenzamos/Start
Este Link es un Exe si quieren probar antes de hacer cambios
this link is EXE, if you want to try first before making any changes ...
[url:3f641pz4]http://www.sitasoft.com/fivewin/test/testdtp.rar[/url:3f641pz4]
[b:3f641pz4]Archivos a editar / file to edit[/b:3f641pz4]
xbrowse.ch
xbrowse.prg
[b:3f641pz4]Metodos a Editar en xBrowse.prg/ Methods to Edit in xBrwose.prg[/b:3f641pz4]
METHOD PaintData() CLASS TXBrwColumn
METHOD Edit() CLASS TXBrwColumn
function EditGetkeyDown()
METHOD PostEdit() CLASS TXBrwColumn
[b:3f641pz4]Abrir/open xBrowse.ch[/b:3f641pz4]
[b:3f641pz4]Buscar / find[/b:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> EDIT_GET_BUTTON <span style="color: #000000;">5</span></div>[/code:3f641pz4]
[i:3f641pz4][b:3f641pz4]Agregar Despues/ Add After[/b:3f641pz4][/i:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> EDIT_DATE <span style="color: #000000;">6</span><br /><span style="color: #00D7D7;">#define</span> EDIT_TIME <span style="color: #000000;">7</span></div>[/code:3f641pz4]
[b:3f641pz4]Guardar/save[/b:3f641pz4]
[b:3f641pz4]Abrir xBrowse.prg[/b:3f641pz4]
[b:3f641pz4]Bucar / Find[/b:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Report.ch"</span></div>[/code:3f641pz4]
[i:3f641pz4][b:3f641pz4]Agregar Despues / Add After[/b:3f641pz4][/i:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dtpicker.ch"</span></div>[/code:3f641pz4]
[b:3f641pz4]Buscar METHOD nEditType(); // Sets or Gets de Edit Mode / Find METHOD nEditType(); // Sets or Gets de Edit Mode[/b:3f641pz4]
[i:3f641pz4][b:3f641pz4]Agregar Antes / Add Before[/b:3f641pz4][/i:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">METHOD</span> EditDateTime<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span></div>[/code:3f641pz4]
[b:3f641pz4]Buscar en METHOD PaintData() / Find in METHOD PaintData()[/b:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> nType > <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">if</span> lSelected<br /> </div>[/code:3f641pz4]
[i:3f641pz4][b:3f641pz4]Reemplazar con / Replace With[/b:3f641pz4][/i:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> nType > <span style="color: #000000;">1</span> .and. nType < EDIT_DATE<br /> <span style="color: #00C800;">if</span> lSelected</div>[/code:3f641pz4]
[b:3f641pz4]Buscar en Method Edit / Find In Edit Method[/b:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"> aColors := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrEdit</span> <span style="color: #000000;">)</span></div>[/code:3f641pz4]
[i:3f641pz4][b:3f641pz4]Agregar Antes / Add Before[/b:3f641pz4][/i:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nEditType</span> >= EDIT_DATE<br /> <span style="color: #00C800;">return</span> ::<span style="color: #000000;">EditDateTime</span><span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:3f641pz4]
[b:3f641pz4]Buscar en function EditGetkeyDown / Find in function EditGetkeyDown[/b:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">If</span> lExit<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> := nKey<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span></div>[/code:3f641pz4]
[i:3f641pz4][b:3f641pz4]Reemplazar con / Replace With[/b:3f641pz4][/i:3f641pz4][color=#FF0000:3f641pz4] please check it in [url:3f641pz4]http://forums.fivetechsupport.com/viewtopic.php?p=76306#p76306[/url:3f641pz4][/color:3f641pz4] (see post bellow)
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">If</span> lExit .and. ::<span style="color: #000000;">nEditType</span> != EDIT_DATE<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> := nKey<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">PostEdit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span></div>[/code:3f641pz4]
[b:3f641pz4]Buscar en function EditGetkeyDown / Find in function EditGetkeyDown[/b:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3f641pz4]
[i:3f641pz4][b:3f641pz4]Agregar Depues / Add After[/b:3f641pz4][/i:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> EditDateTime<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn<br /><span style="color: #00C800;">local</span> aColors<br /><span style="color: #00C800;">local</span> lCenter, lRight<br /><span style="color: #00C800;">local</span> nRow, nCol, nWidth, nHeight<br /><span style="color: #00C800;">local</span> hBrush<br /><span style="color: #00C800;">local</span> oFont<br /><span style="color: #00C800;">local</span> uValue<br /><br /><br /><br /> <span style="color: #00C800;">if</span> ValType <span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditFont</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span><br /> oFont = Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditFont</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> oFont = ::<span style="color: #000000;">oEditFont</span><br /> <span style="color: #00C800;">endif</span><br /><br /> uValue := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bEditValue</span> <span style="color: #000000;">)</span><br /><br /> aColors := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrEdit</span> <span style="color: #000000;">)</span><br /> lCenter := <span style="color: #000000;">(</span> ::<span style="color: #000000;">nDataStrAlign</span> == AL_CENTER <span style="color: #000000;">)</span><br /> lRight := <span style="color: #000000;">(</span> ::<span style="color: #000000;">nDataStrAlign</span> == AL_RIGHT <span style="color: #000000;">)</span><br /><br /> nRow := <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowSel</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> * ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowHeight</span> <span style="color: #000000;">)</span> + ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">HeaderHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> hBrush := CreateSolidBrush<span style="color: #000000;">(</span> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">EraseData</span><span style="color: #000000;">(</span> nRow, ::<span style="color: #000000;">nDisplayCol</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowHeight</span> , hBrush <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hBrush <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nEditType</span> == EDIT_DATE<br /> ::<span style="color: #000000;">oEditGet</span> := TDatePick<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">{</span> | u | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span>PCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span>==<span style="color: #000000;">0</span>,uValue,uValue:= u <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ::<span style="color: #000000;">oBrw</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, , aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>,;<br /> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, oFont, .f., , , , .f., , , <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">oEditGet</span> := TTimePick<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">{</span> | u | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span>PCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span>==<span style="color: #000000;">0</span>,uValue,uValue:= u <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ::<span style="color: #000000;">oBrw</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, , aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>,;<br /> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, oFont, .f., , , , .f., , , <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">SetTime</span><span style="color: #000000;">(</span> uValue <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /> <br /> nRow := <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowSel</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> * ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowHeight</span> <span style="color: #000000;">)</span> + ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">HeaderHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #000000;">2</span><br /> nCol := ::<span style="color: #000000;">nDisplayCol</span> + <span style="color: #000000;">3</span><br /><br /> nWidth := ::<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">4</span><br /><br /> nHeight := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowHeight</span> - <span style="color: #000000;">4</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bEditValid</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> | oGet, lRet | oGet:<span style="color: #000000;">lValidating</span> := .T., lRet := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bEditValid</span>, oGet, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span>, oGet:<span style="color: #000000;">lValidating</span> := .F., <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! lRet, oGet:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>, lRet <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span> | nKey | EditGetkeyDown<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, nKey <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nEditType</span> != EDIT_DATE<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bLostFocus</span> := <span style="color: #000000;">{</span> | oGet, hWndFocus | EditGetLostFocus<span style="color: #000000;">(</span> oGet, hWndFocus, ::<span style="color: #000000;">oBrw</span>, ::<span style="color: #000000;">oEditGet</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> := <span style="color: #000000;">0</span><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> nRow, nCol, nWidth, nHeight, .t. <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">SelectAll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lEditMode</span> := .T.<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lEditBorder</span><br /> WndBoxIn<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, nRow<span style="color: #000000;">-1</span>, nCol<span style="color: #000000;">-1</span>, nRow + nHeight + <span style="color: #000000;">1</span>, nCol + nWidth + <span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> nKey != <span style="color: #00C800;">nil</span><br /> PostMessage<span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">hWnd</span>, WM_CHAR, nKey <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nLastEditCol</span> := ::<span style="color: #000000;">nPos</span> <br /> <br /> <br /><span style="color: #00C800;">RETURN</span> .t.</div>[/code:3f641pz4]
[b:3f641pz4]Buscar En METHOD PostEdit / Find In METHOD PostEdit[/b:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">case</span> ::<span style="color: #000000;">nEditType</span> == EDIT_GET</div>[/code:3f641pz4]
[i:3f641pz4]
[b:3f641pz4]En linea Agregar Despues (Fin de Linea) / IN Line Add After (end of Line)[/b:3f641pz4][/i:3f641pz4]
[code=fw:3f641pz4]<div class="fw" id="{CB}" style="font-family: monospace;">.or. ::<span style="color: #000000;">nEditType</span> >= EDIT_DATE</div>[/code:3f641pz4]
[b:3f641pz4]Guardar / Save[/b:3f641pz4]
Ejemplo / Sample...
[code=fw:3f641pz4]<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: #00D7D7;">#include</span> <span style="color: #ff0000;">"dtpicker.ch"</span><br /><br /><span style="color: #00C800;">Function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oWnd, oBrw, oBrw2, oFld<br /><span style="color: #00C800;">local</span> aArray := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"one"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"two"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"three"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"four"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"five"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /> set date format <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">"mm/dd/yyyy"</span><br /><br /> use customer <span style="color: #0000ff;">alias</span> customer <span style="color: #00C800;">new</span><br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Test DatePick and TimePick on xBrwose"</span> <br /> <br /> <br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">size</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">300</span>;<br /> <span style="color: #0000ff;">PROMPTS</span> <span style="color: #ff0000;">"Array"</span>, <span style="color: #ff0000;">"Dbf"</span> <br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">xbrowse</span> oBrw columns <span style="color: #000000;">{</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #000000;">}</span> array aArray <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> fastedit<br /> <br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">25</span><br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_TIME<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">130</span><br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_DATE<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">130</span><br /><br /> oBrw:<span style="color: #000000;">lAutoappend</span> := .f.<br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">xbrowse</span> oBrw2 columns <span style="color: #ff0000;">"first"</span>, <span style="color: #ff0000;">"last"</span>, <span style="color: #ff0000;">"hiredate"</span> <span style="color: #0000ff;">alias</span> <span style="color: #ff0000;">"customer"</span> <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> fastedit<br /> <br /> oBrw2:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">25</span><br /> <br /> <br /> oBrw2:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_DATE<br /> oBrw2:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">130</span><br /><br /> oBrw2:<span style="color: #000000;">lAutoappend</span> := .f.<br /> oBrw2:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #000000;">oClient</span> := oFld<br /> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">oClient</span> := oBrw<br /> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">oClient</span> := oBrw2<br /> <br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">init</span> <span style="color: #000000;">(</span>oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">resize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3f641pz4] |
xBrowse With DatePicker & TimePicker | Hello Daniel,
thank you.
I will make the changes this evening.
Regards,
Otto |
xBrowse With DatePicker & TimePicker | Hello Daniel,
thank you very much. These are really useful features.
One question:
Is there a reason why you must commit a change made with the mouse with the enter key?
Thanks again,
Otto |
xBrowse With DatePicker & TimePicker | thank otto for feedback
[quote:1klpynpc]One question:
Is there a reason why you must commit a change made with the mouse with the enter key?[/quote:1klpynpc]
no for me, is xbrowse, when you do edit any cell, it never commit the change with mouse only enter key |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.