topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
xBrowse Design Mode... | Thanks for the reply. But I was not able to find the file: xbrwgen.prg in samples folder. Can you please provide here? |
xBrowse Design Mode... | its actually fwh\samples\xbrgen.prg
not xbrwgen.prg |
xBrowse Designer | Dear Mr. Rao,
For my purpose it would be fine if the column width would be in the sourcecode output too.
Thanks in advance
Otto |
xBrowse Designer | Hello Otto,
is there still another xBrowse-Designer, You are talking about ( from Rao ) ???
I couldn't find any Download. Maybe included in new FWH-release ?
If Yes, there is no reason for me, to spend more time in my new Update.
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse Designer | Hello Uwe,
I am talking about [i:2mcgx516]xbrgen.prg [/i:2mcgx516]from the Fivewin samples.
I think [i:2mcgx516]xbrgen [/i:2mcgx516]is more a “data-designer” while yours is for the outlook.
So we need both of them.
Thanks for your good work.
Best regards,
Otto |
xBrowse Designer | Hello Otto,
thank You very much for the Info.
With the next Update it will be possible, to create a Window in DESIGN-Mode
( to get Dlg-Top, Left, Bottom and Right )
all selected Backgrounds are adjusted during resizing.
As well my Exit-Button stays on the Right / lower - Corner.
I would like to add a Browser in DESIGN-Mode to the Window to get all Position-Infos.
For the Moment, I test the new Solutions inside the SButton-Tools I'm working on.
DESIGN doesn't work for the Browser ( move and resize ) and I don't know why.
tested [color=#FF0000:qfkpboju]xBrwin7.prg [/color:qfkpboju]:
@ 10, 10 XBROWSE oBrw OF oDlg SIZE 300, 200 PIXEL ;
AUTOCOLS ALIAS 'CUST' BACKGROUND ""
..
..
AEval( oBrw:aCols, { | oCol | oCol:bPaintText := { | oCol, hDC, cData, aRect | ;
PaintCol( oCol, hDC, cData, aRect ) } } )
[b:qfkpboju][color=#FF0000:qfkpboju]oBrw:lDesign := .T.[/color:qfkpboju][/b:qfkpboju]
oBrw:CreateFromCode()
[img:qfkpboju]http://www.pflegeplus.com/pictures/resize10.jpg[/img:qfkpboju]
[img:qfkpboju]http://www.pflegeplus.com/pictures/resize11.jpg[/img:qfkpboju]
Using a Listbox, it works fine.
I think using a Listbox, it will be OK, because we need only the Browse-Position
Top, Left, Bottom and Right in Relation to the Window / Dialog-Frame.
[img:qfkpboju]http://www.pflegeplus.com/pictures/resize12.jpg[/img:qfkpboju]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse Disable() Problem | Hi all
I have problem with oBrw:Disable() becouse xBrowse is not disabled
example
[code=fw:1ptrg975]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><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 /><span style="color: #00C800;">local</span> oCol<br /><br /> use customer <span style="color: #00C800;">new</span> exclusive<br /> go top<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">260</span>,<span style="color: #000000;">550</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test"</span><br /><br /> @ <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">265</span>,<span style="color: #000000;">105</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> FOOTERS CELL LINES<br /><br /> ADD oCol <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> CUSTOMER->FIRST ;<br /> HEADER <span style="color: #ff0000;">"First"</span><br /><br /> ADD oCol <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> CUSTOMER->LAST ;<br /> HEADER <span style="color: #ff0000;">"Last"</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 <span style="color: #0000ff;">CENTERED</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">Disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ,;<br /> TestXBrowseDisable<span style="color: #000000;">(</span><span style="color: #000000;">)</span> ,;<br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Dialog will be closed"</span><span style="color: #000000;">)</span> ,;<br /> .t. ;<br /> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//---------------------------</span><br /><br /><span style="color: #00C800;">function</span> TestXBrowseDisable<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> nSalary := <span style="color: #000000;">0</span><br /><br />DbGoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />nSalary += Salary<br />DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">enddo</span><br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Salary SUM: "</span> + str<span style="color: #000000;">(</span>nSalary<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:1ptrg975]
I dont want xBrowse pointer to change position if xBrowse is disabled
The only solution i have found is to add MsgWait() function ...
[code=fw:1ptrg975]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">Disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, MsgWait<span style="color: #000000;">(</span>,,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> ,;<br /> TestXBrowseDisable<span style="color: #000000;">(</span><span style="color: #000000;">)</span> ,;<br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Dialog will be closed"</span><span style="color: #000000;">)</span> ,;<br /> .t. ;<br /> <span style="color: #000000;">)</span><br /> </div>[/code:1ptrg975]
But i am not sure is it functionally in any cases
Best regards, |
xBrowse Disable() Problem | You do not need to disable xbrowse to do what you wanted to do. Just save and restore the record position in your function.
[code=fw:mu3jgm4g]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> TestXBrowseKeepEnable<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> nSalary := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> nRec := RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />DbGoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />nSalary += Salary<br />DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">enddo</span><br /><br />DbGoTo<span style="color: #000000;">(</span> nRec <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Salary SUM: "</span> + str<span style="color: #000000;">(</span>nSalary<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:mu3jgm4g]
and please remove all code to disable xbrowse |
xBrowse Disable() Problem | Hi Rao
Thanks for reply
[quote:2j5mayh5]and please remove all code to disable xbrowse[/quote:2j5mayh5]
Please what do you mean with this ?
BTW
I have cases when i need to have chance to disable xbrowse report for example with 10 rows ... customer choose 5 ...
on ESC key i want to delete other 5 and on other dialog i want to ask did he want to move choosen 5 records to another table but i want still visible all 10 records on the xbrowse
[code=fw:2j5mayh5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">Disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, MsgWait<span style="color: #000000;">(</span>,,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:2j5mayh5]
work good in this case ... my question was ...why oBrw:Disable() not disable xbrowse
Best regards, |
xBrowse Double Click | In my xbrowse programs I often use a double click to trigger an action.
In recent versions of xBrowse, I am noticing that the last row or two displayed on an xBrowse are not responding to a double click. They can be highlighted, and I have a button that will trigger the event, and that works. However, the double click is the desired action. It works fine on all the other rows, but not on the last one. This is usually the last element of the browse itself.
Can this be checked to see if the behavior can be corrected. As I said, it's a relatively new ( last two versions perhaps of FWH ) problem. |
xBrowse Double Click | I tried but could not reproduce the problem.
Here is my test. I request you too try this.
[code=fw:mnmn38mb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />XBROWSER <span style="color: #ff0000;">"CUSTOMER.DBF"</span> SETUP oBrw:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">{</span> || <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"double click"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:mnmn38mb] |
xBrowse Drag & Drop | How can I adapt \samples\testdrp6.prg to be used with xBrowse, If someone has an example with a DBF, will be better...
[code=fw:3hvnghn7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// FiveWin - own Drag&Drop new features !!!</span><br /><span style="color: #B900B9;">// Drag item from one listbox to another listbox</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oCursor, oLbx, oLbx2<br /> <span style="color: #00C800;">local</span> cItem:=<span style="color: #ff0000;">""</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oCursor hand<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;">"FiveWin's own Drag & Drop features!!!"</span><br /><br /> @ <span style="color: #000000;">6</span>, <span style="color: #000000;">3</span> <span style="color: #0000ff;">LISTBOX</span> oLbx <span style="color: #0000ff;">VAR</span> cItem ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Item 1"</span>,<span style="color: #ff0000;">"Item 2"</span>,<span style="color: #ff0000;">"Item 3"</span>,<span style="color: #ff0000;">"Item 4"</span> <span style="color: #000000;">}</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">400</span><br /><br /> <span style="color: #B900B9;">// Set a DropOver action for the ListBox</span><br /> oLbx:<span style="color: #000000;">bDropOver</span> = <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> oLbx:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span> uDropInfo <span style="color: #000000;">)</span>, oLbx2:<span style="color: #000000;">del</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oLbx:<span style="color: #000000;">oDragCursor</span> = oCursor <span style="color: #B900B9;">// Select a Drag cursor</span><br /> oLbx:<span style="color: #000000;">bDragBegin</span> = <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> SetDropInfo<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">getSelText</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,; <span style="color: #B900B9;">// Save drop info !!!</span><br /> oWnd:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Dragging..."</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> @ <span style="color: #000000;">6</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">LISTBOX</span> oLbx2 <span style="color: #0000ff;">var</span> cItem;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">{</span><span style="color: #000000;">}</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">400</span><br /><br /> <span style="color: #B900B9;">// Set a DropOver action for the ListBox</span><br /> oLbx2:<span style="color: #000000;">bDropOver</span> = <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> oLbx2:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span> uDropInfo <span style="color: #000000;">)</span>, oLbx:<span style="color: #000000;">del</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oLbx2:<span style="color: #000000;">oDragCursor</span> = oCursor <span style="color: #B900B9;">// Select a Drag cursor</span><br /> oLbx2:<span style="color: #000000;">bDragBegin</span> = <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> SetDropInfo<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">getSelText</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,; <span style="color: #B900B9;">// Save drop info !!!</span><br /> oWnd:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Dragging..."</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"FiveWin - own DragDrop interface !!!"</span> <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:3hvnghn7] |
xBrowse Drag & Drop | [code=fw:f9iuvlm6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// FiveWin - own Drag&Drop new features !!!</span><br /><span style="color: #B900B9;">// Drag item from one listbox to another listbox</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oCursor, oLbx, oLbx2<br /> <span style="color: #00C800;">local</span> cItem:=<span style="color: #ff0000;">""</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oCursor hand<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;">"FiveWin's own Drag & Drop features!!!"</span><br /><br /><br /> @ <span style="color: #000000;">6</span>, <span style="color: #000000;">3</span> <span style="color: #0000ff;">XBROWSE</span> oLbx <span style="color: #0000ff;">OF</span> oWnd COLUMNS <span style="color: #000000;">1</span> ;<br /> ARRAY <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Item 1"</span>,<span style="color: #ff0000;">"Item 2"</span>,<span style="color: #ff0000;">"Item 3"</span>,<span style="color: #ff0000;">"Item 4"</span> <span style="color: #000000;">}</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">200</span><br /><br /> <span style="color: #B900B9;">// Set a DropOver action for the ListBox</span><br /> oLbx:<span style="color: #000000;">bDropOver</span> = <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> AAdd<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">aArrayData</span>, oLbx2:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> uDropInfo <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, ;<br /> ADel<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">aArrayData</span>, uDropInfo, .t. <span style="color: #000000;">)</span>, ;<br /> oLbx:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span>, oLbx2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oLbx:<span style="color: #000000;">oDragCursor</span> = oCursor <span style="color: #B900B9;">// Select a Drag cursor</span><br /> oLbx:<span style="color: #000000;">bDragBegin</span> = <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> SetDropInfo<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">)</span>,; <span style="color: #B900B9;">// Save drop info !!!</span><br /> oWnd:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Dragging..."</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> @ <span style="color: #000000;">6</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">XBROWSE</span> oLbx2 <span style="color: #0000ff;">OF</span> oWnd COLUMNS <span style="color: #000000;">1</span> ARRAY <span style="color: #000000;">{</span><span style="color: #000000;">}</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">200</span><br /> oLbx2:<span style="color: #000000;">bDropOver</span> = <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> AAdd<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">aArrayData</span>, oLbx:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> uDropInfo <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, ;<br /> ADel<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">aArrayData</span>, uDropInfo, .t. <span style="color: #000000;">)</span>, ;<br /> oLbx:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span>, oLbx2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oLbx2:<span style="color: #000000;">oDragCursor</span> = oCursor <span style="color: #B900B9;">// Select a Drag cursor</span><br /> oLbx2:<span style="color: #000000;">bDragBegin</span> = <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> SetDropInfo<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">)</span>,; <span style="color: #B900B9;">// Save drop info !!!</span><br /> oWnd:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Dragging..."</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /> oLbx:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oLbx2:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Set a DropOver action for the ListBox</span><br /><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"FiveWin - own DragDrop interface !!!"</span> <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:f9iuvlm6] |
xBrowse Drag & Drop | to Mr. nageswaragunupudi..
How to work with database files
Can I get the sample..
Thanks
Best Regards
Fafi |
xBrowse Drag & Drop | Thanks Mr. Rao, this is a nice example... I think it will of a lot of help if it's placed in the \Samples folder...
I have one question:
If I Click, Hold, Drag and Drop one array item in the same xBrowse from where it was taken, and the other xBrowse has Items, the selected Row in the other xBrowse is moved this xBrowse... and If I do the same and there are no more array items in the other xBrowse, I get a array access error....
Same thing was happening in the \samples\testdrp6.prg
How can I prevent this from happening??? |
xBrowse Drag & Drop | Fixed It with a conditional Drop:
If( !Empty( uDropInfo ) .and. LEN(aLbx2) <> 0
[code=fw:264ijjs7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// FiveWin - own Drag&Drop new features !!!</span><br /><span style="color: #B900B9;">// Drag item from one listbox to another listbox</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oCursor, oLbx, oLbx2<br /> <span style="color: #00C800;">local</span> cItem:=<span style="color: #ff0000;">""</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oCursor hand<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;">"FiveWin's own Drag & Drop features!!!"</span><br /><br /> aLbx := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Item 1"</span>,<span style="color: #ff0000;">"Item 2"</span>,<span style="color: #ff0000;">"Item 3"</span>,<span style="color: #ff0000;">"Item 4"</span> <span style="color: #000000;">}</span><br /> @ <span style="color: #000000;">6</span>, <span style="color: #000000;">3</span> <span style="color: #0000ff;">XBROWSE</span> oLbx <span style="color: #0000ff;">OF</span> oWnd COLUMNS <span style="color: #000000;">1</span> ;<br /> ARRAY aLbx <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">300</span><br /><br /> WITH OBJECT oLbx<br /> :<span style="color: #000000;">bDropOver</span> = <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> !Empty<span style="color: #000000;">(</span> uDropInfo <span style="color: #000000;">)</span> .and. LEN<span style="color: #000000;">(</span>aLbx2<span style="color: #000000;">)</span> <> <span style="color: #000000;">0</span> , <span style="color: #000000;">(</span> AAdd<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">aArrayData</span>, oLbx2:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> uDropInfo <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> , ;<br /> ADel<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">aArrayData</span>, uDropInfo, .t. <span style="color: #000000;">)</span>, ;<br /> oLbx:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span>, oLbx2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> , <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">oDragCursor</span> = oCursor <span style="color: #B900B9;">// Select a Drag cursor</span><br /> :<span style="color: #000000;">bDragBegin</span> = <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> SetDropInfo<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">)</span>,; <span style="color: #B900B9;">// Save drop info !!!</span><br /> oWnd:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Dragging..."</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> END<br /><br /> aLbx2 := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> @ <span style="color: #000000;">6</span>, <span style="color: #000000;">45</span> <span style="color: #0000ff;">XBROWSE</span> oLbx2 <span style="color: #0000ff;">OF</span> oWnd COLUMNS <span style="color: #000000;">1</span> ARRAY aLbx2 <span style="color: #0000ff;">size</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">300</span><br /> WITH OBJECT oLbx2<br /> :<span style="color: #000000;">bDropOver</span> = <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> !Empty<span style="color: #000000;">(</span> uDropInfo <span style="color: #000000;">)</span> .and. LEN<span style="color: #000000;">(</span>aLbx<span style="color: #000000;">)</span> <> <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> AAdd<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">aArrayData</span>, oLbx:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> uDropInfo <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, ;<br /> ADel<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">aArrayData</span>, uDropInfo, .t. <span style="color: #000000;">)</span>, ;<br /> oLbx:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span>, oLbx2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> , <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">oDragCursor</span> = oCursor <span style="color: #B900B9;">// Select a Drag cursor</span><br /> :<span style="color: #000000;">bDragBegin</span> = <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> SetDropInfo<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">)</span>,; <span style="color: #B900B9;">// Save drop info !!!</span><br /> oWnd:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Dragging..."</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> END<br /><br /><br /><br /> oLbx:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oLbx2:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Set a DropOver action for the ListBox</span><br /><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"FiveWin - own DragDrop interface !!!"</span> <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:264ijjs7] |
xBrowse Drag & Drop | Too Soon...
How can I detect from which browse es the Record comming from???
I want to prevent the Record of being Dropped in the xBrowse from which it was taken... |
xBrowse Drag & Drop | It may not be the pretiest and right way to doit, but I got it working like this:
nXBrow := x
[code=fw:1j72c515]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// FiveWin - own Drag&Drop new features !!!</span><br /><span style="color: #B900B9;">// Drag item from one listbox to another listbox</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oCursor, oLbx, oLbx2<br /> <span style="color: #00C800;">local</span> cItem:=<span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">local</span> nxBrow := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> aLbx := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Item 1"</span>,<span style="color: #ff0000;">"Item 2"</span>,<span style="color: #ff0000;">"Item 3"</span>,<span style="color: #ff0000;">"Item 4"</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> aLbx2 := <span style="color: #000000;">{</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oCursor hand<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;">"FiveWin's own Drag & Drop features!!!"</span><br /> <br /> @ <span style="color: #000000;">6</span>, <span style="color: #000000;">3</span> <span style="color: #0000ff;">XBROWSE</span> oLbx <span style="color: #0000ff;">OF</span> oWnd COLUMNS <span style="color: #000000;">1</span> ;<br /> ARRAY aLbx <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">300</span><br /><br /> WITH OBJECT oLbx<br /> :<span style="color: #000000;">bDropOver</span> = <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> !Empty<span style="color: #000000;">(</span> uDropInfo <span style="color: #000000;">)</span> .and. LEN<span style="color: #000000;">(</span>aLbx2<span style="color: #000000;">)</span> <> <span style="color: #000000;">0</span> .and. nxBrow <> <span style="color: #000000;">1</span> , <span style="color: #000000;">(</span> AAdd<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">aArrayData</span>, oLbx2:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> uDropInfo <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> , ;<br /> ADel<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">aArrayData</span>, uDropInfo, .t. <span style="color: #000000;">)</span>, ;<br /> oLbx:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span>, oLbx2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> , <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">oDragCursor</span> = oCursor <span style="color: #B900B9;">// Select a Drag cursor</span><br /> :<span style="color: #000000;">bDragBegin</span> = <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> nxBrow := <span style="color: #000000;">1</span> , ;<br /> SetDropInfo<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">)</span>,; <span style="color: #B900B9;">// Save drop info !!!</span><br /> oWnd:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Dragging..."</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> END<br /><br /> @ <span style="color: #000000;">6</span>, <span style="color: #000000;">45</span> <span style="color: #0000ff;">XBROWSE</span> oLbx2 <span style="color: #0000ff;">OF</span> oWnd COLUMNS <span style="color: #000000;">1</span> ARRAY aLbx2 <span style="color: #0000ff;">size</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">300</span><br /> WITH OBJECT oLbx2<br /> :<span style="color: #000000;">bDropOver</span> = <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> !Empty<span style="color: #000000;">(</span> uDropInfo <span style="color: #000000;">)</span> .and. LEN<span style="color: #000000;">(</span>aLbx<span style="color: #000000;">)</span> <> <span style="color: #000000;">0</span> .and. nxBrow <> <span style="color: #000000;">2</span> , <span style="color: #000000;">(</span> AAdd<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">aArrayData</span>, oLbx:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> uDropInfo <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, ;<br /> ADel<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">aArrayData</span>, uDropInfo, .t. <span style="color: #000000;">)</span>, ;<br /> oLbx:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span>, oLbx2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> , <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">oDragCursor</span> = oCursor <span style="color: #B900B9;">// Select a Drag cursor</span><br /> :<span style="color: #000000;">bDragBegin</span> = <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> nxBrow := <span style="color: #000000;">2</span> , ;<br /> SetDropInfo<span style="color: #000000;">(</span> oLbx2:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">)</span>,; <span style="color: #B900B9;">// Save drop info !!!</span><br /> oWnd:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Dragging..."</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> END<br /><br /><br /> oLbx:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oLbx2:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Set a DropOver action for the ListBox</span><br /><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"FiveWin - own DragDrop interface !!!"</span> <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:1j72c515] |
xBrowse Drag & Drop Question | Hi,
I have an MDI window that can open up multiple child windows that contain transactions sorted by a sequence number.
I want to have the ability to drag one or more records from one browse to either another point in the same browse or to another point in another browse.
I can get the system to work fine if you are dragging and dropping in the same browse, but if i try to drop on another browse, the system does not reposition itself to where i release the mouse button. I've tried to do a ::oBrw:lButtonDown, ::oBrw:lButtonUp but it doesnt seem to work, the system just inserts the transactions at the current browse position instead of the mouse position. If i could reproduce the act of pressing the mouse button at the release point, the insert would work fine I think. For reference each window is a class object which i store a reference to the window and browse used.
FW 06.10 & xHarbour commercial
Thanks in advance
Pete |
xBrowse Drag & Drop Question | It is possible to have drag and drop on the same browse or a different browse. There is a recent post on this subject by Mr Otto with a nice example. |
xBrowse Drag & Drop Question | Couldnt find the post - only could find where the drag would start even though you are not dragging! |
xBrowse Drag & Drop Question | Pete:
I had a similar situation dragging/dropping between two browses. In this case I'm browsing two arrays. I refer to browse 1 as a "Time" browse and browse 2 as a "Timeless" browse.
Here are the drag/drop definitions for each browse:
oBrw:bDragBegin := { |nRow,nCol,nKeyFlags| ;
SetDropInfo( {oBrw:nColSel, oBrw:nArrayAt, "B1"} ), oWnd:SetMsg("Dragging") }
oBrw:bDropOver := { |uDropInfo, nRow, nCol, nKeyFlags | ;
DragDrop(uDropInfo,nRow,nCol,nKeyFlags,oBrw,oBrw2) }
oBrw2:bDragBegin := { |nRow,nCol,nKeyFlags| ;
SetDropInfo( {oBrw2:nColSel, oBrw2:nArrayAt, "B2"} ), oWnd:SetMsg("Dragging") }
oBrw2:bDropOver := { |uDropInfo, nRow, nCol, nKeyFlags | ;
DragDrop2(uDropInfo,nRow,nCol,nKeyFlags,oBrw,oBrw2) }
As you can see I'm saving a value (B1,B2) so I can later determine which browse they are dropping to.
Here is the drag/drop functions for each browse. I hope this is not too convoluted as I've tried to cut out my code that is not applicable to your question.
STATIC FUNCTION DragDrop(uDropInfo,nRow,nCol,nKeyFlags,oBrw,oBrw2)
LOCAL nColPos
LOCAL x,i
LOCAL nRowFrom, nColFrom
LOCAL nRowTo, nColTo
LOCAL uButtonDown
LOCAL aPoint
// Dragging from time browse and dropping on time browse.
IF uDropInfo[3] == "B1"
// Reposition browse cursor to drop location
oBrw:lButtonDown(nRow, nCol, nKeyFlags)
oBrw:lButtonUp(nRow, nCol, nKeyFlags)
// Get the drop to row and column
nRowTo := oBrw:Cargo
nColTo := oBrw:nColSel
// Dragging from timeless browse & dropping on time browse
ELSE
// Reposition browse cursor to drop location
if nRow > 32000
nRow = - ( 65535 - nRow )
endif
if nCol > 32000
nCol = - ( 65535 - nCol )
endif
aPoint = { nRow, nCol }
aPoint = ClientToScreen( GetFocus(), aPoint )
ScreenToClient( oBrw:hWnd, aPoint )
nRow := aPoint[1]
nCol := aPoint[2]
uButtonDown := oBrw:lButtonDown(nRow, nCol, nKeyFlags)
oBrw:lButtonUp(nRow, nCol, nKeyFlags)
// Unable to set row,col on browse. Must have dropped somewhere outside valid cell
IF uButtonDown = nil
RETURN NIL
ENDIF
// Get the drop to row and column
nRowTo := oBrw:Cargo
nColTo := oBrw:nColSel
ENDIF
// Initialize the drop FROM row and column variables
nColFrom := uDropInfo[1]
nRowFrom := uDropInfo[2]
i := nRowFrom
// Set column we are dragging from
nColPos := nColFrom
IF uDropInfo[3] == "B1"
// Do some of my own stuff..
// Set column we are dragging to
nColPos := nColTo
// Get subscript for new date/time
IF nColPos == 1
.. Do some things here
oBrw:Refresh()
ENDIF
ELSE
... Do some things
// Set column we are dragging to
nColPos := nColTo
oBrw:Refresh()
ENDIF
oBrw2:Refresh()
RETURN NIL
STATIC FUNCTION DragDrop2(uDropInfo,nRow,nCol,nKeyFlags,oBrw,oBrw2)
LOCAL nColPos
LOCAL x,y,i
LOCAL nRowFrom, nColFrom
LOCAL nRowTo, nColTo
LOCAL uButtonDown
local aPoint
// Dragging from time browse and dropping on timeless browse.
IF uDropInfo[3] == "B1"
// Reposition browse cursor to drop location
if nRow > 32000
nRow = - ( 65535 - nRow )
endif
if nCol > 32000
nCol = - ( 65535 - nCol )
endif
aPoint = { nRow, nCol }
aPoint = ClientToScreen( GetFocus(), aPoint )
ScreenToClient( oBrw2:hWnd, aPoint )
nRow := aPoint[1]
nCol := aPoint[2]
uButtonDown := oBrw2:lButtonDown(nRow, nCol, nKeyFlags)
oBrw2:lButtonUp(nRow, nCol, nKeyFlags)
// Unable to set row,col on browse. Must have dropped somewhere outside valid cell.
IF uButtonDown = nil
RETURN NIL
ENDIF
// Get the drop to row and column
nRowTo := oBrw2:Cargo
nColTo := oBrw2:nColSel
// Dragging & dropping on timeless browse
ELSE
// Reposition browse cursor to drop location
oBrw2:lButtonDown(nRow, nCol, nKeyFlags)
oBrw2:lButtonUp(nRow, nCol, nKeyFlags)
// Get the drop to row and column
nRowTo := oBrw2:Cargo
nColTo := oBrw2:nColSel
ENDIF
nColFrom := uDropInfo[1]
nRowFrom := uDropInfo[2]
i := nRowFrom
// Set column we are dragging from
nColPos := nColFrom
IF uDropInfo[3] == "B1"
... Do some things here
// Set column we are dragging to
nColPos := nColTo
ELSE
... Do some things here
// Set subscript into array based on column position
IF nColPos == 2
... Do some checking here
ELSE
// Couldn't determine, i.e. must be invalid
RETURN NIL
ENDIF
// Set column we are dragging to
nColPos := nColTo
ENDIF
... Do some things
RETURN NIL |
xBrowse Drag & Drop Question | Pete:
Also, I saved the row in the browse cargo:
oBrw:bSkip := { | nSkip, nOld | ;
iif(nSkip == nil, nSkip := 1, ),;
nOld := oBrw:nArrayAt,;
oBrw:nArrayAt += nSkip,;
oBrw:nArrayAt := Min( Max( oBrw:nArrayAt, 1 ), len( oBrw:aArrayData ) ),;
oBrw:cargo := oBrw:nArrayAt, oBrw:nArrayAt - nOld }
Regards,
Randal |
xBrowse Drag Error when Kinetic scrolling is enabled | I am using FWH 9.08
I have done what Mr.Antonio has suggested to make Kinetic scroll optional, available in this thread <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=16905&p=87669#p87669">viewtopic.php?f=3&t=16905&p=87669#p87669</a><!-- l -->
When I enable oBrw:lKinetic:=.T. an error occurs only when I try to drag a row upwards, but if I drag the row downward it is working fine
Am I doing anything wrong ?
Here is my the error log
[list:16xybv53]Application
===========
Path and name: D:\Apps\WinAcs\WinAcs.Exe (32 bits)
Size: 2,712,576 bytes
Time from start: 0 hours 0 mins 18 secs
Error occurred at: 30/10/2009, 15:18:36
Error description: Error DBCMD/2001 Workarea not in use: DBSKIP
Args:
Stack Calls
===========
Called from: => DBSKIP(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:MOUSEMOVE(3199)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1453)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(9921)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: User.Prg => USERRIGHTS(703)
Called from: WinAcs.Prg => (b)BUILDMENU(635)
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(437)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(1003)
Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND(243)
Called from: => TMDIFRAME:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(952)
Called from: WinAcs.Prg => MAIN(63)[/list:u:16xybv53]
Here is the code used to Define xBrowse
[code=fw:16xybv53]<div class="fw" id="{CB}" style="font-family: monospace;">aMenuOptions:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Add"</span> ,.T.<span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Edit"</span> ,.T.<span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Delete"</span> ,.F.<span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Print"</span> ,.T.<span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Show Data on Grid/Browse"</span>,.T.<span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Export Data to Excel"</span> ,.F. <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br />@ <span style="color: #000000;">0</span>,<span style="color: #000000;">420</span> <span style="color: #0000ff;">XBROWSE</span> oBrwMenuOptions ;<br /> COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> ;<br /> HEADERS <span style="color: #ff0000;">"Functionalities"</span>, <span style="color: #ff0000;">"Status"</span> ;<br /> <span style="color: #0000ff;">OF</span> oDlg ;<br /> ARRAY aMenuOptions <br /><br />oBrwMenuOptions:<span style="color: #000000;">nMarqueeStyle</span>:=MARQSTYLE_HIGHLROWRC<br />oBrwMenuOptions:<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;">nWidth</span>:=<span style="color: #000000;">195</span><br />oBrwMenuOptions:<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;">50</span><br />oBrwMenuOptions:<span style="color: #000000;">nRowHeight</span>:=<span style="color: #000000;">20</span> <span style="color: #B900B9;">//17</span><br />oBrwMenuOptions:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span> || oApp:<span style="color: #000000;">aClrCol</span><span style="color: #000000;">[</span> oBrwMenuOptions:<span style="color: #000000;">KeyNo</span> % <span style="color: #000000;">2</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">// Alternative way to display BMP, if multiple conditions and more than 2 bitmaps are there</span><br />oBrwMenuOptions:<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;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"CheckOn"</span><span style="color: #000000;">)</span><br />oBrwMenuOptions:<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;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"CheckOff"</span><span style="color: #000000;">)</span><br />oBrwMenuOptions:<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;">bBmpData</span> :=<span style="color: #000000;">{</span> || iif<span style="color: #000000;">(</span>oBrwMenuOptions:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>oBrwMenuOptions:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br />oBrwMenuOptions:<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;">bStrData</span>:=<span style="color: #000000;">{</span> || <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// Avoid showing .T. .F. in the column</span><br /><br /><span style="color: #B900B9;">// Change Tick Off/On when Clicked and ensure that this happens only in Column 2</span><br />oBrwMenuOptions:<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol | iif<span style="color: #000000;">(</span>oBrwMenuOptions:<span style="color: #000000;">nColSel</span> == <span style="color: #000000;">2</span>, oBrwMenuOptions:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>oBrwMenuOptions:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:=!oBrwMenuOptions:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>oBrwMenuOptions:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> ,<span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span>,oBrwMenuOptions:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">// Enable user to either use Enterkey or Spacebar to change the value in Checkbox</span><br />oBrwMenuOptions:<span style="color: #000000;">bKeyDown</span>= <span style="color: #000000;">{</span>|nKey| <span style="color: #000000;">(</span> oBrwMenuOptions:<span style="color: #000000;">nColSel</span>:=<span style="color: #000000;">2</span> ,; <span style="color: #B900B9;">// else ie Menu items</span><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> nKey == VK_RETURN .or. nKey == VK_SPACE,;<br /> <span style="color: #000000;">(</span>oBrwMenuOptions:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>oBrwMenuOptions:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:=!oBrwMenuOptions:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span>oBrwMenuOptions:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,oBrwMenuOptions:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br />oBrwMenuOptions:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:16xybv53]
Regards
Anser |
xBrowse Drag Error when Kinetic scrolling is enabled | You must be using version 9.08, when Kinetic scrolling was first introduced.
In this version of XBrowse, there is bug in line 3199
Please replace "Skip( -1 )" as "::Skip( -1 )" in line 3199 of XBrowse.Prg ( version 9.08 )
This bug is fixed in version 9.09 |
xBrowse Drag Error when Kinetic scrolling is enabled | Dear Mr.Rao,
[quote:2szffi2b]Please replace "Skip( -1 )" as "::Skip( -1 )" in line 3199 of XBrowse.Prg ( version 9.08 )[/quote:2szffi2b]
Thank you. Your solution worked.
May I ask you one more doubt <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> .
At present the code oBrw:lKinetic := .T./.F. is making Kinetic scrolling enabled/disabled on all the xBrowse's in the application. What would be the changes required in xBrowse class so that I can have 2 xbrowses in a dialog, one with kinetic scrolling and another one without kinetic scrolling.
Regards
Anser |
xBrowse Drag Error when Kinetic scrolling is enabled | lKinetic is implemented as CLASSDATA. So it applies to all browses. That is the way it is implemented now.
I am sure FWH can implement what you like to do. |
xBrowse Drag Error when Kinetic scrolling is enabled | Anser,
[quote:1wu45cg9]What would be the changes required in xBrowse class so that I can have 2 xbrowses in a dialog, one with kinetic scrolling and another one without kinetic scrolling.[/quote:1wu45cg9]
This may not be a good design. Users will be confused by the browses not working the same way.
Regards,
James |
xBrowse Drag Error when Kinetic scrolling is enabled | Mr James
>>
This may not be a good design. Users will be confused by the browses not working the same way.
>>
Personally I agree with you and I am for providing a consistent design through out an application.
Still there is no reason, why the library should not offer the flexibility to the programmer. Let the programmer decide what he desires to do with the flexibility. |
xBrowse Drag Error when Kinetic scrolling is enabled | Mr Anser
Your question:
>>
What would be the changes required in xBrowse class so that I can have 2 xbrowses in a dialog, one with kinetic scrolling and another one without kinetic scrolling.
>>
If you like to modify your XBrowse class or have a derived class, this is my suggestion.
In the XBrowse.prg create a new DATA lKineticBrw ( between CLASS TXBrowse and END CLASS)
In both methods New() and Redefine, initialize this DATA to the CLASS DATA lKinetic and use lKineticBrw instead of lKinetic in the MouseMove method.
[code=fw:d3a4j1yx]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span> and also <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Redefine</span><br />...<br />...<br />::<span style="color: #000000;">lKineticBrw</span> := ::<span style="color: #000000;">lKinetic</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #00C800;">METHOD</span> MouseMove<span style="color: #000000;">(</span>..<span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// ::lPressed := ::lKinetic // Instead of this line</span><br /> ::<span style="color: #000000;">lPressed</span> := ::<span style="color: #000000;">lKineticBrw</span> <span style="color: #B900B9;">// Substitute this line</span><br /><br />...<br /><br /> </div>[/code:d3a4j1yx]
Now, if you set .t. or .f. to TXBrowse():lKinetic, this has a global effect.
When you set .t. or .f. to oBrw:lKineticBrw, this overrides the global setting and has effect only on that browse. |
xBrowse Drag Error when Kinetic scrolling is enabled | Dear MR.Rao,
Thank you for the help
[quote:1tyidswn]>>
This may not be a good design. Users will be confused by the browses not working the same way.
>>
Personally I agree with you and I am for providing a consistent design through out an application.
Still there is no reason, why the library should not offer the flexibility to the programmer. Let the programmer decide what he desires to do with the flexibility.[/quote:1tyidswn]
I too insist on consistent design through out an application. But at certain times there may be specific situations to have an exception. As you rightly said "Let the programmer decide what he needs" and would be nice if the library provide that flexibility to the programmer
Regards
Anser |
xBrowse EDIT_GET_BUTTON | Dear Antonio / Mr. Rao.
the clause EDIT_GET_BUTTON has little documentation and i need your help (Fwh 1202)
This is my code to define a column:
[code=fw:fbfuyt2w]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrwDeta <span style="color: #0000ff;">ID</span> <span style="color: #000000;">301</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> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"TMPD"</span><br /> ....<br /><br /> nx := len<span style="color: #000000;">(</span>oBrwDeta:<span style="color: #000000;">aCols</span><span style="color: #000000;">)</span><br /> oBrwDeta:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> nx <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br /> oBrwDeta:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> nx <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span> | r,c,o | o:<span style="color: #000000;">value</span> := PickPrd<span style="color: #000000;">(</span>o:<span style="color: #000000;">value</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oBrwDeta:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> nx <span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">(</span> tmpd-><span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, TMPD->CODPRD := xVal,<span style="color: #000000;">)</span>,;<br /> oBrwDeta:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br /> </div>[/code:fbfuyt2w]
The question is: Is there a way to assign a firekey to call my function in :bEditBlock ?
example:
[code=fw:fbfuyt2w]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oBrwDeta:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> nx <span style="color: #000000;">]</span>:<span style="color: #000000;">bToolTip</span> := <span style="color: #000000;">{</span>|| oBrwDeta:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> nx <span style="color: #000000;">]</span>:<span style="color: #000000;">cToolTip</span> := <span style="color: #ff0000;">"Press F2 to call list"</span> <span style="color: #000000;">}</span><br /> </div>[/code:fbfuyt2w]
When you are doing an invoice with many items, the user is more alike to use the keyboard instead of clicking in the small button with the mouse.
I would apreciate much if you send a small sample
Thanks for your reply
Ralph |
xBrowse EDIT_GET_BUTTON | One more thing (i think it is a bug):
When the user enter the data directly with the keyboard in the editable column, the :bOnPostEdit is evaluated.
But, when clicking the small button and : bEditBlock is evaluated returning a value, the :bOnPostEdit is NOT evaluated.
Thank for you answer.
Ralph |
xBrowse EDIT_GET_BUTTON | bEditBlock should return the new value, if the value is changed or NIL if the value is not to be changed.
This line:
oBrwDeta:aCols[ nx ]:bEditBlock := { | r,c,o | o:value := PickPrd(o:value) }
should be re-written as :
oBrwDeta:aCols[ nx ]:bEditBlock := { | r,c,o | PickPrd(o:value) }
PickPrd(...) function should return the new value if edited or NIL if no change is required.
Let me assure you that there is no bug and this works correctly. |
xBrowse EDIT_GET_BUTTON | Ralph;
As for the F2 to open a list, you could try to implement in :bKeyDown, as in:
[code=fw:q0q5tq84]<div class="fw" id="{CB}" style="font-family: monospace;"><br />WITH OBJECT ::<span style="color: #000000;">oBrw</span><br /><br /> :<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span>|nKey| isControl := GetKeyState<span style="color: #000000;">(</span> VK_CONTROL <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> nKey == VK_F2, EVAL<span style="color: #000000;">(</span> bOpen <span style="color: #000000;">)</span>,;<br />...<br /> </div>[/code:q0q5tq84]
Reinaldo. |
xBrowse EDIT_TIME | How to display hh:mm column in xbrowse and not hh:mm:ss? |
xBrowse EDIT_TIME | oCol:bStrData := {|| SubStr(oBrw:aCols[2]:Value(),1,5) }
as display.. but when editing time format is hh:mm:ss even if I changed Set( _SET_TIMEFORMAT, "hh:mm") |
xBrowse EDIT_TIME | perhpas you must use a text field "hh:mm:ss" |
xBrowse EDIT_TIME | Thanks for the reply.
Since it is a string format, I dont need to validate it as valid time.. I just trim and ignore the seconds. |
xBrowse ERROR | Hi
I have any time this error on my application
How to resolve it ???
Error DBCMD/2001 Workarea non in use: __DBSKIPPER
Stack-List
==========
Called from: => __DBSKIPPER(0)
Called from: fiveh\xbrowse.prg => (b)TXBROWSE_SETRDD(3936)
Called from: fiveh\xbrowse.prg => (b)TXBROWSE(436)
Called from: fiveh\xbrowse.prg => TXBROWSE:SKIP(0)
Called from: fiveh\xbrowse.prg => TXBROWSE:CALCROWSELPOS(1298)
Called from: fiveh\xbrowse.prg => TXBROWSE:REFRESH(1274)
Called from: XBRWDBF.PRG => (b)XBRW_DB(169)
Thanks to all |
xBrowse ERROR | Are you setting the xbrowse alias of the database?
James |
xBrowse ERROR | Yes
sometimes goes to error when I close the window
not always |
xBrowse ERROR | Like James suggested :
[color=#0000FF:28zq8vev][b:28zq8vev]DBSELECTAREA("CUST")[/b:28zq8vev][/color:28zq8vev]
@ 35, 15 XBROWSE oBrw OF oXbrDlg1 ;
SIZE 400, 176 PIXEL ;
[color=#0000FF:28zq8vev][b:28zq8vev]ALIAS "CUST"[/b:28zq8vev][/color:28zq8vev] CELL LINES
...
...
Best regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse ERROR | Can we see your code for the browse?
James |
xBrowse ERROR | the problem is when i close the window
anytime go to error
regards
********************************************************************************************************************* // xBROWSE
Function XBRW_DB(nDBF,aDB,nFUN,nDES,nSRC,nSTA,nFIL,nBUT,oUSR,nSCH,nICO,bSALDO,nTAG,bCOLOR,bPOP,oFONT,bGO,nUFLT,bUKEY)
Local oWIN,oICO,oXDBF,oBAR,oPOPEXP
Local oBRW,nUSR:=0
Local oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP
Local nUNO:=StrTran(IIF(AT("/",nDES)>0,Left(nDES,Len(nDES)-2),nDES) ,CHR(34),"")
Local nDUE:=StrTran(IIF(AT("/",nDES)>0,Left(nUNO,Len(nUNO)-1)+Right(nDES,1),nDES),CHR(34),"")
Local nTIT:=nDUE
Local nFILE:=Upper(StrTran(Alltrim(nTIT)," ","_"))
Local nARG:={}
Local nBT1:=IIF(nBUT<>NIL,IIF(AT("1",nBUT)>0,.T.,.F.),.T.) // Ins
Local nBT2:=IIF(nBUT<>NIL,IIF(AT("2",nBUT)>0,.T.,.F.),.T.) // Mod
Local nBT3:=IIF(nBUT<>NIL,IIF(AT("3",nBUT)>0,.T.,.F.),.T.) // Can
Local nBT4:=IIF(nBUT<>NIL,IIF(AT("4",nBUT)>0,.T.,.F.),.T.) // Vis
Local nBT5:=IIF(nBUT<>NIL,IIF(AT("5",nBUT)>0,.T.,.F.),.T.) // Ante
Local nBT6:=IIF(nBUT<>NIL,IIF(AT("6",nBUT)>0,.T.,.F.),.T.) // Stampa
Local nBT7:=IIF(nBUT<>NIL,IIF(AT("7",nBUT)>0,.T.,.F.),.T.) // Ricerca
Local nBT8:=IIF(nBUT<>NIL,IIF(AT("8",nBUT)>0,.T.,.F.),.T.) // Filtro
Local nBT9:=IIF(nBUT<>NIL,IIF(AT("9",nBUT)>0,.T.,.F.),.T.) // Export
Local oBUT1,oBUT2,oBUT3,oBUT4,oBUT5,oBUT6,oBUT7,oBUT8,oBUT9
Local oSALDO,nSALDO:="",nAREA
Local nUSRFLT:=IIF(nUFLT<>NIL,.T.,.F.)
oXDBF:=APRI_DB(nDBF)
(oXDBF)->(DBSetIndex(nDBF))
IF Len(aDB) > 0
IF !Empty( aDB[1][5] )
(oXDBF)->(DBSetOrder( aDB[1][5] ))
Endif
Endif
IF nFIL<>NIL
IF !Empty(AllTrim(nFIL))
(oXDBF)->( CMFILTER( nFIL ) )
Endif
Endif
(oXDBF)->(DBGoTop())
IF bGO<>NIL
(oXDBF)->(DBGoBottom())
Endif
nAREA:=ALIAS()
IF !Empty(nICO)
DEFINE ICON oICO RESOURCE (nICO+"_ICO")
Else
DEFINE ICON oICO RESOURCE (nFUN+"_ICO")
Endif
DEFINE WINDOW oWIN MDICHILD TITLE nTIT ICON oICO FROM 0,0 TO 0,0 PIXEL
oBRW:=XBRW_CREA(oWIN,aDB,oXDBF,,oFONT,,,,,,nTAG,,bCOLOR)
nARG:={oWIN,oXDBF,oBRW,oICO,nFUN,nUNO,nDUE,nSRC,aDB,nSCH,nICO,nDBF,bSALDO,oSALDO,nTAG,bCOLOR,nUSRFLT,bUKEY}
DEFINE BUTTONBAR oBAR OF oWIN SIZE 70,60 TOP
oBAR:l2007:=.T.
...
oBRW:bKeyDown :={|Key| XBRW_KEY(Key,nARG,oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP,bUKEY)}
oBRW:bRClicked :={|R,C| XBRW_POP(R,C,nARG,oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP,bPOP)}
oWIN:oClient:=oBRW
oWIN:SetControl(oBRW)
ACTIVATE WINDOW oWIN ON INIT WndAdjClient(oWIN:hWnd) ;
VALID ( oBrw:bKeyCount:={||0} , oBrw:bKeyNo := {||0} , CLOSE_DB(oXDBF) , .T. )
Return .T.
************************ // Close DataBase
Function CLOSE_DB(oDBF)
IF oDBF<>NIL
(oDBF)->(DBCloseArea())
Return .T.
Endif
Return .F. |
xBrowse ERROR | [code=fw:ft8f2kf3]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWIN <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> WndAdjClient<span style="color: #000000;">(</span>oWIN:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">bKeyCount</span>:=<span style="color: #000000;">{</span>||<span style="color: #000000;">0</span><span style="color: #000000;">}</span> , oBrw:<span style="color: #000000;">bKeyNo</span> := <span style="color: #000000;">{</span>||<span style="color: #000000;">0</span><span style="color: #000000;">}</span> , CLOSE_DB<span style="color: #000000;">(</span>oXDBF<span style="color: #000000;">)</span> , .T. <span style="color: #000000;">)</span></div>[/code:ft8f2kf3]
I am not sure why you are using a VALID, but what is happening is that you are closing the database before the browse, thus the browse errors out.
Try:
[code=fw:ft8f2kf3]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWIN <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> WndAdjClient<span style="color: #000000;">(</span>oWIN:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <br /><br />oXDBF:<span style="color: #000000;">close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:ft8f2kf3]
I don't see why you need to reset oBrw:nKeyCount and oBrw:nKeyNo using a VALID since the entire window is being closed.
James |
xBrowse ERROR | Also, I don't understand this syntax:
(oDBF)->(DBCloseArea())
oDBF would have to be an alias except the prefix indicates that it is a database object. This is the generic syntax:
(cAlias)->(DBCloseArea())
However if oDBF is a database object (as the prefix indicates), then you close it this way:
(oDBF:cAlias)->(DBCloseArea())
But the database class already does this in it's Close method so you can just do this:
oDBF:close()
Actually, to be consistent with standard naming (polymorphism) it technically should be:
oDBF:end()
But our TDatabase class doesn't have an End() method so we have to use the Close() method. The advantage of polymorphism is that you can end any object using the same syntax.
James |
xBrowse ERROR | I don't use the class TDatabase
oDBF is the alias of database |
xBrowse ERROR | [quote:650n11lo]oDBF is the alias of database[/quote:650n11lo]
OK, still you should change it to:
[code=fw:650n11lo]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWIN <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> WndAdjClient<span style="color: #000000;">(</span>oWIN:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span><br /><br />CLOSE_DB<span style="color: #000000;">(</span>oXDBF<span style="color: #000000;">)</span><br /> </div>[/code:650n11lo]
And your error will stop.
James |
xBrowse ERROR | [quote:8byb02xb]oDBF is the alias of database[/quote:8byb02xb]
Oh, and Hungarian notation says that the alias variable should be cAlias not oDBF. The "o" prefix is to signify an object. Then people like me would be able to read your code more easily.
And if you were using a database object, the name would be very clear as:
oDBF:cAlias
And it would be even more clear with something like:
oCustomer:cAlias
However, if you are using database objects you very rarely have to use aliases. And there are lots of other reasons for using database objects. You should consider them. For more information see my website here: <!-- m --><a class="postlink" href="http://gointellitech.com/program.htm">http://gointellitech.com/program.htm</a><!-- m -->
Regards,
James |
xBrowse ERROR | I go to try it
Thank you very much James |
xBrowse ERROR | Try pulling the focus to oBrw
[code=fw:3p2bjikr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWIN <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> WndAdjClient<span style="color: #000000;">(</span>oWIN:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> , CLOSE_DB<span style="color: #000000;">(</span>oXDBF<span style="color: #000000;">)</span> , .T. <span style="color: #000000;">)</span></div>[/code:3p2bjikr]
Excuse my English |
xBrowse ERROR | Cmsoft,
[quote:2exip8kq]Try pulling the focus to oBrw[/quote:2exip8kq]
The problem would still exist. The browse must be closed before the database is closed. Closing the database after the window is closed means that the browse is closed also. Closing the database in the VALID clause of the window means the database is closed before the browse, thus the browse errors out.
James |
xBrowse ERROR | We should close the DBF "after" the window is closed. Once the window is closed, the browse object also is destroyed.
So, we should not close the DBF in the valid clause, because the window and browse objects are still active.
When we are using MDICHILD windows, the best place to close DBF is inside the oWin:bPostEnd codeblock. This codeblock is evaluated after the window is closed (and all controls are destroyed)
Please close the DBF in the oWin:bPostEnd codeblock.
[code=fw:1o7tif2w]<div class="fw" id="{CB}" style="font-family: monospace;">oWin:<span style="color: #000000;">bPostEnd</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span> cAlias <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBCLOSEAREA<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:1o7tif2w]
This is the safe and recommended way.
In the case of your example above, please replace the code:
[code=fw:1o7tif2w]<div class="fw" id="{CB}" style="font-family: monospace;">oWIN:<span style="color: #000000;">oClient</span>:=oBRW<br />oWIN:<span style="color: #000000;">SetControl</span><span style="color: #000000;">(</span>oBRW<span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWIN <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> WndAdjClient<span style="color: #000000;">(</span>oWIN:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">bKeyCount</span>:=<span style="color: #000000;">{</span>||<span style="color: #000000;">0</span><span style="color: #000000;">}</span> , oBrw:<span style="color: #000000;">bKeyNo</span> := <span style="color: #000000;">{</span>||<span style="color: #000000;">0</span><span style="color: #000000;">}</span> , CLOSE_DB<span style="color: #000000;">(</span>oXDBF<span style="color: #000000;">)</span> , .T. <span style="color: #000000;">)</span><br /> </div>[/code:1o7tif2w]
with
[code=fw:1o7tif2w]<div class="fw" id="{CB}" style="font-family: monospace;">oWIN:<span style="color: #000000;">SetControl</span><span style="color: #000000;">(</span>oBRW<span style="color: #000000;">)</span><br />oWin:<span style="color: #000000;">bPostEnd</span> := <span style="color: #000000;">{</span> || CLOSE_DB<span style="color: #000000;">(</span> oXDBF <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWIN<br /> </div>[/code:1o7tif2w]
Notes:
1) oWin:SetControl( oBrw ) includes a call to "oWin:oClient := oBrw".
2) ON INIT WndAdjClient(oWIN:hWnd) is not necessary.
I may also suggest that the caption is inappropriate. This is not Xbrowse error. |
xBrowse Edit Group Column (DONE) | Hi Mr. Rao,
with xbrowse:
[code=fw:3cs0ftr8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> ...<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">(</span> <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">)</span><br /> ...<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oBrw:<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;">nEditType</span> := EDIT_GET<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">6</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> ...<br /> </div>[/code:3cs0ftr8]
[url=http://s208.photobucket.com/user/fraxzi/media/FWxHarbour/xBrowse_GroupCol_Edit_zpskf2zhe1y.png.html:3cs0ftr8][img:3cs0ftr8]http://i208.photobucket.com/albums/bb82/fraxzi/FWxHarbour/xBrowse_GroupCol_Edit_zpskf2zhe1y.png[/img:3cs0ftr8][/url:3cs0ftr8]
But I can only edit the "project" field ... How to edit the remaining field belong in the column group? |
xBrowse Edit Group Column (DONE) | Inline edit is not possible when using SetColsAsRows() |
xBrowse Edit Group Column (DONE) | [quote="nageswaragunupudi":2bsbln6f]Inline edit is not possible when using SetColsAsRows()[/quote:2bsbln6f]
Thanks Mr. Rao, well noted. |
xBrowse Edit Group Column (DONE) | Please try this:
Assuming the headers of columns 4,5,6 are "PROJECT NAME", "ADDRESS1", "ADDRESS2",
oBrw:aCols[ 4 ]:bLDClickData := { || oBrw:EditBrowse( .f., "PROJECT NAME,ADDRESS1,ADDRESS2", .f. ) }
oBrw:aCols[ 4 ]:bKeyChar := { |k| If( k == 13, ( oBrw:EditBrowse( .f., "PROJECT NAME,ADDRESS1,ADDRESS2", .f. ), 0 ), nil } |
xBrowse Edit Group Column (DONE) | [quote="nageswaragunupudi":3byolrq1]Please try this:
Assuming the headers of columns 4,5,6 are "PROJECT NAME", "ADDRESS1", "ADDRESS2",
oBrw:aCols[ 4 ]:bLDClickData := { || oBrw:EditBrowse( .f., "PROJECT NAME,ADDRESS1,ADDRESS2", .f. ) }
oBrw:aCols[ 4 ]:bKeyChar := { |k| If( k == 13, ( oBrw:EditBrowse( .f., "PROJECT NAME,ADDRESS1,ADDRESS2", .f. ), 0 ), nil }[/quote:3byolrq1]
Hi Rao,
Thanks for the alternative way of doing it.
[url=http://s208.photobucket.com/user/fraxzi/media/FWxHarbour/xBrowse_GroupCol_Edit2_zpsm5941zdi.png.html:3byolrq1][img:3byolrq1]http://i208.photobucket.com/albums/bb82/fraxzi/FWxHarbour/xBrowse_GroupCol_Edit2_zpsm5941zdi.png[/img:3byolrq1][/url:3byolrq1]
I got blank fields to edit even if I move the record. |
xBrowse Edit Group Column (DONE) | Please adopt my modified code.
It is working here fine for me.
Please try again. |
xBrowse Edit Group Column (DONE) | [quote="nageswaragunupudi":w65s0r3f]Please adopt my modified code.
It is working here fine for me.
Please try again.[/quote:w65s0r3f]
I exactly copied it. and checked with headers.. it is a Child Record Set.. |
xBrowse Edit Group Column (DONE) | First, please try this sample as it is. Copy to fwh\samples folder and build it.
[code=fw:14x0r9hh]<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 /> <span style="color: #00C800;">local</span> oDlg, oBrw, oFont, aStates<br /><br /> USE STATES<br /> aStates := FW_DbfToArray<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CODE,NAME"</span> <span style="color: #000000;">)</span><br /> CLOSE STATES<br /><br /> USE CUSTOMER<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> ;<br /> COLUMNS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"LAST"</span>, <span style="color: #ff0000;">"STREET"</span>, <span style="color: #ff0000;">"CITY"</span>, <span style="color: #ff0000;">"STATE"</span>, <span style="color: #ff0000;">"ZIP"</span>, <span style="color: #ff0000;">"AGE"</span>, <span style="color: #ff0000;">"MARRIED"</span>, <span style="color: #ff0000;">"SALARY"</span> ;<br /> CELL LINES NOBORDER<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nEditTypes</span> := EDIT_GET<br /> :<span style="color: #000000;">Married</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> WITH OBJECT :<span style="color: #000000;">State</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_LISTBOX<br /> :<span style="color: #000000;">aEditListTxt</span> := aStates<br /> END<br /> :<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;">SetColsAsRows</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">7</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #000000;">8</span>, <span style="color: #000000;">9</span>, <span style="color: #000000;">10</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">/*<br /> // With new xbrowse, you do not need this anymore<br /> :aCols[ 2 ]:bLDClickData := { || oBrw:EditBrowse( .f., "FIRST,LAST", .f. ) }<br /> :aCols[ 2 ]:bKeyChar := { |k| If( k == 13, ( oBrw:EditBrowse( .f., "FIRST,LAST", .f. ), 0 ), nil ) }<br /> :aCols[ 4 ]:bLDClickData := { || oBrw:EditBrowse( .f., "STREET,CITY,STATE,ZIP", .f. ) }<br /> :aCols[ 4 ]:bKeyChar := { |k| If( k == 13, ( oBrw:EditBrowse( .f., "STREET,CITY,STATE,ZIP", .f. ), 0 ), nil ) }<br /> :aCols[ 8 ]:bLDClickData := { || oBrw:EditBrowse( .f., "AGE,MARRIED,SALARY", .f. ) }<br /> :aCols[ 8 ]:bKeyChar := { |k| If( k == 13, ( oBrw:EditBrowse( .f., "AGE,MARRIED,SALARY", .f. ), 0 ), nil ) }<br />*/</span><br /> <span style="color: #B900B9;">//</span><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:14x0r9hh]
After you see how this is working, please try adapting to your data.
Let me know any difficulties you face.
I would like to build this behaviour into xbrowse, after your testing. |
xBrowse Edit Group Column (DONE) | I sent you revised xbrowse.
Also see the above sample modified. |
xBrowse Edit Group Column (DONE) | [quote="nageswaragunupudi":1f7spyc5]I sent you revised xbrowse.
Also see the above sample modified.[/quote:1f7spyc5]
That was a very good fix! <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> |
xBrowse Edit Group Column (DONE) | Mr. Rao,
The samples works great! but this is with dbf...
Using Child RecordSet with Grouped column, I get Blank fields (the content of child's field value not reflected)
<!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse Editing Error - numeric values rounding | In a file editor class, the following function is used to edit a single record from a file:
[code=fw:16y788l2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> EditRec<span style="color: #000000;">(</span> <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> MLSEditor<br /><br /> MEMVAR oBrush, oMFont<br /> <br /> <span style="color: #00C800;">LOCAL</span> aEdits := <span style="color: #000000;">{</span><span style="color: #000000;">}</span>, n, nCcol, oHd2<br /> <span style="color: #00C800;">LOCAL</span> oERecEdt, oERec, lSaveEdits := .f.<br /> <br /> <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDbfr</span>:<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span> aEdits, <span style="color: #000000;">{</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span>, ::<span style="color: #000000;">oDbfr</span>:<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /> <br /> <span style="color: #B900B9;">// Create the dialog</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oERec <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"PROBROW"</span> <span style="color: #0000ff;">BRUSH</span> oBrush transparent <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oEWndChild</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Record Edit"</span> <span style="color: #0000ff;">FONT</span> oMFont<br /><br /> <span style="color: #B900B9;">// Create the control buttons</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HREXIT"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit Edit"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2101</span> <span style="color: #0000ff;">of</span> oERec NOBORDER TRANSPARENT ;<br /> <span style="color: #0000ff;">ACTION</span> oERec:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HRSAVE"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save & Exit"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2102</span> <span style="color: #0000ff;">of</span> oERec NOBORDER TRANSPARENT ;<br /> <span style="color: #0000ff;">ACTION</span> lSaveEdits := .t., oERec:<span style="color: #000000;">end</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oHd2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2103</span> <span style="color: #0000ff;">of</span> oERec<br /><br /> <span style="color: #B900B9;">// Create the browse</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oERecEdt <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2100</span> <span style="color: #0000ff;">OF</span> oERec <br /><br /> <span style="color: #B900B9;">// Attach the array</span><br /> oERecEdt:<span style="color: #000000;">setArray</span><span style="color: #000000;">(</span> aEdits <span style="color: #000000;">)</span><br /> oERecEdt:<span style="color: #000000;">aCols</span> := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #B900B9;">// Add the columns</span><br /> ADD <span style="color: #0000ff;">TO</span> oERecEdt <span style="color: #00C800;">DATA</span> ARRAY ELEMENT <span style="color: #000000;">1</span> HEADER <span style="color: #ff0000;">"Fields"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span> ALIGN <span style="color: #0000ff;">LEFT</span><br /> ADD <span style="color: #0000ff;">TO</span> oERecEdt <span style="color: #00C800;">DATA</span> ARRAY ELEMENT <span style="color: #000000;">2</span> HEADER <span style="color: #ff0000;">"Data"</span> EDITABLE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span> ALIGN <span style="color: #0000ff;">LEFT</span><br /><br /> <span style="color: #B900B9;">// Provide the header gradient</span><br /> oERecEdt:<span style="color: #000000;">bClrGrad</span> := <span style="color: #000000;">{</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! lInvert, <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>,<span style="color: #000000;">16776960</span>,<span style="color: #000000;">16777215</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>,<span style="color: #000000;">16777215</span>,<span style="color: #000000;">16776960</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">16777215</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>,<span style="color: #000000;">16777215</span>,<span style="color: #000000;">128</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">// Set the header and row heights</span><br /> oERecEdt:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span><br /> oERecEdt:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">24</span><br /> oERecEdt:<span style="color: #000000;">nStretchCol</span><span style="color: #000000;">(</span> STRETCHCOL_WIDEST <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Turn off horizontal scrolling</span><br /> oERecEdt:<span style="color: #000000;">lHScroll</span> := .F.<br /><br /> <span style="color: #B900B9;">// Set the styles</span><br /> oERecEdt:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> oERecEdt:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_RAISED<br /> oERecEdt:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_RAISED<br /> <span style="color: #00C800;">FOR</span> nCCol := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">(</span> oERecEdt:<span style="color: #000000;">acols</span> <span style="color: #000000;">)</span><br /> oERecEdt:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCCol<span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /> <span style="color: #00C800;">NEXT</span><br /><br /> <span style="color: #B900B9;">// Activate the dialog</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oERec <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> oHd2:<span style="color: #000000;">hide</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span>, oERec:<span style="color: #0000ff;">center</span><span style="color: #000000;">(</span>wndmain<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// If we wish to save the values </span><br /> <span style="color: #00C800;">IF</span> lSaveEdits := .t.<br /><br /> <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">(</span> aEdits <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oDbfr</span>:<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span> := aEdits<span style="color: #000000;">[</span>n,<span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">NEXT</span><br /> ::<span style="color: #000000;">oDbfr</span>:<span style="color: #000000;">save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> </div>[/code:16y788l2]
Here is how it works. An xBrowse displays all the records of a database, and the values of the record in focus is saved in a database record object ( oDbfr ). When the edit is called, the field names and values are loaded into a two element array, and then placed into an xBrowse control. The second column ( value ) is editable. If the edits are saved, the values are written to the record which is saved and all is fine.
Here is the problem: This works perfectly with xHarbour ( .com ) / Pelles C. However, with Harbour / MSVC, if the value is numeric ( decimal ), it rounds off the value. Thus, 12.68 would be set as 13.
Perhaps someone can give me a hint on why the two different behaviors based on compiler ? How do we fix it ?
Tim |
xBrowse Editing Error - numeric values rounding | Perhaps with a new title, someone will actually respond to this question ? |
xBrowse Editing Error - numeric values rounding | Tim,
I don't know why this is happening, but have you tried:
SET FIXED ON
SET DECIMAL TO 2
I know that is supposed to be the default, but maybe the preprocessor is messing something up.
Try making as small of a program as you can showing the problem--just create an array of a couple of items and a browse to edit it. This will make it easier for others to try to fix it.
James |
xBrowse Editing Error - numeric values rounding | James,
This is probably the only code I have that is actually allowing an edit in xBrowse.
It may help to note that the error only occurs with Harbour / MSVC, and is fine with xHarbour / Pelles C builds.
It may be that Antonio made a change in a build that he did not include in the Microsoft libraries he creates.
Tim |
xBrowse Editing Error - numeric values rounding | Tim,
Still, a small self-contained program would make it easier for Antonio to check and fix.
James |
xBrowse Editing Error - numeric values rounding | James,
Here is a cut down that makes it rather straight forward:
[code=fw:1b9rw2as]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">METHOD</span> TestEditRec<span style="color: #000000;">(</span> <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> MLSEditor<br /><br /> MEMVAR oBrush, oMFont<br /> <br /> <span style="color: #00C800;">LOCAL</span> aEdits := <span style="color: #000000;">{</span><span style="color: #000000;">}</span>, n, nCcol, oHd2<br /> <span style="color: #00C800;">LOCAL</span> oERecEdt, oERec, lSaveEdits := .f.<br /> <br /> AADD<span style="color: #000000;">(</span> aEdits, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"C"</span>, <span style="color: #ff0000;">"String"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">3</span><br /> AADD<span style="color: #000000;">(</span> aEdits, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">12.80</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /> AADD<span style="color: #000000;">(</span> aEdits, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"C"</span>, <span style="color: #ff0000;">"String"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <br /> <br /> <span style="color: #B900B9;">// Create the dialog</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oERec <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"PROBROW"</span> <span style="color: #0000ff;">BRUSH</span> oBrush transparent <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oEWndChild</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Record Edit"</span> <span style="color: #0000ff;">FONT</span> oMFont<br /><br /> <span style="color: #B900B9;">// Create the control buttons</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HREXIT"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit Edit"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2101</span> <span style="color: #0000ff;">of</span> oERec NOBORDER TRANSPARENT ;<br /> <span style="color: #0000ff;">ACTION</span> oERec:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HRSAVE"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save & Exit"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2102</span> <span style="color: #0000ff;">of</span> oERec NOBORDER TRANSPARENT <br /><br /> <span style="color: #B900B9;">// Create the browse</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oERecEdt <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2100</span> <span style="color: #0000ff;">OF</span> oERec <br /><br /> <span style="color: #B900B9;">// Attach the array</span><br /> oERecEdt:<span style="color: #000000;">setArray</span><span style="color: #000000;">(</span> aEdits <span style="color: #000000;">)</span><br /> oERecEdt:<span style="color: #000000;">aCols</span> := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #B900B9;">// Add the columns</span><br /> ADD <span style="color: #0000ff;">TO</span> oERecEdt <span style="color: #00C800;">DATA</span> ARRAY ELEMENT <span style="color: #000000;">1</span> HEADER <span style="color: #ff0000;">"Fields"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span> ALIGN <span style="color: #0000ff;">LEFT</span><br /> ADD <span style="color: #0000ff;">TO</span> oERecEdt <span style="color: #00C800;">DATA</span> ARRAY ELEMENT <span style="color: #000000;">2</span> HEADER <span style="color: #ff0000;">"Data"</span> EDITABLE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span> ALIGN <span style="color: #0000ff;">LEFT</span><br /><br /> <span style="color: #B900B9;">// Turn off horizontal scrolling</span><br /> oERecEdt:<span style="color: #000000;">lHScroll</span> := .F.<br /><br /> <span style="color: #B900B9;">// Activate the dialog</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oERec <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> oHd2:<span style="color: #000000;">hide</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span>, oERec:<span style="color: #0000ff;">center</span><span style="color: #000000;">(</span>wndmain<span style="color: #000000;">(</span><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></div>[/code:1b9rw2as]
Here is the browse code from the .rc file:
[code=fw:1b9rw2as]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROBROW <span style="color: #0000ff;">DIALOG</span> DISCARDABLE <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">500</span>, <span style="color: #000000;">240</span><br /><span style="color: #0000ff;">STYLE</span> WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_VISIBLE<br />CAPTION <span style="color: #ff0000;">"Look-Up Chart"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">12</span>, <span style="color: #ff0000;">"Segoe UI"</span><br />BEGIN<br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">2100</span>, <span style="color: #ff0000;">"TXBrowse"</span>, WS_TABSTOP|0x00a00000, <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span>, <span style="color: #000000;">430</span>, <span style="color: #000000;">230</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">2103</span>, <span style="color: #ff0000;">"Button"</span>, WS_TABSTOP, <span style="color: #000000;">450</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">2101</span>, <span style="color: #ff0000;">"Button"</span>, WS_TABSTOP, <span style="color: #000000;">450</span>, <span style="color: #000000;">80</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">2102</span>, <span style="color: #ff0000;">"Button"</span>, WS_TABSTOP, <span style="color: #000000;">450</span>, <span style="color: #000000;">140</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span><br />END<br /> </div>[/code:1b9rw2as]
If works fine with xHarbour / Pelles C, but doesn't allow the numbers past the decimal with Harbour / MSVC 2012.
Tim |
xBrowse Editing Error - numeric values rounding | Good that you pointed this out.
I have reduced your sample to this following code.
[code=fw:uy4odqur]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> xbrnumedit<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aData := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"C"</span>, <span style="color: #ff0000;">"String"</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">27</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">12.34</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"C"</span>, <span style="color: #ff0000;">"STRING"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /> XBROWSER aData FASTEDIT<br /><br /> ? adata<span style="color: #000000;">[</span><span style="color: #000000;">2</span>,<span style="color: #000000;">2</span><span style="color: #000000;">]</span>,adata<span style="color: #000000;">[</span><span style="color: #000000;">3</span>,<span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:uy4odqur]
With xHarbour, any version, you can edit the third line with decimal places and decimal value is retained.
With present versions of Harbour ( I have no idea about earlier versions) we can not edit the 3d line after decimals and the value is rounded to integer after editing.
I do not say that there is any problem with Harbour. It is just that xbrowse's edit of numerics without picture clause is behaving diferently with xHarbour and Harbour. I am looking into xbrowse code and yet to come up with a satisfactory answer.
Meanwhile I suggest a workaround to conditionally use picture clause for numeric values. I shall post this code soon.
Please give us a little more time. |
xBrowse Editing Error - numeric values rounding | I use this code in a record editor. The left column ( element 1 of the array ) is a field name.
The 2nd column ( EDITABLE ) is a value, and it could be of any data type. Thus, I couldn't set the column with a picture clause because sometimes the value is a string, or a date, or a decimal.
Thanks for looking into this.
Tim |
xBrowse Editing Error - numeric values rounding | Mr. Rao,
I just wanted to keep this on top since you said you would be addressing the issue.
Your help is greatly appreciated.
Tim Stone |
xBrowse Editing Error - numeric values rounding | I would call this a workaround rather than 'fix'. But this works for the time being.
Please locate the line
[code=fw:210olpqo]<div class="fw" id="{CB}" style="font-family: monospace;">::<span style="color: #000000;">oEditGet</span> := TGet<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>,;</div>[/code:210olpqo]
in METHOD Edit( nKey ) CLASS TXBrwColumn.
Just above this line, please insert
[code=fw:210olpqo]<div class="fw" id="{CB}" style="font-family: monospace;">#ifndef __XHARBOUR__<br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> cPic <span style="color: #000000;">)</span> .and. ValType<span style="color: #000000;">(</span> uValue <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'N'</span><br /> cPic := NumPict<span style="color: #000000;">(</span> ::<span style="color: #000000;">nWidthChr</span>, Len<span style="color: #000000;">(</span> AfterAtNum<span style="color: #000000;">(</span> <span style="color: #ff0000;">'.'</span>, cValToChar<span style="color: #000000;">(</span> uValue <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br />#endif<br /> </div>[/code:210olpqo]
We are adopting this workaround for the 13.08 release.
When we find and fix the exact reason for difference in behavior between harbour and xharbour, we my remove this workaround. |
xBrowse Editing Error - numeric values rounding | Thank you. That resolves the problem.
Tim |
xBrowse Error With 10.2 | Hi,
Just upgraded xHarbour commercial (Nov 09) & Fivewin (10.2) and get the follwoing error in an xBrowse:
Application
===========
Path and name: G:\6.00\Exe\ORD_MOD.EXE (32 bits)
Size: 4,965,376 bytes
Time from start: 0 hours 0 mins 4 secs
Error occurred at: 18/03/2010, 15:51:10
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 3
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINTHEADER(1472)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1271)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(1174)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1439)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(10470)
Called from: .\source\classes\WINDOW.PRG => _FWH(3378)
Called from: => UPDATEWINDOW(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(955)
Called from: .\source\classes\MDICHILD.PRG => TMDICHILD:ACTIVATE(245)
The previous version of Fivewin i was using was 09.5 and it worked fine - no code changes just recompiled and got this error. Any ideas?
Regards,
Pete |
xBrowse Error With 10.2 | From versions 9.01 TO 10.02, bClrHeader is expected to return array of 3 colors. Third color is meant for the color of the pen used to paint lines for the header.
Please change your source code so that bClrHeader returns an array of 3 colors. |
xBrowse Error With 10.2 | Thanks, that seems to have fixed the problem!
One thing i've noticed is that the size of the header has grown between versions - how can i set it back to how it was?
Regards,
Pete |
xBrowse Error With 10.2 | [quote="PeterHarmes":mlpsggjr]Thanks, that seems to have fixed the problem!
One thing i've noticed is that the size of the header has grown between versions - how can i set it back to how it was?
Regards,
Pete[/quote:mlpsggjr]
Is it so? May I know with which version are you comparing? I like to see if there is any change in the code.
Anyway you can control header size with oBrw:nHeaderHeight := <n> ( in pixels ) |
xBrowse Error With 10.2 | I was originally using 09.05 |
xBrowse Error With 10.2 | Anyone got any ideas about the header height problem?
Regards,
Pete |
xBrowse Error With 10.2 | From version 9.12, the header height is increased by 4 pixels.
For the old look, line no 8063 of xbrowse.prg ( 10.2 )
[code=fw:3ni032wa]<div class="fw" id="{CB}" style="font-family: monospace;"> nHeight := <span style="color: #000000;">(</span> FontHeight<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>, ::<span style="color: #000000;">oHeaderFont</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> * MLCount<span style="color: #000000;">(</span> ::<span style="color: #000000;">cHeader</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">2</span><br /> </div>[/code:3ni032wa]
may be modified as
[code=fw:3ni032wa]<div class="fw" id="{CB}" style="font-family: monospace;"> nHeight := FontHeight<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>, ::<span style="color: #000000;">oHeaderFont</span> <span style="color: #000000;">)</span> * MLCount<span style="color: #000000;">(</span> ::<span style="color: #000000;">cHeader</span> <span style="color: #000000;">)</span><br /> </div>[/code:3ni032wa] |
xBrowse Error With 10.2 | I would say that the size of the header has nearly doubled!!
I will try and get some screen shots |
xBrowse Error With 10.2 | [quote="PeterHarmes":e3x2nhhh]I would say that the size of the header has nearly doubled!!
I will try and get some screen shots[/quote:e3x2nhhh]
I have verified the code and also compared the headerheight by msginfo in both versions. You may try this small code in both versions:
[code=fw:e3x2nhhh]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> XBROWSER <span style="color: #000000;">{</span><span style="color: #000000;">{</span> <span style="color: #ff0000;">'Right Click'</span>, <span style="color: #ff0000;">'To know header height'</span> <span style="color: #000000;">}</span><span style="color: #000000;">}</span> ;<br /> SETUP <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">{</span> |r,c,f,o| <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> o:<span style="color: #000000;">nHeaderHeight</span> <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:e3x2nhhh] |
xBrowse Error With 10.2 | Thanks, i'll try that in a min - I dont actually specify a font or size for the header of the browse so this could be the cause of the problem - i use a generic function for all of my browses, so it wouldnt take much to apply a height to all browses - how do i apply a height?
oBrw:nHeaderHeight := nn?
Regards,
Pete |
xBrowse Error With 10.2 | Ignore previous post - I have put oBrw:nHeaderHeight := 20 into my xBrowse setup function and that works perfectly in both FW09.5 & FW10.2
Thanks for your help you
Best Regards,
Pete |
xBrowse Extreme right end ghost col header & Footer painting | Hi all,
Is there a way to avoid the display of the extreme right end column (Ghost Column) which appears automatically. This column is displayed only when the the xbrowse is scrolled towards the extreme right. The header and footer color of this ghost column is also not the same as the default header/footer color.
[url=http://img692.imageshack.us/i/xbrowse.jpg/:1bszxztz][img:1bszxztz]http://img692.imageshack.us/img692/1183/xbrowse.jpg[/img:1bszxztz][/url:1bszxztz]
I have also found that if I don't use oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW , then the Pijama effect is also not painted on the last column
[url=http://img693.imageshack.us/i/xbrowse2.jpg/:1bszxztz][img:1bszxztz]http://img693.imageshack.us/img693/8933/xbrowse2.jpg[/img:1bszxztz][/url:1bszxztz]
Simple solution would be an option to avoid this ghost column. I believe that there is some trick to avoid this column.
Any help ?
Regards
Anser |
xBrowse Extreme right end ghost col header & Footer painting | Hello Anserkk
you can use oBrw:nStretchCol := STRETCHCOL_LAST |
xBrowse Extreme right end ghost col header & Footer painting | Dear Mr.Daniel,
oBrw:nStretchCol := STRETCHCOL_LAST worked perfectly as expected.
Regards
Anser |
xBrowse Extreme right end ghost col header & Footer painting | [quote:2xssr7dc]The header and footer color of this ghost column is also not the same as the default header/footer color. [/quote:2xssr7dc]
This was fixed in version 9.11, along with other minor painting issues of header and footer. This bug was existing from 9.02 to 9.10 |
xBrowse Extreme right end ghost col header & Footer painting | [quote="nageswaragunupudi":3oveid3e][quote:3oveid3e]The header and footer color of this ghost column is also not the same as the default header/footer color. [/quote:3oveid3e]
This was fixed in version 9.11, along with other minor painting issues of header and footer. This bug was existing from 9.02 to 9.10[/quote:3oveid3e]
Dear Mr.Rao,
Thank you for the information.
What about the painting of the Pijama effect on the Ghost column ?
Regard
Anser |
xBrowse Extreme right end ghost col header & Footer painting | >>
What about the painting of the Pijama effect on the Ghost column ?
>>
Ghost column is painted only for nMarqueeStyle 4 and above. So, the if we need pijama effect in ghost column also, we need to set nMarqueeStyle to 4 or able as appropriate. |
xBrowse Extreme right end ghost col header & Footer painting | Dear Mr.Rao,
Thank you for the information.
oBrw:nMarqueeStyle := 4 is serving the purpose <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Regards
Anser |
xBrowse FW16.06 (Solucionado) | Estimados:
Cuando tengo una consulta Dolphin ordenan por un campo numerico y presiono una letra, el programa deja de responder. Esto no me pasaba con la misma situacion en la version 11 de FW. Alguna pista? |
xBrowse FW16.06 (Solucionado) | Talvez, usted esté usando un ERRSYSW.PRG de una version antigua. Se si, cambia el ERRSYSW.PRG para el nuevo de la nueva version de FWHX.
Saludos. |
xBrowse FW16.06 (Solucionado) | Comprueba si se crea un fichero hb_out.log
Copia aqui el contenido de ese fichero, gracias |
xBrowse FW16.06 (Solucionado) | Gracias por responder!
[quote:1clnobxo]Talvez, usted esté usando un ERRSYSW.PRG de una version antigua. Se si, cambia el ERRSYSW.PRG para el nuevo de la nueva version de FWHX.[/quote:1clnobxo]
Uso harbour, y tengo la version mas reciente.
[quote:1clnobxo]Comprueba si se crea un fichero hb_out.log
[/quote:1clnobxo]
No crea el fichero antonio. |
xBrowse FW16.06 (Solucionado) | Puedes proporcionar un ejemplo pequeño y auto contenido que reproduzca el problema ? |
xBrowse FW16.06 (Solucionado) | Lo preparo Antonio
Gracias |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.