topic
stringlengths
1
63
text
stringlengths
1
577k
oTree
If I have object oTree and I use a listbox to insert the oTree oLbxTree:SetTree( oTree ) How I can make to found the nlevel for this obxTree I 'm converting a oldest fw /clipper app where I used nLevel:= oLbxTree:cargo:nLevel but now with fwh this not run !!! I have this BuildTree : [code=fw:2749whoc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> BuildTree<span style="color: #000000;">&#40;</span> oTree, oLbxTree <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;oTree:= TreeBegin<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Folder1"</span>,<span style="color: #ff0000;">"Folder2"</span>,<span style="color: #ff0000;">"Folder3"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> ! PROVVE-><span style="color: #000000;">&#40;</span>Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; _TreeItem <span style="color: #000000;">&#40;</span>AllTrim <span style="color: #000000;">&#40;</span>PROVVE->CODAZI<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"."</span>+PROVVE->DENSOC, <span style="color: #ff0000;">"DBFs"</span>,,,, .F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; TreeBegin<span style="color: #000000;">&#40;</span>,<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; PROVVE-><span style="color: #000000;">&#40;</span>dbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> LEN<span style="color: #000000;">&#40;</span>AllTrim<span style="color: #000000;">&#40;</span>PROVVE->CODAZI<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">2</span> .AND. ! PROVVE-><span style="color: #000000;">&#40;</span>Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; _TreeItem <span style="color: #000000;">&#40;</span>AllTrim <span style="color: #000000;">&#40;</span>PROVVE->CODAZI<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"."</span>+PROVVE->DENSOC, <span style="color: #ff0000;">"DBFs"</span>,,,, .F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; *_TreeItem <span style="color: #000000;">&#40;</span>PROVVE->DENSOC, <span style="color: #ff0000;">"DBFs"</span>,,,, .F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TreeBegin<span style="color: #000000;">&#40;</span>, <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROVVE-><span style="color: #000000;">&#40;</span>dbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> LEN<span style="color: #000000;">&#40;</span>AllTrim<span style="color: #000000;">&#40;</span>PROVVE->CODAZI<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">3</span> .AND. ! PROVVE-><span style="color: #000000;">&#40;</span>Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _TreeItem <span style="color: #000000;">&#40;</span>AllTrim <span style="color: #000000;">&#40;</span>PROVVE->CODAZI<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"."</span>+PROVVE->DENSOC, <span style="color: #ff0000;">"LIB"</span>,,,, .F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *_TreeItem <span style="color: #000000;">&#40;</span>PROVVE->DENSOC, <span style="color: #ff0000;">"LIB"</span>,,,, .F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TreeBegin<span style="color: #000000;">&#40;</span>, <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROVVE-><span style="color: #000000;">&#40;</span>dbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> LEN<span style="color: #000000;">&#40;</span>AllTrim<span style="color: #000000;">&#40;</span>PROVVE->CODAZI<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> >= <span style="color: #000000;">4</span> .AND. ! PROVVE-><span style="color: #000000;">&#40;</span>Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span>AllTrim<span style="color: #000000;">&#40;</span>PROVVE->CODAZI<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> >= <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _TreeItem <span style="color: #000000;">&#40;</span>AllTrim <span style="color: #000000;">&#40;</span>PROVVE->CODAZI<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"."</span>+PROVVE->DENSOC, <span style="color: #ff0000;">"LOB"</span>,,,, .F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *_TreeItem <span style="color: #000000;">&#40;</span>PROVVE->DENSOC, <span style="color: #ff0000;">"LOB"</span>,,,, .F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; * &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROVVE-><span style="color: #000000;">&#40;</span>dbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDDO</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TreeEnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br />&nbsp; &nbsp;TreeEnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br />&nbsp;TreeEnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDDO</span><br />&nbsp; &nbsp; TreeEnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; oTree:<span style="color: #000000;">Expand</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oLbxTree:<span style="color: #000000;">SetTree</span><span style="color: #000000;">&#40;</span> oTree <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br />&nbsp;</div>[/code:2749whoc] how I can to converte it on Xbrowse ?
oTree cambiar un item
Hola. Quiero poder cambiar "en el mismo lugar" el nombre de un item de un oTree y no tener que hacer un dialogo donde le pido al usuario que ingrese el nuevo nombre. Como lo hago? Gracias.
oTree como dejo el fondo transparente
Como dejo el fonde transparente del Otree segun el codigo, tambien necesito colocar una trama es decir una linea de un color y otra diferente. Gracias [code=fw:2oi0xqb0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDtree <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"TREE"</span> <br /><span style="color: #B900B9;">//       par_diag(oDtree,3,1,1) //(oDlgxx,nbrush,ncolor,ndisp) //ndisp no se esta usando</span><br />    oImageList = TImageList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />        oImageList:<span style="color: #000000;">AddMasked</span><span style="color: #000000;">&#40;</span> TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OK"</span>,, oDtree <span style="color: #000000;">&#41;</span>,TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PRINTER"</span>,, oDtree <span style="color: #000000;">&#41;</span>,;<br />           nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>    <br />        oImageList:<span style="color: #000000;">AddMasked</span><span style="color: #000000;">&#40;</span> TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OK"</span>,, oDtree <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>    <br />        oImageList:<span style="color: #000000;">AddMasked</span><span style="color: #000000;">&#40;</span> TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OK"</span>,, oDtree <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>    <br />        oImageList:<span style="color: #000000;">AddMasked</span><span style="color: #000000;">&#40;</span> TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OK"</span>,, oDtree <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>    <br />        oImageList:<span style="color: #000000;">AddMasked</span><span style="color: #000000;">&#40;</span> TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OK"</span>,, oDtree <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>    <br />        oImageList:<span style="color: #000000;">AddMasked</span><span style="color: #000000;">&#40;</span> TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OK"</span>,, oDtree <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>    <br />        oImageList:<span style="color: #000000;">AddMasked</span><span style="color: #000000;">&#40;</span> TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OK"</span>,, oDtree <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>    <br />        oImageList:<span style="color: #000000;">AddMasked</span><span style="color: #000000;">&#40;</span> TBitmap<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OK"</span>,, oDtree <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>    <br /><br />       oTree := TTreeView<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">ReDefine</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">100</span>,oDtree,<span style="color: #000000;">0</span>,GetSysColor<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>, .T. ,<span style="color: #ff0000;">"ll"</span> <span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">//ver ttreevie.prg en classes</span><br /><span style="color: #B900B9;">//   METHOD ReDefine( nId, oWnd, nClrFore, nClrBack, lDesign, cMsg ) CONSTRUCTOR</span><br /><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">611</span> <span style="color: #0000ff;">OF</span> oDtree <span style="color: #0000ff;">ACTION</span> oDtree:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:2oi0xqb0]
oTree for xBrowse sample...
Hi!Anybody with working sample using Tree for xBrowse for DBFCDX table....Best Regards,Frances
oTree for xBrowse sample...
Did you try the \FWH\Samples\TestXbr3.PrgCheck menu Tree Browse.RegardsAnser
oTree for xBrowse sample...
Yes I tried but I cant work it by (alias)->field....I dont use ADO.Regards
oTree for xBrowse sample...
Anyone?
oTree for xBrowse sample...
Frances,You can use the source code for MakeTree() in samples\TestXbr3.prgJust use the DBF instead of an ADO recordset. The source code is almost the same.
oTree for xBrowse sample...
[quote="Antonio Linares":3jguvhea]Frances, You can use the source code for MakeTree() in samples\TestXbr3.prg Just use the DBF instead of an ADO recordset. The source code is almost the same.[/quote:3jguvhea]Antonio,i'm also very interested in a sample how to use this tree browse with dbf files.Unfortunatelly it's not so easy to find a replacement for the 'union' clause of a sql query.Could you please provide a pure dbf sample for this useful feature or give us some tips?This woulds be great.Thanks and regards,Detlef
oTree for xBrowse sample...
Frances, Detlef,Here you have a working example:[code:1zsmnk5u] #include "FiveWin&#46;ch" #include "xbrowse&#46;ch" function Main&#40;&#41; local oWnd, oBrw USE Customer INDEX ON Field->State TO State SET ORDER TO "State" GO TOP DEFINE WINDOW oWnd TITLE "DbfTree" @ 0, 0 XBROWSE oBrw OF oWnd LINES CELL oBrw&#58;SetTree&#40; BuildTree&#40;&#41; &#41; oBrw&#58;CreateFromCode&#40;&#41; oBrw&#58;aCols&#91; 1 &#93;&#58;cHeader = "State" oWnd&#58;oClient = oBrw ACTIVATE WINDOW oWnd return nil static function BuildTree&#40;&#41; local oTree, cState TREE oTree while ! Eof&#40;&#41; if Empty&#40; cState &#41; _TreeItem&#40; Customer->State &#41;&#58;Cargo &#58;= RecNo&#40;&#41; TREE cState = Customer->State else if cState != Customer->State ENDTREE cState = Customer->State _TreeItem&#40; Customer->State &#41;&#58;Cargo &#58;= RecNo&#40;&#41; TREE endif endif if Customer->State == cState _TreeItem&#40; Customer->City &#41;&#58;Cargo &#58;= RecNo&#40;&#41; endif SKIP enddo ENDTREE ENDTREE GO TOP return oTree [/code:1zsmnk5u]
oTree for xBrowse sample...
[url=http&#58;//imageshack&#46;us:18vuu5nz][img:18vuu5nz]http&#58;//img88&#46;imageshack&#46;us/img88/9205/xbrtreeeq6&#46;jpg[/img:18vuu5nz][/url:18vuu5nz]
oTree for xBrowse sample...
Antonio,this is working great! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Many thanks for the sample,Detlef
oTree for xBrowse sample...
Using bitmaps in the tree:Test.prg[code:fox9mk1r] #include "FiveWin&#46;ch" #include "xbrowse&#46;ch" function Main&#40;&#41; local oWnd, oBrw USE Customer INDEX ON Field->State TO State SET ORDER TO "State" GO TOP DEFINE WINDOW oWnd TITLE "DbfTree" @ 0, 0 XBROWSE oBrw OF oWnd LINES CELL oBrw&#58;SetTree&#40; BuildTree&#40;&#41;, &#123; "open", "close", "go" &#125; &#41; oBrw&#58;CreateFromCode&#40;&#41; oBrw&#58;aCols&#91; 1 &#93;&#58;cHeader = "State" oWnd&#58;oClient = oBrw ACTIVATE WINDOW oWnd return nil static function BuildTree&#40;&#41; local oTree, cState TREE oTree while ! Eof&#40;&#41; if Empty&#40; cState &#41; _TreeItem&#40; Customer->State &#41;&#58;Cargo &#58;= RecNo&#40;&#41; TREE cState = Customer->State else if cState != Customer->State ENDTREE cState = Customer->State _TreeItem&#40; Customer->State &#41;&#58;Cargo &#58;= RecNo&#40;&#41; TREE endif endif if Customer->State == cState _TreeItem&#40; Customer->City &#41;&#58;Cargo &#58;= RecNo&#40;&#41; endif SKIP enddo ENDTREE ENDTREE GO TOP return oTree [/code:fox9mk1r] Test.rc [code:fox9mk1r] open BITMAP "c&#58;\fwh\bitmaps\16x16\folder2&#46;bmp" close BITMAP "c&#58;\fwh\bitmaps\16x16\folder&#46;bmp" go BITMAP "c&#58;\fwh\bitmaps\16x16\go&#46;bmp" [/code:fox9mk1r][url=http&#58;//imageshack&#46;us:fox9mk1r][img:fox9mk1r]http&#58;//img357&#46;imageshack&#46;us/img357/6436/tree2ak5&#46;jpg[/img:fox9mk1r][/url:fox9mk1r]
oTree for xBrowse sample...
With multiple columns:test.prg[code:puy0br0g] #include "FiveWin&#46;ch" #include "xbrowse&#46;ch" function Main&#40;&#41; local oWnd, oBrw USE Customer INDEX ON Field->State TO State SET ORDER TO "State" GO TOP DEFINE WINDOW oWnd TITLE "DbfTree" @ 0, 0 XBROWSE oBrw OF oWnd LINES CELL oBrw&#58;SetTree&#40; BuildTree&#40;&#41;, &#123; "open", "close", "go" &#125; &#41; ADD TO oBrw DATA oBrw&#58;oTreeItem&#58;Cargo&#91; 1 &#93; HEADER "Last" ADD TO oBrw DATA oBrw&#58;oTreeItem&#58;Cargo&#91; 2 &#93; HEADER "First" oBrw&#58;CreateFromCode&#40;&#41; oBrw&#58;aCols&#91; 1 &#93;&#58;cHeader = "State" oWnd&#58;oClient = oBrw ACTIVATE WINDOW oWnd return nil static function BuildTree&#40;&#41; local oTree, cState TREE oTree while ! Eof&#40;&#41; if Empty&#40; cState &#41; _TreeItem&#40; Customer->State &#41;&#58;Cargo &#58;= &#123; Space&#40; 20 &#41;, Space&#40; 20 &#41; &#125; TREE cState = Customer->State else if cState != Customer->State ENDTREE cState = Customer->State _TreeItem&#40; Customer->State &#41;&#58;Cargo &#58;= &#123; Space&#40; 20 &#41;, Space&#40; 20 &#41; &#125; TREE endif endif if Customer->State == cState _TreeItem&#40; Customer->City &#41;&#58;Cargo &#58;= &#123; Customer->Last, Customer->First &#125; endif SKIP enddo ENDTREE ENDTREE GO TOP return oTree [/code:puy0br0g][url=http&#58;//imageshack&#46;us:puy0br0g][img:puy0br0g]http&#58;//img357&#46;imageshack&#46;us/img357/6598/tree3lw5&#46;jpg[/img:puy0br0g][/url:puy0br0g]
oTree for xBrowse sample...
It's a very good sample.What changes should I make on the above sample to display the tree if the user hit enter key also. Right now tree is displayed only when the user double click on the Data.RegardsAnser
oTree for xBrowse sample...
In order to open the browse tree with the keyboard (return key) this change in Class TXBrowse is required:[code:1tycm4vf] METHOD KeyChar&#40; nKey, nFlags &#41; CLASS TXBrowse &#46;&#46;&#46; case nKey == VK_RETURN oCol &#58;= &#58;&#58;SelectedCol&#40;&#41; if oCol&#58;nEditType > 0 &#46;&#46;&#46; else If&#40; &#58;&#58;oTreeItem&#58;oTree != nil,&#40; &#58;&#58;oTreeItem&#58;Toggle&#40;&#41;, &#58;&#58;Refresh&#40;&#41; &#41;,&#41; // new !!! endif &#46;&#46;&#46; [/code:1tycm4vf] In the example, to select the entire row: [code:1tycm4vf] oBrw&#58;nMarqueeStyle = MARQSTYLE_HIGHLROW [/code:1tycm4vf][url=http&#58;//imageshack&#46;us:1tycm4vf][img:1tycm4vf]http&#58;//img399&#46;imageshack&#46;us/img399/8106/treekr8&#46;png[/img:1tycm4vf][/url:1tycm4vf]
oTree for xBrowse sample...
Thankyou Mr.Antonio,Modifying the xBrowse.Prg means either I have to include the modified xBrowse.Prg along with my project or I should generate FiveH.Lib (Harbour) and FiveHx.Lib (xHarbour) to generate a modified lib to reflect the changes made in xBrowse.Prg. Am I right ?.Is there a batch file available to generate FiveH.Lib and FiveHx.Lib ?.Sorry for asking questions which is out of topic of this particular thread. I thought it might be useful for beginners like me who read this thread. Would have been better if we had some solution without altering the xBrowse source.RegardsAnser
oTree for xBrowse sample...
Anser,You can do it both ways:1: Modify xbrowse.prg and compile it and link it as another PRG of your application.2: Modify xbrowse.prg and compile it and update FiveH.lib or FiveHX.lib (if you use Harbour or xHarbour)To rebuild the library you can use this batch file:[code:2gr9mm90] for %%f in &#40;*&#46;prg&#41; do c&#58;\harbour\bin\harbour %%f /n /ic&#58;\fwh\include;c&#58;\harbour\include for %%f in &#40;*&#46;c&#41; do c&#58;\bcc55\bin\bcc32 -c -Ic&#58;\bcc55\include;c&#58;\harbour\include %%f for %%f in &#40;*&#46;obj&#41; do c&#58;\bcc55\bin\tlib fiveh&#46;lib -+ %%f /0 /P32,, [/code:2gr9mm90]
oTree for xBrowse sample...
Thankyou Mr.Antonio
oTree for xBrowse sample...
Senior Linales,Thank you for the kind help.... Your expertise is utmost needed.My best regards!
oTree for xBrowse sample...
Dear Mr. Antonio, How can I make a tree with more than 2 levels using xbrowse? like: AK | +--Tarzana | +-----another level under Tarzana | +---- another level under under Tarzana Best regards, Frances [quote="Antonio Linares":2n1w6iua]Frances, Detlef, Here you have a working example: [code=fw:2n1w6iua]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <br /><br />   <span style="color: #00C800;">local</span> oWnd, oBrw<br /><br />   USE Customer<br />   <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> Field->State <span style="color: #0000ff;">TO</span> State<br />   SET ORDER <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"State"</span><br />   GO TOP<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;">"DbfTree"</span><br /><br />   @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd LINES CELL<br /><br />   oBrw:<span style="color: #000000;">SetTree</span><span style="color: #000000;">&#40;</span> BuildTree<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"State"</span><br /><br />   oWnd:<span style="color: #000000;">oClient</span> = oBrw<br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span>   <br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BuildTree<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oTree, cState<br /><br />   TREE oTree<br />      <span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cState <span style="color: #000000;">&#41;</span><br />            _TreeItem<span style="color: #000000;">&#40;</span> Customer->State <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            TREE<br />            cState = Customer->State<br />         <span style="color: #00C800;">else</span><br />            <span style="color: #00C800;">if</span> cState != Customer->State<br />               ENDTREE<br />               cState = Customer->State<br />               _TreeItem<span style="color: #000000;">&#40;</span> Customer->State <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />               TREE<br />            <span style="color: #00C800;">endif</span>   <br />         <span style="color: #00C800;">endif</span>   <br />         <span style="color: #00C800;">if</span> Customer->State == cState<br />            _TreeItem<span style="color: #000000;">&#40;</span> Customer->City <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endif</span>   <br />         SKIP<br />      <span style="color: #00C800;">enddo</span><br />      ENDTREE<br />   ENDTREE<br /><br />   GO TOP<br /><br /><span style="color: #00C800;">return</span> oTree<br /> </div>[/code:2n1w6iua][/quote:2n1w6iua]
oTree for xBrowse sample...
[code=fw:1rvqketo]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />*<br />*&nbsp; &nbsp;XbTree2.Prg<br />*&nbsp; &nbsp;24-12-2010 08:39 PM<br />*<br />*/</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />REQUEST DBFCDX<br /><br />#xtranslate bmp<span style="color: #000000;">&#40;</span> <c> <span style="color: #000000;">&#41;</span> => <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\"</span> + <c> + "</span>.bmp<span style="color: #ff0000;">"<br /><br />//----------------------------------------------------------------------------//<br /><br />function Main()<br /><br />&nbsp; &nbsp;CreateTestData()<br />&nbsp; &nbsp;TreeBrowse()<br /><br />return (0)<br /><br />//----------------------------------------------------------------------------//<br /><br />init procedure PrgInit<br /><br />&nbsp; &nbsp; SET DATE ITALIAN<br />&nbsp; &nbsp; SET CENTURY ON<br />&nbsp; &nbsp; SET TIME FORMAT TO "</span>HH:<span style="color: #000000;">MM</span>:<span style="color: #000000;">SS</span><span style="color: #ff0000;">"<br />&nbsp; &nbsp; SET EPOCH TO YEAR(DATE())-50<br /><br />&nbsp; &nbsp; SET DELETED ON<br />&nbsp; &nbsp; SET EXCLUSIVE OFF<br /><br />&nbsp; &nbsp; RDDSETDEFAULT( "</span>DBFCDX<span style="color: #ff0000;">" )<br /><br />&nbsp; &nbsp; XbrNumFormat( 'I', .t. )<br />&nbsp; &nbsp; SetKinetic( .f. )<br />&nbsp; &nbsp; SetGetColorFocus()<br /><br />return<br /><br />//----------------------------------------------------------------------------//<br /><br />exit procedure PrgExit<br /><br />&nbsp; &nbsp; SET RESOURCES TO<br /><br />return<br /><br />//----------------------------------------------------------------------------//<br /><br />static function TreeBrowse<br /><br />&nbsp; &nbsp;local oDlg, oBrw, oFont<br />&nbsp; &nbsp;local aTot &nbsp;:= { 0, 0 }<br />&nbsp; &nbsp;local aColors &nbsp;:= { &nbsp;{ CLR_WHITE, &nbsp; CLR_GREEN &nbsp; &nbsp; &nbsp; &nbsp; }, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { CLR_BLACK, &nbsp; RGB(255,255,180) &nbsp;}, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { CLR_BLACK, &nbsp; CLR_WHITE &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp;}<br /><br />&nbsp; &nbsp;DEFINE FONT oFont NAME "</span>TAHOMA<span style="color: #ff0000;">" SIZE 0,-12<br />&nbsp; &nbsp;DEFINE DIALOG oDlg SIZE 600,500 PIXEL ;<br />&nbsp; &nbsp; &nbsp; TITLE "</span><span style="color: #0000ff;">Xbrowse</span> Tree<span style="color: #ff0000;">" FONT oFont<br /><br />&nbsp; &nbsp;@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER FOOTERS<br /><br />&nbsp; &nbsp;oBrw:SetTree( MakeTree( aTot ), { bmp( "</span>open<span style="color: #ff0000;">" ), bmp( "</span><span style="color: #0000ff;">folder</span><span style="color: #ff0000;">" ), bmp( "</span>spurce<span style="color: #ff0000;">" ) } )<br /><br />&nbsp; &nbsp;ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 1 ] PICTURE "</span><span style="color: #000000;">999</span>,<span style="color: #000000;">999</span>,<span style="color: #000000;">999</span><span style="color: #ff0000;">" HEADER "</span>Sales<span style="color: #ff0000;">"<br />&nbsp; &nbsp;ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 2 ] PICTURE "</span><span style="color: #000000;">999</span>,<span style="color: #000000;">999</span>,<span style="color: #000000;">999</span><span style="color: #ff0000;">" HEADER "</span>Margin<span style="color: #ff0000;">"<br /><br />&nbsp; &nbsp;WITH OBJECT ( oBrw:Percent := { || oBrw:Margin:Value / oBrw:Sales:Value * 100 } )<br />&nbsp; &nbsp; &nbsp; :cHeader &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= "</span>%<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; :cEditPicture &nbsp; &nbsp; := "</span><span style="color: #000000;">999.99</span> %<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; :bFooter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= { || aTot[ 2 ] / aTot[ 1 ] * 100 }<br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :bClrStd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= { || aColors[ oBrw:oTreeItem:nLevel ] }<br />&nbsp; &nbsp; &nbsp; :Item:cHeader &nbsp; &nbsp; := "</span>Area<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; :Sales:bFooter &nbsp; &nbsp;:= { || aTot[ 1 ] }<br />&nbsp; &nbsp; &nbsp; :Margin:bFooter &nbsp; := { || aTot[ 2 ] }<br />&nbsp; &nbsp; &nbsp; :nStretchCol &nbsp; &nbsp; &nbsp;:= 1<br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;oBrw:CreateFromCode()<br />&nbsp; &nbsp;oBrw:oTree:OpenAll()<br /><br />&nbsp; &nbsp;ACTIVATE DIALOG oDlg CENTERED<br />&nbsp; &nbsp;RELEASE FONT oFont<br /><br />return nil<br /><br />//----------------------------------------------------------------------------//<br /><br />static function MakeTree( aTot )<br /><br />&nbsp; &nbsp;local oTree<br />&nbsp; &nbsp;local cRegion, cCountry<br />&nbsp; &nbsp;local oRegion, oCountry<br /><br />&nbsp; &nbsp;USE SALEDATA NEW ALIAS SD SHARED READONLY<br />&nbsp; &nbsp;SET ORDER TO TAG AREA<br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;TREE oTree<br /><br />&nbsp; &nbsp;do while !SD->( eof() )<br />&nbsp; &nbsp; &nbsp; TREEITEM oRegion PROMPT SD->REGION CARGO { 0, 0 }<br />&nbsp; &nbsp; &nbsp; cRegion &nbsp; &nbsp; := SD->REGION<br /><br />&nbsp; &nbsp; &nbsp; TREE<br />&nbsp; &nbsp; &nbsp; do while SD->REGION == cRegion<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TREEITEM oCountry PROMPT SD->COUNTRY CARGO { 0, 0 }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cCountry := SD->COUNTRY<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TREE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;do while SD->COUNTRY == cCountry<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TREEITEM SD->CITY CARGO { SD->SALES, SD->MARGIN }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oCountry:Cargo[ 1 ] &nbsp;+= SD->SALES<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oCountry:Cargo[ 2 ] &nbsp;+= SD->MARGIN<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SD->( DbSkip( 1 ) )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enddo<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ENDTREE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRegion:Cargo[ 1 ] &nbsp; += oCountry:Cargo[ 1 ]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRegion:Cargo[ 2 ] &nbsp; += oCountry:Cargo[ 2 ]<br />&nbsp; &nbsp; &nbsp; enddo<br />&nbsp; &nbsp; &nbsp; ENDTREE<br />&nbsp; &nbsp; &nbsp; aTot[ 1 ] &nbsp; += oRegion:Cargo[ 1 ]<br />&nbsp; &nbsp; &nbsp; aTot[ 2 ] &nbsp; += oRegion:Cargo[ 2 ]<br /><br />&nbsp; &nbsp;enddo<br /><br />&nbsp; &nbsp;ENDTREE<br />&nbsp; &nbsp;CLOSE SD<br /><br />return oTree<br /><br />//----------------------------------------------------------------------------//<br /><br />static function createTestData()<br /><br />&nbsp; &nbsp;field REGION,COUNTRY,CITY<br /><br />&nbsp; &nbsp;local aCols := { &nbsp;;<br />&nbsp; &nbsp; &nbsp; { &nbsp;"</span>REGION<span style="color: #ff0000;">", &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp; 0 &nbsp;}, ;<br />&nbsp; &nbsp; &nbsp; { &nbsp;"</span>COUNTRY<span style="color: #ff0000;">", &nbsp;"</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp; 0 &nbsp;}, ;<br />&nbsp; &nbsp; &nbsp; { &nbsp;"</span>CITY<span style="color: #ff0000;">", &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp; 0 &nbsp;}, ;<br />&nbsp; &nbsp; &nbsp; { &nbsp;"</span>SALES<span style="color: #ff0000;">", &nbsp; &nbsp;"</span>N<span style="color: #ff0000;">", &nbsp;10, &nbsp; 0 &nbsp;}, ;<br />&nbsp; &nbsp; &nbsp; { &nbsp;"</span>MARGIN<span style="color: #ff0000;">", &nbsp; "</span>N<span style="color: #ff0000;">", &nbsp;10, &nbsp; 0 &nbsp;} &nbsp;}<br /><br />&nbsp; &nbsp;local i,n,m<br /><br />&nbsp; &nbsp;DbCreate( "</span>SALEDATA.DBF<span style="color: #ff0000;">", aCols )<br /><br />&nbsp; &nbsp;USE SALEDATA EXCLUSIVE<br /><br />&nbsp; &nbsp;for i := 1 to 20<br /><br />&nbsp; &nbsp; &nbsp; APPEND BLANK<br />&nbsp; &nbsp; &nbsp; n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := HB_RandomInt( 1, 4 )<br />&nbsp; &nbsp; &nbsp; REGION &nbsp; &nbsp; &nbsp;:= { "</span>AMERICAS<span style="color: #ff0000;">","</span>EUROPE<span style="color: #ff0000;">","</span>ASIA<span style="color: #ff0000;">","</span>OCEANA<span style="color: #ff0000;">" }[ n ]<br />&nbsp; &nbsp; &nbsp; m &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := HB_RandomInt( 1, 2 )<br />&nbsp; &nbsp; &nbsp; COUNTRY &nbsp; &nbsp; := {{"</span>USA<span style="color: #ff0000;">","</span>CANADA<span style="color: #ff0000;">"},{"</span>ITALY<span style="color: #ff0000;">","</span>SPAIN<span style="color: #ff0000;">"},{"</span>CHINA<span style="color: #ff0000;">","</span>INDIA<span style="color: #ff0000;">"},{"</span>AU<span style="color: #ff0000;">","</span>NZ<span style="color: #ff0000;">"}}[ n, m ]<br />&nbsp; &nbsp; &nbsp; CITY &nbsp; &nbsp; &nbsp; &nbsp;:= "</span>City <span style="color: #ff0000;">" + StrZero( i, 2 )<br />&nbsp; &nbsp; &nbsp; n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := HB_Random( 10000,1000000 )<br />&nbsp; &nbsp; &nbsp; m &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := HB_Random( 1000, n * 0.1 )<br />&nbsp; &nbsp; &nbsp; FIELD->SALES &nbsp; := n<br />&nbsp; &nbsp; &nbsp; FIELD->MARGIN &nbsp;:= m<br /><br />&nbsp; &nbsp;next i<br /><br />&nbsp; &nbsp;INDEX ON REGION+COUNTRY+CITY TAG AREA<br />&nbsp; &nbsp;CLOSE DATA<br /><br />return nil<br /><br />//----------------------------------------------------------------------------//<br /></span></div>[/code:1rvqketo] You can use the above logic to create any number of levels [url=http&#58;//img811&#46;imageshack&#46;us/i/xbtree2&#46;jpg/:1rvqketo][img:1rvqketo]http&#58;//img811&#46;imageshack&#46;us/img811/46/xbtree2&#46;jpg[/img:1rvqketo][/url:1rvqketo]
oTree for xBrowse sample...
Dear Mr. RAO, Thanks so much for a great sample... We can define number of levels by code.. What if the user wish to create level after level of tree using xbrowse? Is that possible with xbrowse (RDD)? Regards, Frances HAPPY NEW YEAR!!!
oTree for xBrowse sample...
Please also see the samples I posted here, using related DBFs to show as tree <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=20761&p=110295#p110295">viewtopic.php?f=6&t=20761&p=110295#p110295</a><!-- l -->
oTree for xBrowse sample...
[quote="nageswaragunupudi":1qx09q0a]Please also see the samples I posted here, using related DBFs to show as tree <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=20761&p=110295#p110295">viewtopic.php?f=6&t=20761&p=110295#p110295</a><!-- l -->[/quote:1qx09q0a] Thanks Mr. RAO... i've been waiting for your reply. Your sample shows 2 level... i'm having problem with multiple level.. I hope you have a similar example. Kind regards, Frances
oTree for xBrowse sample...
[quote="fraxzi":bu1qub6l][quote="nageswaragunupudi":bu1qub6l]Please also see the samples I posted here, using related DBFs to show as tree <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=20761&p=110295#p110295">viewtopic.php?f=6&t=20761&p=110295#p110295</a><!-- l -->[/quote:bu1qub6l] Thanks Mr. RAO... i've been waiting for your reply. Your sample shows 2 level... i'm having problem with multiple level.. I hope you have a similar example. Kind regards, Frances[/quote:bu1qub6l] The logic for construction of trees is similar for any number of levels. Can you explain a situation where you are looking for a solution?
oTree para video FUNCIONANDO
Confieso no tener ni idea de como tratar los objetos Tree, nunca los he necesitado, pero he cogido un ejemplo del foro y es lo que estoy buscando para poder ver, añadir, borrar ficheros de video a mi aplicación. A ver si me podeis echar una mano en como seleccionar un fichero de los que muestra el tree. [code=fw:3pl81a0t]<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;">&#40;</span><span style="color: #000000;">&#41;</span><br />     Video<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">".<span style="color: #000000;">\D</span>AT<span style="color: #000000;">\V</span>ID<span style="color: #000000;">\"</span>+"</span>DOC000003<span style="color: #ff0000;">"+"</span>.*<span style="color: #ff0000;">")<br />Return nil<br /><br /><br />function Video()<br />    parameters x_file, x_msg<br /><br />    local oDlg, oTree<br /><br />    DEFAULT x_msg := "</span>Fichero no localizado...<span style="color: #ff0000;">"<br /><br />    DEFINE DIALOG oDlg SIZE 500, 340 TITLE "</span>Archivos de video relacionados<span style="color: #ff0000;">"<br /><br />   @ 0.5, 1 TREEVIEW oTree OF oDlg SIZE 100, 150<br /><br />     @ 1, 27 BUTTON "</span>&Ver<span style="color: #ff0000;">" OF oDlg SIZE 40, 12 ;<br />     ACTION (msginfo(oTree:GetSelected():cPrompt) , oDlg:End()) DEFAULT         //(WinExec("</span>CMD /C START /separate <span style="color: #ff0000;">" + x_file,0)<br /><br />     @ 3, 27 BUTTON "</span>&Añadir <span style="color: #ff0000;">" OF oDlg SIZE 40, 12 ;<br />     ACTION (CopyFile(cGetFile("</span>*.mp4;*.mov;*.avi;*.mkv;*.flv;*.swf;*.m4v<span style="color: #ff0000;">" ,"</span>Selecciona fichero<span style="color: #ff0000;">", , "</span>..<span style="color: #ff0000;">"), x_file ), oDlg:End())<br /><br /><br />    <br />     @ 5, 27 BUTTON "</span>&Borrar <span style="color: #ff0000;">" OF oDlg SIZE 40, 12 ;<br />     ACTION oDlg:End() DEFAULT<br /><br />   @ 7, 27 BUTTON "</span>&Abandonar<span style="color: #ff0000;">" OF oDlg SIZE 40, 12 ;<br />     ACTION ( cValue := nil, oDlg:End() )<br /><br /><br />   ACTIVATE DIALOG oDlg CENTERED ;<br />      ON INIT FillTree( oTree, x_file )<br /><br />return nil<br /><br /><br />function FillTree( oTree, cPath, oItem )<br /><br />   local aInfo := Directory( cPath, "</span>D<span style="color: #ff0000;">" )<br />   local n, oNode<br /><br /><br />     xbrowse (aInfo)<br />   for n = 1 to Len( aInfo )<br />      if ! aInfo[ n ][ 1 ] $ "</span>.,..<span style="color: #ff0000;">"<br />         if oItem == nil<br />            oNode = oTree:Add( aInfo[ n ][ 1 ] )<br />         else<br />            oNode = oItem:Add( aInfo[ n ][ 1 ] )<br />         endif<br />         if "</span>D<span style="color: #ff0000;">" $ aInfo[ n ][ 5 ]<br />            FillTree( oTree, cPath + aInfo[ n ][ 1 ] + "</span>\<span style="color: #ff0000;">", oNode )<br />         endif<br />      endif<br />   next<br /><br />return nil<br /><br /></span></div>[/code:3pl81a0t] Cómo puedo seleccionar el fichero que muestra y tengo seleccionado en el tree, he intentado algo como lo siguiente, pero no me da el correcto con el boton Ver: [quote:3pl81a0t]msginfo(oTree:GetSelected():cPrompt) [/quote:3pl81a0t] [url=http&#58;//es&#46;zimagez&#46;com/zimage/screenshot04811&#46;php:3pl81a0t][img:3pl81a0t]http&#58;//es&#46;zimagez&#46;com/miniature/screenshot04811&#46;bmp[/img:3pl81a0t][/url:3pl81a0t]
oTree para video FUNCIONANDO
Gracias Cristobal ya me esta funcionando. Asi me muestra el video correctamente: [code=fw:197gpwkp]<div class="fw" id="{CB}" style="font-family: monospace;">@ <span style="color: #000000;">1</span>, <span style="color: #000000;">27</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ver"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> WinExec<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"CMD /C START /separate "</span> + cFilePath<span style="color: #000000;">&#40;</span>x_file<span style="color: #000000;">&#41;</span> + oTree:<span style="color: #000000;">GetSelected</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">cPrompt</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> , oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">DEFAULT</span><br /><br />&nbsp;</div>[/code:197gpwkp]
oTree para video FUNCIONANDO
Creo que es algo más y no he entendido bien porque a mi si me muestra el item seleccionado [img:309i5tzs]https&#58;//s8&#46;postimg&#46;org/nzv8q5fit/andres01&#46;png[/img:309i5tzs]
oTree para video FUNCIONANDO
Ya funciona todo, sirve para añadir ficheros de video (solo uno por cada tipo) a un directorio y relacionarlo con un registro por ejemplo: [code=fw:pti20iyj]<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;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #B900B9;">//Video(".\DAT\VID\"+RTRIM(Q_T)+".*")</span><br />     Video<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">".<span style="color: #000000;">\D</span>AT<span style="color: #000000;">\V</span>ID<span style="color: #000000;">\"</span>+"</span>DOC000003<span style="color: #ff0000;">"+"</span>.*<span style="color: #ff0000;">")<br />Return nil<br /><br /><br />function Video()<br />    parameters x_file, x_msg<br /><br />    local oDlg, oTree<br /><br />    DEFAULT x_msg := "</span>Fichero no localizado...<span style="color: #ff0000;">"<br /><br />    DEFINE DIALOG oDlg SIZE 500, 340 TITLE "</span>Archivos de video relacionados<span style="color: #ff0000;">"<br /><br />   @ 0.5, 1 TREEVIEW oTree OF oDlg SIZE 100, 150<br /><br />     @ 1, 27 BUTTON "</span>&Ver<span style="color: #ff0000;">" OF oDlg SIZE 40, 12 ;<br />     ACTION ( WinExec("</span>CMD /C START /separate <span style="color: #ff0000;">" + cFilePath(x_file) + oTree:GetSelected():cPrompt,0) , oDlg:End()) DEFAULT<br /><br />     @ 3, 27 BUTTON "</span>&Añadir <span style="color: #ff0000;">" OF oDlg SIZE 40, 12 ;<br />     ACTION ( AddVideo(x_file), oDlg:End() )<br /><br />     @ 5, 27 BUTTON "</span>&Borrar <span style="color: #ff0000;">" OF oDlg SIZE 40, 12 ;<br />     ACTION (iif(MsgYesNo("</span>Deseas eliminar el fichero<span style="color: #ff0000;">"),filedelete(cFilePath(x_file) + oTree:GetSelected():cPrompt),),oDlg:End())<br /><br />   @ 7, 27 BUTTON "</span>&Abandonar<span style="color: #ff0000;">" OF oDlg SIZE 40, 12 ;<br />     ACTION ( cValue := nil, oDlg:End() )<br /><br /><br />   ACTIVATE DIALOG oDlg CENTERED ;<br />      ON INIT FillTree( oTree, x_file )<br /><br />return nil<br /><br /><br />function FillTree( oTree, cPath, oItem )<br /><br />   local aInfo := Directory( cPath, "</span>D<span style="color: #ff0000;">" )<br />   local n, oNode<br /><br /><br />     xbrowse (aInfo)<br />   for n = 1 to Len( aInfo )<br />      if ! aInfo[ n ][ 1 ] $ "</span>.,..<span style="color: #ff0000;">"<br />         if oItem == nil<br />            oNode = oTree:Add( aInfo[ n ][ 1 ] )<br />         else<br />            oNode = oItem:Add( aInfo[ n ][ 1 ] )<br />         endif<br />         if "</span>D<span style="color: #ff0000;">" $ aInfo[ n ][ 5 ]<br />            FillTree( oTree, cPath + aInfo[ n ][ 1 ] + "</span>\<span style="color: #ff0000;">", oNode )<br />         endif<br />      endif<br />   next<br /><br />return nil<br /><br />function AddVideo(x_file)<br /><br />     Local cFile := cGetFile("</span>*.mp4;*.mov;*.avi;*.mkv;*.flv;*.swf;*.m4v<span style="color: #ff0000;">" ,"</span>Selecciona fichero<span style="color: #ff0000;">", , "</span>C:\<span style="color: #ff0000;">")<br />            x_file := cFilePath(x_file) + cFileNoExt(x_file) + "</span>.<span style="color: #ff0000;">" + cFileExt(cFile)<br />            CopyFile(cFile, x_file)<br /><br />Return nil<br /><br /><br /></span></div>[/code:pti20iyj] [url=http&#58;//es&#46;zimagez&#46;com/zimage/screenshot001267&#46;php:pti20iyj][img:pti20iyj]http&#58;//es&#46;zimagez&#46;com/miniature/screenshot001267&#46;bmp[/img:pti20iyj][/url:pti20iyj]
oTree y los itemlevel()
hola. Con oTree:itemLevel() obtengo el nivel actual, pero para saber cuantas ramas tiene ese nivel, como lo hago? gracias.
oTree:GetSelText()
oTree:GetSelText() solo me recoge los 100 primeros caracteres ¿Se puede aumentar este número? ¿Cómo? Un saludo, Manuel
oTree:setCheck() Error!
Hi Antonio, James and friends!I have a little doubt... When I try to check a TVItem, the fivewin gives me the following error:[code:1eptzw5n]Application =========== Path and name&#58; C&#58;\xGenesis\genesis&#46;EXE &#40;32 bits&#41; Size&#58; 1,409,536 bytes Time from start&#58; 0 hours 0 mins 42 secs Error occurred at&#58; 26/08/2008, 11&#58;57&#58;28 Error description&#58; Error BASE/1004 Message not found&#58; TTVITEM&#58;HWND Stack Calls =========== Called from&#58; source\rtl\tobject&#46;prg => TTVITEM&#58;ERROR&#40;172&#41; Called from&#58; source\rtl\tobject&#46;prg => TTVITEM&#58;MSGNOTFOUND&#40;181&#41; Called from&#58; source\rtl\tobject&#46;prg => TTVITEM&#58;HWND&#40;0&#41; Called from&#58; &#46;\source\classes\TTreeVie&#46;PRG => &#40;b&#41;TTREEVIEW&#58;TTREEVIEW&#40;0&#41; Called from&#58; => TTREEVIEW&#58;SETCHECK&#40;0&#41;[/code:1eptzw5n] I'm using like this: [b:1eptzw5n]oTree:setCheck( oItem, .T. )[/b:1eptzw5n] The method setCheck above returns a error for the [b:1eptzw5n]oItem:hWnd[/b:1eptzw5n] [code:1eptzw5n]METHOD SetCheck&#40; oItem, lOnOff &#41; INLINE ; If&#40; oItem == nil, oItem &#58;= &#58;&#58;GetSelected&#40;&#41;, nil &#41;, ; TVSetCheck&#40; &#58;&#58;hWnd, oItem&#58;hWnd, lOnOff &#41;[/code:1eptzw5n]
oTree:setCheck() Error!
I execute a loop into a oMenu:aItems for get the prompts for adding like a option by the TreeView.[code:2cy9e82u] STATIC FUNCTION loadTreeAccess&#40; oMenu, oTree &#41; LOCAL oRoot LOCAL aItens &#58;= &#123;&#125; LOCAL nPos &#58;= 0 aItens &#58;= oMenu&#58;aItems FOR nPos &#58;= 1 TO len&#40; aItens &#41; IF valType&#40; aItens&#91;nPos&#93;&#58;bAction &#41; == "O" &#46;AND&#46; upper&#40; aItens&#91;nPos&#93;&#58;bAction&#58;className&#40;&#41; &#41; == "TMENU" oRoot &#58;= oTree&#58;add&#40; strtran&#40; aItens&#91;nPos&#93;&#58;cPrompt, "&", "" &#41;, 1 &#41; loadTreeAccess&#40; aItens&#91;nPos&#93;&#58;bAction, oRoot &#41; ELSEIF !empty&#40; aItens&#91;nPos&#93;&#58;cargo &#41; oTree&#58;add&#40; strtran&#40; aItens&#91;nPos&#93;&#58;cPrompt, "&", "" &#41;, 1, aItens&#91;nPos&#93;&#58;cargo &#41; ENDIF NEXT RETURN&#40; oTree &#41; [/code:2cy9e82u]I see the Tree normally, but cannot check the option with setCheck() method.
oTree:setCheck() Error!
I solved this using directly the function called by the method[b:32yafthj]TVSetCheck( oObjTree:hWnd, oObjItem:hItem, .T. )[/b:32yafthj]and [b:32yafthj]TVGetCheck( oObjTree:hWnd, oObjItem:hItem )[/b:32yafthj]But, the method not works! The erros is the exchange of [u:32yafthj]oObjItem:hItem[/u:32yafthj] for [u:32yafthj]oObjItem:hWnd[/u:32yafthj]
oTree:setCheck() Error!
Somebody!?
oTree:setCheck() Error!
Júlio,Yes, you are right, its a bug in Class TTreeView. Fixed, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->This is the right code:[code:1quik69m] METHOD GetCheck&#40; oItem &#41; INLINE ; If&#40; oItem == nil, oItem &#58;= &#58;&#58;GetSelected&#40;&#41;, nil &#41;, ; TVGetCheck&#40; &#58;&#58;hWnd, oItem&#58;hItem &#41; METHOD SetCheck&#40; oItem, lOnOff &#41; INLINE ; If&#40; oItem == nil, oItem &#58;= &#58;&#58;GetSelected&#40;&#41;, nil &#41;, ; TVSetCheck&#40; &#58;&#58;hWnd, oItem&#58;hItem, lOnOff &#41; [/code:1quik69m]Both methods had the bug
oWdn:Say - SAY class
would someone be so kind to explain the difference of oWdn:Say and the SAY class. oSay is repainted automatically what does this mean for the memory usage. Thanks in advance Otto
oWdn:Say - SAY class
[quote="Otto":jlkb3eo0]would someone be so kind to explain the difference of oWdn:Say and the SAY class. oSay is repainted automatically what does this mean for the memory usage. Thanks in advance Otto[/quote:jlkb3eo0] oWnd:Say() is just a text printed on the specified window while TSay is a real control. And yes, it surely uses more resources but I wouldn't care. EMG
oWdn:Say - SAY class
Hello Enrico, thank you. But memory seems to be a problem. See my test - prg. Maybe I call it the wrong way. But if you call the test function with oSay more times the program crashes. Regards, Otto #include "FiveWin.ch" //----------------------------------------------------------------------------// STATIC n function Main() local oWnd, oFont N:=1 DEFINE FONT oFont NAME "Arial" SIZE 20, 30 DEFINE WINDOW oWnd FROM 1, 1 TO 30, 80 TITLE "Testing Method Say()" @ 1, 1 BUTTON " oWnd : Say " OF oWnd SIZE 60, 25 ; ACTION test2(oWnd,oFont) @ 1, 30 BUTTON " oSay " OF oWnd SIZE 60, 25 ; ACTION test(oWnd,oFont) ACTIVATE WINDOW oWnd MAXIMIZED RELEASE FONT oFont return //----------------------------------------------------------------------------// func test(oWnd,oFont) LOCAL I:=0 FOR N := 1 TO 60 STEP 2 FOR I := 1 TO 200 STEP 4 @ n,I SAY ALLTRIM(STR(i))+" ." OF oWnd FONT ofont COLORS nRGB( 255, 0, 0 ) , nRGB( 55, 55, 255) NEXT NEXT msginfo("ENDE") return nil func test2(oWnd,oFont) LOCAL I:=0 FOR N := 1 TO 60 STEP 2 FOR I := 1 TO 200 STEP 4 oWnd:Say( n, I, ALLTRIM(STR(i))+" .", nRGB( 255, 0, 0 ) , nRGB( 255, 2255, 255),oFont ) NEXT NEXT msginfo("ENDE") return nil
oWdn:Say - SAY class
[quote="Otto":3qvw0d8r]Hello Enrico, thank you. But memory seems to be a problem. See my test - prg. Maybe I call it the wrong way. But if you call the test function with oSay more times the program crashes.[/quote:3qvw0d8r] Yes, because you are creating more and more TSay objects while one would be enough. Once created you can simply refresh it or change its text. EMG
oWdn:Say - SAY class
Hello Enrico, could you show me how to do, please. Thanks in advance Otto
oWdn:Say - SAY class
It depends on what you are trying to do. Generally speaking, consider TSay as any other control. Try to change your sample replacing SAYs with GETs: would it make sense? Moreover, look at Refresh() and SetText() methods. EMG
oWdn:Say - SAY class
I think osay / oget does not work for this job because I need all the information on the proper place. If I try with Settext, nTop, nLeft and refresh I lose the former information. Thanks again. Regards, Otto
oWebView:Eval() in a loop
Hi, In the loop, I call oWebView:Eval() and try to process the results in the Result() function. However, it does not work out in any way <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> [code=fw:3mvl5nyu]<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;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">private</span> oDlg, oWebView<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"This is a dialog"</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"N/B"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">200</span><br /><br />   @ <span style="color: #000000;">3</span>,  <span style="color: #000000;">8</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span> <span style="color: #0000ff;">ACTION</span> Start<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">Cargo</span>:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span> <span style="color: #0000ff;">CENTERED</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Html<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cHtml<br /><br />   <span style="color: #0000ff;">TEXT</span> INTO cHtml<br />      <span style="color: #00C800;">data</span>:<span style="color: #0000ff;">text</span>/html,<br />      <html><br />         <head><br />            <meta charset=<span style="color: #ff0000;">"UTF-8"</span> ><br />         </head><br />         <body <span style="color: #0000ff;">style</span>=<span style="color: #ff0000;">"background-color:cyan"</span>><br />           <button <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"bt"</span> <span style="color: #0000ff;">style</span>=<span style="color: #ff0000;">"display:none;"</span>>the test is completed</button><br />           <script><br />              <span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span>num<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />                SendToFWH<span style="color: #000000;">&#40;</span>num<span style="color: #000000;">&#41;</span> ;<br />              <span style="color: #000000;">&#125;</span> ;<br />              <span style="color: #00C800;">function</span> ViwB<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />                el=document.getElementById<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"bt"</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000ff;">style</span>.<span style="color: #00C800;">display</span>=<span style="color: #ff0000;">""</span> ;<br />              <span style="color: #000000;">&#125;</span> ;<br />           </script><br />         </body><br />      </html><br />   ENDTEXT<br /><span style="color: #00C800;">return</span> cHtml<br /><br />procedure Start<br /><span style="color: #00C800;">local</span> st<br /><br /> <span style="color: #00C800;">if</span> valtype<span style="color: #000000;">&#40;</span>oWebView<span style="color: #000000;">&#41;</span>!=<span style="color: #ff0000;">"O"</span><br />   oWebView := TWebView<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oWebView:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">800</span>, <span style="color: #000000;">200</span><span style="color: #000000;">&#41;</span><br />   oWebView:<span style="color: #000000;">bOnBind</span> = <span style="color: #000000;">&#123;</span> | cJson, nCalls | Result<span style="color: #000000;">&#40;</span>cJson<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oWebView:<span style="color: #000000;">Bind</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SendToFWH"</span> <span style="color: #000000;">&#41;</span><br />   oWebView:<span style="color: #000000;">Navigate</span><span style="color: #000000;">&#40;</span> Html<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">for</span> st=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br />   oWebView:<span style="color: #000000;">Eval</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Test("</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>st<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")"</span> <span style="color: #000000;">&#41;</span><br /><br /><br />? oDlg:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>, oDlg:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />       oDlg:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:=oDlg:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br /> <span style="color: #00C800;">next</span><br />? oDlg:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br /> oWebView:<span style="color: #000000;">Eval</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ViwB()"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #00C800;">function</span> Result<span style="color: #000000;">&#40;</span>num<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> dat<br /><br />  Hb_JsonDecode<span style="color: #000000;">&#40;</span>num, @dat<span style="color: #000000;">&#41;</span><br />  oDlg:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>+=dat<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br /><br />? <span style="color: #ff0000;">"C"</span>, oDlg:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">return</span></div>[/code:3mvl5nyu]
oWebView:Eval() in a loop
For me run Ok [url=https&#58;//postimg&#46;cc/D8kLmV6Z:1408l13z][img:1408l13z]https&#58;//i&#46;postimg&#46;cc/Yqj3nMm1/natter02&#46;png[/img:1408l13z][/url:1408l13z] Please try with my executable <!-- m --><a class="postlink" href="https://bitbucket.org/fivetech/fivewin-contributions/downloads/natterWebView.exe">https://bitbucket.org/fivetech/fivewin- ... ebView.exe</a><!-- m -->
oWebView:Eval() in a loop
Cristobal, thank you for your help, but when trying to download your example, a message appears - [b:2s3cwhlf]An error when establishing a secure connection When connected to bbuseruploads.s3.amazonaws.com an error has occurred. The node received a valid certificate, but access was denied. [/b:2s3cwhlf]
oWebView:Eval() in a loop
Dear Natter What browser are you using? It is the download server for Fivetech contributions. No one has had any problems. There are already 13 downloads of that file If when downloading it warns you that the file may be dangerous, ignore the message and download it.
oWebView:Eval() in a loop
Cristobal, we didn't understand each other. In my example, I tried to show the problem that I had when working with webview.Eval() in a loop. It is as follows - 1. Webview.Eval() executes a certain JS script and returns the result to the FW. 2. Only after receiving this result can I continue executing the loop. It is this check that I do not succeed. <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
oWebView:Eval() in a loop
Dear Yuri, Your example works fine here too
oWebView:Eval() in a loop
In the loop, I call the webview.Eval() method 5 times. Checking the answers looks like this: 1,0 / 2,0 /3,2 / 4,3 / 5,4 Although, as it seems to me, it should be - 1,1 / 2,2 / 3,3 / 4,4 / 5,5 [code=fw:3ftpeb7h]<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;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">private</span> oDlg, oWebView<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"This is a dialog"</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"N/B"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">200</span><br /><br />   @ <span style="color: #000000;">3</span>,  <span style="color: #000000;">8</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span> <span style="color: #0000ff;">ACTION</span> Start<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">Cargo</span>:=<span style="color: #000000;">0</span> <span style="color: #0000ff;">CENTERED</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">local</span> cHtml, flg:=.T.<br /><br />   <span style="color: #0000ff;">TEXT</span> INTO cHtml<br />      <span style="color: #00C800;">data</span>:<span style="color: #0000ff;">text</span>/html,<br />      <html><br />         <head><br />            <meta charset=<span style="color: #ff0000;">"UTF-8"</span> ><br />         </head><br />         <body <span style="color: #0000ff;">style</span>=<span style="color: #ff0000;">"background-color:cyan"</span>><br />           <button <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"bt"</span> <span style="color: #0000ff;">style</span>=<span style="color: #ff0000;">"display:none;"</span>>Start process</button><br />           <script><br />              <span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span>num<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />                SendToFWH<span style="color: #000000;">&#40;</span>num<span style="color: #000000;">&#41;</span> ;<br />              <span style="color: #000000;">&#125;</span> ;<br />              <span style="color: #00C800;">function</span> Viw<span style="color: #000000;">&#40;</span>num<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />                el=document.getElementById<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"bt"</span><span style="color: #000000;">&#41;</span> ;<br />                el.innerText=<span style="color: #ff0000;">"total "</span>+num ;<br />                el.<span style="color: #0000ff;">style</span>.<span style="color: #00C800;">display</span>=<span style="color: #ff0000;">""</span> ;<br />              <span style="color: #000000;">&#125;</span> ;<br />           </script><br />         </body><br />      </html><br />   ENDTEXT<br /><span style="color: #00C800;">return</span> cHtml<br /><br />procedure Start<br /><span style="color: #00C800;">local</span> st<br /><br /> <span style="color: #00C800;">if</span> valtype<span style="color: #000000;">&#40;</span>oWebView<span style="color: #000000;">&#41;</span>!=<span style="color: #ff0000;">"O"</span><br />   oWebView := TWebView<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oWebView:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">800</span>, <span style="color: #000000;">200</span><span style="color: #000000;">&#41;</span><br />   oWebView:<span style="color: #000000;">bOnBind</span> = <span style="color: #000000;">&#123;</span> | cJson, nCalls | Result<span style="color: #000000;">&#40;</span>cJson<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oWebView:<span style="color: #000000;">Bind</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SendToFWH"</span> <span style="color: #000000;">&#41;</span><br />   oWebView:<span style="color: #000000;">Navigate</span><span style="color: #000000;">&#40;</span> Html<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">for</span> st=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br />   oWebView:<span style="color: #000000;">Eval</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Test("</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>st<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")"</span> <span style="color: #000000;">&#41;</span><br />   millisec<span style="color: #000000;">&#40;</span><span style="color: #000000;">1000</span><span style="color: #000000;">&#41;</span><br /><br />? st, oDlg:<span style="color: #000000;">Cargo</span><br /> <span style="color: #00C800;">next</span><br /> oWebView:<span style="color: #000000;">Eval</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Viw("</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>oDlg:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #00C800;">function</span> Result<span style="color: #000000;">&#40;</span>num<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> dat<br /><br />  Hb_JsonDecode<span style="color: #000000;">&#40;</span>num, @dat<span style="color: #000000;">&#41;</span><br />  oDlg:<span style="color: #000000;">Cargo</span>:=dat<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">return</span></div>[/code:3ftpeb7h]
oWnd got focus
Hi all, how can I know if the main window (oWnd) has focus ? Thank you in advance.
oWnd got focus
Hi, take a look at: <!-- l --><a class="postlink-local" href="http://fivetechsupport.com/forums/viewtopic.php?f=3&t=23320&start=0&hilit=lfocused">viewtopic.php?f=3&t=23320&start=0&hilit=lfocused</a><!-- l -->
oWnd got focus
Solved. thank you. if oWnd:owndclient:lFocused=.f. && mdi hasn't the focus return endif
oWnd:End()
[code=fw:1jkdwaju]<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<br />&nbsp;<span style="color: #00C800;">Public</span> lSair:=.f.<br />&nbsp;<span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> ownd<br />&nbsp;<span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> obtn ........ <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span>lSair:=.t.,ownd:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> ownd;<br />&nbsp;<span style="color: #0000ff;">valid</span> lSair<br /><br />&nbsp;<span style="color: #00C800;">function</span> buttonCLOSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// execute this when button close of window was clicked.</span><br />&nbsp; &nbsp;lSair:.t.<br />&nbsp; &nbsp;ownd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">return</span><br />&nbsp;</div>[/code:1jkdwaju] how make to button [X] sysmenu, close direct when receive click. when use oWnd:bResized return button Minimize / Maximize i want know if have to button Close too. Someone can help ? thanks
oWnd:End()
Why don't you try a different approach. Only run your process if the user presses the "Do Whatever" button, something like this: [code=fw:274itfso]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> lProcess:=.f., oWnd, oBtn<br />   <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd<br />   <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> obtn <span style="color: #0000ff;">prompt</span> <span style="color: #ff0000;">"Do Whatever"</span>........ <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span>lProcess:=.t.,oWnd:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd;<br />   <span style="color: #0000ff;">valid</span> process<span style="color: #000000;">&#40;</span>lProcess<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Process<span style="color: #000000;">&#40;</span>lProcess<span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">if</span> lProcess<br />      <span style="color: #B900B9;">// do whatever</span><br />   <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> .t.</div>[/code:274itfso]
oWnd:End()
Like James suggests .. here is a snipit of code to trap the |X| and close and clean up your environment. Rick [code=fw:37jjkc9p]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">Static</span> lOK,oWnd<br /><br /><span style="color: #B900B9;">//----------</span><br />Func Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />lOk := .f.<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd              ;<br />       BuildMenu<span style="color: #000000;">&#40;</span>oRsFr<span style="color: #000000;">&#41;</span>               ;<br />...<br />...<br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd           ;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> !lOK, FreqClose<span style="color: #000000;">&#40;</span>.T., oRsFr<span style="color: #000000;">&#41;</span>, .F. <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// traps close</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//------------------//</span><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">FUNCTION</span> BuildMenu<span style="color: #000000;">&#40;</span> oRsFr<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> oMenu1<br /><br /><span style="color: #0000ff;">MENU</span> oMenu1<br /><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Add ..."</span>                             ;<br />    <br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Edit ..."</span>                            ;<br />    <br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Delete ..."</span>                          ;<br />              <br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&View ..."</span>                            ;<br />              <br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Quit"</span>                                ;<br />               <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// will fire freqclose as well</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> oMenu1 <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//------------------------</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">FUNCTION</span> FreqClose<span style="color: #000000;">&#40;</span> lCLEAN, oRsFr <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> lCLEAN = .T.<br />   lOK := .T.<br />   oBROW:<span style="color: #000000;">cALIAS</span>:=<span style="color: #00C800;">NIL</span><br />   oRsFr:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:37jjkc9p]
oWnd:End() oDlg:End()
Hi Antonio Have started trying to port an actual application. It seems that neither oWnd:End() nor oDlg:End() work as anticipated. When I compile the code below Selecting File Exit from the menu does nothing except stop Help About from working, and if I go Help About and hit the Exit button once nothing happens - hit it a second time and the application exits altogether. But the "X" buttons at top right of both the Help About dialog and the main Window seem to work fine. It looks as if oWnd:End() and oDlg:End() don't work properly or at least as I expected and how they do under FiveWin. Any solutions? Or have I done something wrong? or misunderstanding something? Here is my code: //PatMatch.prg #include "FiveLinux.ch" // #include "objects.ch" #define idProgName "File Match Software" #define idVersion "0.1.1" #define idCopName "Finalysis Pty. ltd." #define idCopDate "2007" #define idBldDate "25 July 2007" STATIC oWnd FUNCTION Main() // oChecker := CHECKER():Create() DEFINE WINDOW oWnd TITLE "File Match Software - (c) Finalysis 2007" ; MENU BldInMenu() ACTIVATE WINDOW oWnd MAXIMIZED RETURN FUNCTION BldInMenu() LOCAL lomMenu MENU lomMenu MENUITEM "&File" MENU // MENUITEM "&Match" ACTION oChecker:ShowProDlg() MENUITEM "&Exit" ACTION Exit() ENDMENU MENUITEM "&Help" MENU MENUITEM "&About" ACTION VerInfo() ENDMENU ENDMENU RETURN lomMenu FUNCTION VerInfo() LOCAL lodAbout DEFINE DIALOG lodAbout TITLE "About Patient Match Software" @ 2, 2 SAY ( idProgName + " - Version: " + idVersion ) OF lodAbout @ 4, 2 SAY ( "Build Date: " + idBldDate ) OF lodAbout @ 6, 2 SAY ( "(c) " + idCopName + " " + idCopDate ) OF lodAbout @ 8, 2 BUTTON "OK" ACTION ( lodAbout&#058;End() ) ; OF lodAbout ACTIVATE DIALOG lodAbout CENTERED RETURN Function Exit() CLS QUIT RETURN
oWnd:End() oDlg:End()
Doug, We email you new libraries with some changes and also a modified version of your PRG. With these new files is working fine
oWnd:Line(...)
Hello Antonio, Is :Line supported by PPC? oWnd:Line(...) Thanks in advance Otto
oWnd:Line(...)
Otto, It is not included yet, but you can easily add it from FWH Class TWindow
oWnd:Line(...)
Hello Antonio, Only as a reminder. Thanks in advance Otto
oWnd:SaveToJPG() instead of oWnd:SaveToBmp()
Hi Antonio,Can we have a oWndH:SaveToJPG() that does the same as oWnd:SaveToBmp() but saves the screen in JPG format. I know we can save the BMP file from oWnd:SaveToBmp() and than read and save as JPG, but that takes to long. I'd rather would like to have oWnd:SaveToJPG save'ed it directly to JPG.Patrick
oWnd:SaveToJPG() instead of oWnd:SaveToBmp()
Patrick,Maybe we could use "Shell.Explorer" for it. Going to do some tests.It may sounds crazy but the IE is able to manage all images formats <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
oWnd:Say() ->Transparent on Gradientfil?
Dear All, I need to use oWnd:Say() on Gradientfil() area and need to Transparnet Backgroup. How can I do it? Regards, Dutch
oWnd:Say() ->Transparent on Gradientfil?
Hello Dutch, [img:14uoguvl]http&#58;//www&#46;pflegeplus&#46;com/pictures/transtext5&#46;jpg[/img:14uoguvl] [img:14uoguvl]http&#58;//www&#46;pflegeplus&#46;com/pictures/transtext6&#46;jpg[/img:14uoguvl] [code=fw:14uoguvl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br />...<br />@  <span style="color: #000000;">50</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">TITLE</span> oTitle <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">of</span> oWnd TRANSPARENT NOBORDER<br />@  <span style="color: #000000;">10</span>,  <span style="color: #000000;">20</span>  TITLETEXT <span style="color: #0000ff;">OF</span> oTitle <span style="color: #0000ff;">TEXT</span> <span style="color: #ff0000;">"TEXT-TEST"</span>  <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">128</span>   <br /><br /><span style="color: #B900B9;">// @ &nbsp;50, 100 TITLE oTitle SIZE 200, 100 of oWnd TRANSPARENT </span><br /><span style="color: #B900B9;">// @ &nbsp;25, &nbsp;35 &nbsp;TITLETEXT OF oTitle TEXT "TEXT-TEST" &nbsp;FONT oFont COLOR 128 &nbsp; </span><br /><span style="color: #B900B9;">// @ &nbsp;50, &nbsp;35 &nbsp;TITLETEXT OF oTitle TEXT "MORE TEXT" &nbsp;FONT oFont COLOR 0</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> W_GRAD<span style="color: #000000;">&#40;</span> oWnd, hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// --------- GRADIENT  --------------------------------------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> W_GRAD<span style="color: #000000;">&#40;</span> oWnd, hDC <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> aGrad := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> W_MOVE, W_COLOR1, W_COLOR2 <span style="color: #000000;">&#125;</span>, ;<br />                          <span style="color: #000000;">&#123;</span> W_MOVE, W_COLOR2, W_COLOR1 <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>         <br /><br />GradientFill<span style="color: #000000;">&#40;</span> hDC,  <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oWnd:<span style="color: #000000;">nHeight</span>, oWnd:<span style="color: #000000;">nWidth</span>, aGrad, .T. <span style="color: #000000;">&#41;</span>    <span style="color: #B900B9;">// Gradient Top / Bottom, .F. = Left / Right</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:14uoguvl] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
oWnd:SetMenu
Antonio, ¿Como puedo 'quitar' el menú de una window? Dicho de otra manera, si establezco un menú con: oWnd:SetMenu( oMenu ) No puedo quitarlo con: oWnd:SetMenu( NIL ) ¿Como podría hacerlo? Saludos y gracias, José Luis Capel
oWnd:Wsayrect()
This method from TWindow should also accept font, color, etc.! (as in Wsay!)
oWnd:Wsayrect()
Antonio, i have send to you a new version from WsayRect() for the next build!
oWnd:bKeyDown
I would like to find out if the control key is press. I tried like that but it doesn't work: Thanks in advance, Otto oWnd:bLClicked := { |y,x,flags | test() } func test if oWnd:bKeyDown() = VK_CONTROL else endif
oWnd:bKeyDown
I find a solution with: if GetKeyState( VK_CONTROL ) else endif
oWnd:bKeydown does not trigger when DEL key pressed
I want to have a save button activate when changes are made to fields on window. The line below works for most keys, but the Delete and Back keys are ignored. ::oWnd:bKeyDown = { | nKey | if( ! self:lSave .and. (( nKey > 31 .and. nKey < 223) .or. nKey = VK_BACK .or. nKey = VK_DELETE), self:togglesave(), ) } Is there another (easier) way to detirmine if control changes?
oWnd:bKeydown does not trigger when DEL key pressed
Try assigning oGet:bChange codeblock. EMG
oWnd:bKeydown does not trigger when DEL key pressed
I was hoping that I did not need to do that on every get, but if I must I must.
oWnd:bKeydown does not trigger when DEL key pressed
Then try assigning oGet:bLostFocus codeblock. EMG
oWnd:bKeydown does not trigger when DEL key pressed
I'm sorry, but that seems like a similar issue. Every get will need to be touched with some routing to check for changes.
oWnd:bKeydown does not trigger when DEL key pressed
In both cases you can do something similar to this: [code:29n1ni4h]FOR i = 1 TO LEN&#40; oDlg&#58;aControls &#41; IF oDlg&#58;aControls&#91; i &#93;&#58;ClassName&#40;&#41; = "TGET" oDlg&#58;aControls&#91; i &#93;&#58;bLostFocus = &#46;&#46;&#46; ENDIF NEXT[/code:29n1ni4h] EMG
oWnd:bKeydown does not trigger when DEL key pressed
Gale, If you are using TDatabase (or TData) there is a method Modified() that checks the buffer data (in aBuffer) against the data on the disk to see if there have been any changes. If you are not using TDatabase, then you can store a copy of all the data in the dialog in an array before the edit, then check it against the array after. This, of course, requires more hand coding which may not be feasible if you have a lot of controls and/or a lot of dialogs. This is one very good reason (of many) to be using database objects. James
oWnd:bKeydown does not trigger when DEL key pressed
using bChange does not work either. When backspace or delete key pressed the bChange is not getting fired. Here is routine I use FOR nCounter := 1 TO LEN( oDlg:aControls ) IF oDlg:aControls[ nCounter ]:ClassName() = "TGET" .or. oDlg:aControls[ nCounter ]:ClassName() = "TCHECKBOX" if oDlg:aControls[ nCounter ]:bChange == nil // tracelog( oDlg:aControls[ nCounter ]:ClassName() ) oDlg:aControls[ nCounter ]:bChange = { || ::togglesaveon() } endif ENDIF NEXT I verified with tracelog that proper controls were getting bChange assigned.
oWnd:bKeydown does not trigger when DEL key pressed
James, I am trying to add a save button that shows when a change is made. I use tdatabase but that only works when you check it. If you change a get then tab to next get there is no visable indication data has changed. I was just wanting a button that would activate showing the user that changes have been made and a save is necessary.
oWnd:bKeydown does not trigger when DEL key pressed
Gale, I just had an idea how you can test for changes without much code even if you are not using TDatabase. At the start of the dialog using the ON INIT clause call something like this: [code:35v3mfa0] &#46;&#46;&#46;on init originalData&#40; oDlg &#41; function originalData&#40; oDlg &#41; local i&#58;=0, aBuffer&#58;=&#123;&#125; for i = 1 to len&#40; oDlg&#58;aControls &#41; aadd&#40; aBuffer, oDlg&#58;aControls&#91;i&#93; &#41; next return aBuffer[/code:35v3mfa0] Then at the end, use something similar to check for changes. James
oWnd:bKeydown does not trigger when DEL key pressed
Sorry, I forgot to add my folders on a for next loop FOR nCounter := 1 TO LEN( oFld:aDialogs[ 1 ]:aControls ) IF oFld:aDialogs[ 1 ]:aControls[ nCounter ]:ClassName() = "TGET" .or. oFld:aDialogs[ 1 ]:aControls[ nCounter ]:ClassName() = "TCHECKBOX" if oFld:aDialogs[ 1 ]:aControls[ nCounter ]:bChange == nil tracelog( oFld:aDialogs[ 1 ]:aControls[ nCounter ]:ClassName() ) oFld:aDialogs[ 1 ]:aControls[ nCounter ]:bChange = { || ::togglesaveon() } endif ENDIF NEXT It is working generally. I may have to change it to your suggestion using bLostFocus and adding a check for oDbf:modified(). Sometimes the backspace or delete keys trigger bChange even though nothing is changed.
oWnd:bKeydown does not trigger when DEL key pressed
Gale, Apparently you posted your last message while I was writing my previous reply. You can just check the oDBF:modified() method in the valid clause of each control. ...VALID if( oDBF:modified(), oSave:enable(),) James
oWnd:line/oWnd:bLClicked
Are these functions ready? Regards Otto oWnd:line() ACTIVATE WINDOW ON PAINT ON PAGERIGHT ON PAGELEFT ON RIGHT ON LEFT ON UP ON DOWN ON PAGEUP ON PAGEDOWN oWnd:brClicked oWnd:bLClicked oWnd:bLButtonUp oWnd:bMMoved
oWnd:line/oWnd:bLClicked
Otto, You can easily check them for yourself reviewing source\classes\window.prg and include\fwce.ch (search for ACTIVATE WINDOW). Thanks
oWnd:line/oWnd:bLClicked
METHOD Line does not seem to be there. Can we take the code form FWH? Regards Otto
oWnd:line/oWnd:bLClicked
Otto, With some of them, yes, you can take them from FWH, but with others you will find unresolved externals from Windows Mobile.
oWnd:line/oWnd:bLClicked
Hello Antonio, if I change some lines in window.prg how to compile and link? Thanks in advance Otto
oWnd:line/oWnd:bLClicked
The easiest way is to compile it as it were a PRG of your application. EMG
oWnd:line/oWnd:bLClicked
Hello Enrico, could you post an example of buildce.bat which include also windows.prg. Thanks in advance Otto
oWnd:line/oWnd:bLClicked
I don't have one at hand but basically you have to add [code:2ahaze1x]%hdir%\bin\harbour window&#46;prg /n /i&#46;&#46;\include;%hdir%\include /p %2 %3 > clip&#46;log[/code:2ahaze1x] and modify [code:2ahaze1x]%vcdir%\bin\clarm -TP -W3 -c /DARM /DUNICODE /I%hdir%\include /I&#46;&#46;\include %1&#46;c window&#46;c[/code:2ahaze1x] or something very similar. EMG
oWnd:oClient := oPanel
Hello, is it possible to have oWnd:oClient := oPanel in combination with oPanel:nTop := 20 Thank you in advance Otto
oWnd:oClient := oPanel
I not understood can make a test sample ?
oWnd:oClient := oPanel
Hello Silvio, In the meantime I found a solution. But there is another problem. It seems we can't make resizeable windows without a border. Thank you and best regards Otto oWnd:bPainted = { || oPanel:nTop := 30 } [img:osv2ybei]https&#58;//mybergland&#46;com/fwforum/resize5&#46;jpg[/img:osv2ybei]
oWnd:oClient := oPanel
Otto, [quote:2ikcs7id]But there is another problem. It seems we can't make resizeable windows without a border.[/quote:2ikcs7id] it is possible <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=37133&p=221895#p221895">viewtopic.php?f=3&t=37133&p=221895#p221895</a><!-- l --> regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
oWnd:oClient := oPanel
Hallo Uwe, danke. Das funkioniert leider nicht. Das Fenster ist rahmenlos aber die Größe kann nicht verändert werden. Liebe Grüße Otto
oWnd:oClient := oPanel
[quote="Otto":3s7afbgj]Hello Silvio, In the meantime I found a solution. But there is another problem. It seems we can't make resizeable windows without a border. Thank you and best regards Otto oWnd:bPainted = { || oPanel:nTop := 30 } [img:3s7afbgj]https&#58;//mybergland&#46;com/fwforum/resize5&#46;jpg[/img:3s7afbgj][/quote:3s7afbgj] Now I understand sorry What you use to make the window ..window or dialog ? I thinkyou must use a dialog command with RESIZABLE then you can make a bresized codeblock where you can set the panel ( are you using tpanelscroll ?) I made a type of that you want make ( only I insert two xbrowse) but the system is the same [img:3s7afbgj]https&#58;//i&#46;postimg&#46;cc/28wnFGkV/tariife1&#46;jpg[/img:3s7afbgj] I used DEFINE DIALOG oDlgTariffe SIZE 880,600 ; PIXEL TRUEPIXEL RESIZABLE FONT oFont oDlgTariffe:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570 oDlgTariffe:bResized := <|| local oRect := oDlgTariffe:GetCliRect() local x:= oBrw1:nBottom oBtnCheck:nLeft := oRect:nRight - 395 oBtnCheck:nTop := oRect:nBottom - 50 oBtnPrint:nLeft := oRect:nRight - 220 oBtnPrint:nTop := oRect:nBottom - 50 oBtnClose:nLeft := oRect:nRight - 120 oBtnClose:nTop := oRect:nBottom - 50 RETURN nil > ACTIVATE DIALOG oDlgTariffe CENTERED you can on oDlgTariffe:bResized insert the refresh of Panel you wish
oWnd:oClient := oPanel
Hello Silvio, I tried your code but with your code the DIALOG has a frame. If I add WS_POPUP style I have no Frame but can't resize the DIALOG. DEFINE DIALOG oDlg SIZE 880,600 ; PIXEL TRUEPIXEL RESIZABLE //FONT oFont // STYLE WS_POPUP Best regards Otto
oWnd:oClient := oPanel
wich is FRAME ?
oWnd:oClient := oPanel
Hello Silvio, regards Otto [code=fw:1brx24hu]<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;">static</span> oDlg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">880</span>,<span style="color: #000000;">600</span> ;<br /><span style="color: #0000ff;">PIXEL</span> TRUEPIXEL RESIZABLE <span style="color: #B900B9;">//FONT oFont</span><br /><br /><br /><span style="color: #B900B9;">// STYLE &nbsp;WS_POPUP</span><br /><br /><br /><span style="color: #B900B9;">/*<br />oDlg:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570<br /><br />oDlg:bResized := <||<br />local oRect := oDlg:GetCliRect()<br />local x:= oBrw1:nBottom<br /><br />oBtnCheck:nLeft := oRect:nRight - 395<br />oBtnCheck:nTop := oRect:nBottom - 50<br /><br />oBtnPrint:nLeft := oRect:nRight - 220<br />oBtnPrint:nTop := oRect:nBottom - 50<br /><br />oBtnClose:nLeft := oRect:nRight - 120<br />oBtnClose:nTop := oRect:nBottom - 50<br />RETURN nil<br />><br /><br />*/</span><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:1brx24hu] [img:1brx24hu]https&#58;//mybergland&#46;com/fwforum/dlg&#46;png[/img:1brx24hu]