topic
stringlengths
1
63
text
stringlengths
1
577k
Add Color to a Group Frame
Antonio I agree .. you should be able to change the color .. Try my sample code and see if you get the same result .. with and without the XpManifest. Thanks Rick Lipkin
Add Color to a Group Frame
Rick, You may try to use a bitmap instead of a group We can't change the painting on some standard controls when used with themes
Add Color to a Group Frame
Antonio [quote:3w49zw3k] You may try to use a bitmap instead of a group [/quote:3w49zw3k] Interesting Thought .. could I use a Pen (perhaps ) to outline a Box ? ( a bit awkward ) Rick Lipkin
Add Color to a Group Frame
Rick, Yes, the control TBitmap is a FWH own class so we have full control on it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Add Color to a Group Frame
Or TPanel too...
Add Color to a Group Frame
Hi Antonio, I need help with sth i don't know what to do. I've been trying to do the group coloring using TPanel, and i thought i got it, but there is a big problem <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> : cannot use the mouse over the area covered by the TPanel Here is my code: [code=fw:dbz81qh9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #00C800;">Local</span> nMargen:= <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>ScreenWidth<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-1280</span><span style="color: #000000;">&#41;</span>/<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />   cLogin    := Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />   cPassword := Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">STYLE</span> nOr<span style="color: #000000;">&#40;</span> WS_BORDER, WS_POPUP <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">SIZE</span> ScreenWidth<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,ScreenHeight<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-200</span> <span style="color: #0000ff;">COLOR</span> GRIS, 0xffffff<br /><br />       @ <span style="color: #000000;">41</span>, nMargen   <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Aplicacion"</span> <span style="color: #B900B9;">/* SIZE 100, 40 */</span>  <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontB <span style="color: #0000ff;">COLOR</span> CLR_GREEN<br />       oSay:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span> oFontB <span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #B900B9;">/* This is what's been replaced<br />       @ 60, nMargen GROUP  ;<br />              TO 215, nMargen + 200  ;<br />              OF oDlg  ;<br />             PIXEL TRANSPARENT ;<br />             COLOR CLR_GREEN<br />       */</span><br />       oPanel:= TPanel<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;">60</span>, nMargen, <span style="color: #000000;">215</span>, nMargen + <span style="color: #000000;">200</span>, oDlg <span style="color: #000000;">&#41;</span><br />       oPanel:<span style="color: #000000;">bPainted</span>:= <span style="color: #000000;">&#123;</span>|hDC, cPS| ;<br />            RoundBox<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oPanel:<span style="color: #000000;">nWidth</span><span style="color: #000000;">-1</span>, oPanel:<span style="color: #000000;">nHeight</span><span style="color: #000000;">-1</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">8</span>, 0xaaaaaa, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> ;<br />            <span style="color: #000000;">&#125;</span><br /><br />      @ <span style="color: #000000;">80</span>, nMargen + <span style="color: #000000;">40</span>  <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Introduzca Usuario y Contraseña"</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span><br /><br />      @ <span style="color: #000000;">105</span>, nMargen + <span style="color: #000000;">40</span>  <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Usuario"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">45</span>, <span style="color: #000000;">10</span>   <span style="color: #0000ff;">PIXEL</span><br /><br />      @ <span style="color: #000000;">117</span>, nMargen + <span style="color: #000000;">40</span>  <span style="color: #0000ff;">GET</span> cLogin    <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">14</span> ;<br />                    <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'Hola'</span> <span style="color: #000000;">&#41;</span> ;<br />                    BITMAP <span style="color: #ff0000;">"USER_16"</span><br /><br />      @ <span style="color: #000000;">135</span>, nMargen + <span style="color: #000000;">40</span>  <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Password:"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">45</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span><br /><br />      @ <span style="color: #000000;">147</span>, nMargen + <span style="color: #000000;">40</span>  <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">var</span> cPassword   <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">14</span> PASSWORD <span style="color: #0000ff;">UPDATE</span> ;<br />                    <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'Hola'</span> <span style="color: #000000;">&#41;</span> ;<br />                    BITMAP <span style="color: #ff0000;">"KEY_16"</span><br /><br />      @ <span style="color: #000000;">175</span>, nMargen + <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span>  oBtnEntrar  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Acceder"</span> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">/*When lok*/</span> <span style="color: #0000ff;">update</span>    <span style="color: #0000ff;">LEFT</span>   <span style="color: #000000;">2007</span>      <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"cog"</span><br /><br />      @ <span style="color: #000000;">175</span>, nMargen + <span style="color: #000000;">120</span> <span style="color: #0000ff;">BTNBMP</span>  oBtnSalir <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Salir"</span>  <span style="color: #0000ff;">action</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>    <span style="color: #0000ff;">LEFT</span>   <span style="color: #000000;">2007</span>         <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"cubes"</span><br /><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> </div>[/code:dbz81qh9] The dialog is shown and everything looks fine, but it's impossible to click on any control. Also tried to put the TPanel after all controls, but in that case controls are hidden after the TPanel. I'm sure it's a little thing, but i'm not able to get it. May be I have to try with another control? TIA
Add Color to a Group Frame
Carlos has intentado poner en los controles [code=fw:1fzx7wnp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />               ... <span style="color: #0000ff;">OF</span> oPanel<br /> </div>[/code:1fzx7wnp] No se si es lo que necesitas ------------------------------------------- EDITADO ---------------------------- Mira en el foro de español
Add Color to a Group Frame
Hi Cristobal, was one of my first attempts, but things like refresh() aren't resent to panel's children. Had to do it manually, it's not the idea. And won't work with resources also. Thanks anyway, let me know if you have another idea, they are always welcome. [OT] Moved to Loeches now, but still working at Atisa, in P.I. Las Monjas, don't forget that beer we owe ourselves <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->
Add Color to a Group Frame
[quote="Carlos Mora":6zb6ingr]Hi Cristobal, was one of my first attempts, but things like refresh() aren't resent to panel's children. Had to do it manually, it's not the idea. And won't work with resources also. Thanks anyway, let me know if you have another idea, they are always welcome. [OT] Moved to Loeches now, but still working at Atisa, in P.I. Las Monjas, don't forget that beer we owe ourselves <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->[/quote:6zb6ingr] Carlos, mi nivel de ingles no es muy alto Contestame en el foro de español Yo he usado bastante los TPanel sin ningun problema pero no he usado recursos Carlos, my English is not very high Contestame Spanish forum I've used quite the TPanel without any problem but I have not used resources
Add Color to a Group Frame
[code=fw:o1t1x7vy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oFont, oBold, aVar<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp;AFill<span style="color: #000000;">&#40;</span> aVar, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">60</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span> BOLD<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>,<span style="color: #000000;">250</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;@ &nbsp;<span style="color: #000000;">70</span>,<span style="color: #000000;">50</span> <span style="color: #0000ff;">GET</span> aVar<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br />&nbsp; &nbsp;@ <span style="color: #000000;">100</span>,<span style="color: #000000;">50</span> <span style="color: #0000ff;">GET</span> aVar<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">bPainted</span> := < |hDC|<br />&nbsp; &nbsp; &nbsp; RoundBox<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">20</span>,<span style="color: #000000;">40</span>,<span style="color: #000000;">300</span>,<span style="color: #000000;">150</span>,<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span>,CLR_HRED, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">SayText</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Group Title"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">150</span> <span style="color: #000000;">&#125;</span>, <span style="color: #00C800;">nil</span>, oBold, <span style="color: #000000;">&#123;</span> CLR_GREEN, oDlg:<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont, oBold<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:o1t1x7vy] [url=https&#58;//imageshack&#46;com/i/p9cZzNAJj:o1t1x7vy][img:o1t1x7vy]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/909/cZzNAJ&#46;jpg[/img:o1t1x7vy][/url:o1t1x7vy]
Add Color to a Group Frame
Thanks Nages!
Add Programs to Startup in Windows 8
[url:3oxyqh0h]http&#58;//www&#46;tomshardware&#46;co&#46;uk/faq/id-2080296/add-programs-startup-windows&#46;html[/url:3oxyqh0h] [quote:3oxyqh0h]press Windows + R keys simultaneously to initialize the Run command box. Once the Run command box is opened, type %AppData% in the available field and hit Enter. On the opened Roaming window, go to the Microsoft > Windows > Start Menu > Programs > Startup folder. Once you are inside the Startup folder, paste the shortcut that you copied by right-clicking anywhere and selecting the Paste option from the context menu [/quote:3oxyqh0h]
Add Xbrowse Column at runtime
Can I insert a column on a X pos at runtime and make calc math for it ? sample I wish insert a checkbox column after X columns and if the user click on if must calc an math operation refresh another column for a sample look this picture [img:f70k1ltk]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2014/11/order&#46;jpg[/img:f70k1ltk] I wish insert a column at the red arrow amd calc the percentual 20% on the column "Importo"
Add Xbrowse Column at runtime
Maybe you could just create the column at the start but specify a width of zero, then change the width at runtime.
Add Xbrowse Column at runtime
No, I think ( and I found it on this forum) I can make a function type Function Addcolumn() ADD TO oBrw AT 8 DATA oBrw:Rit HEADER "SlNo" oBrw:Rit:setcheck() return nil where Rit ia a field .... but it not run here!!!
Add Xbrowse Column at runtime
ADD TO oBrw AT 8 DATA oBrw:Rit HEADER "SlNo" oBrw:Rit:setcheck() There are two problems. Rit is not data of oBrw, and fields don't have methods, so you can't do oBrw:Rit:setcheck(). There is a setCheck() method of oBrw but it has to do with bitmaps. METHOD SetCheck( aBmps, uEdit, aPrompts ) CLASS TXBrowse Maybe you should review the original posting showing the code you posted. Did you try my previous suggestion?
Add Xbrowse Column at runtime
James the setcheck is not important !! I Know there are two bmps. If you see testxbrowse sample there is a field maried oCol := oBrw:oCol( "Married" ) oCol:SetCheck( { "GREEN", "RED" }, {|o, v| (DBRLOCK(), _FIELD->Married := v, DBUNLOCK() ) } ) oCol:bStrData := { || If( _FIELD->Married, "Yes", "No" ) } oCol:nDataStrAlign := AL_RIGHT Rit is a field of the same archive of xbrowse on init there is not the column and the final user can insert it on runtime because for one document it is not important while for other it is need (order,invoice,quote...) and if the user check this colums the procedure must calc an specific oeration on Total od Import of invoice
Add Xbrowse Column at runtime
ADD TO oBrw AT 8 ............ is the right way. But I am not sure what you want to display in the inserted column and what other column you want to change and refresh. If you just want to display 20% of the value in Importo column, you can do this ADD TO oBrw AT 8 DATA (oBrw:Importo:Value * 0.20) TITLE "New" PICTURE "9999.99" If you want some other display and some other action, we can incorporate the same
Add Xbrowse Column at runtime
Mr Nages, I try to explain you I wish only insert a column with checkbox.... from user the user can insert this column check but at init when I create the xbrowse it must no showed then.. on my Function of Totals I musst be able to Know if that record at that column is check . If it check I must calc the new import ( sample nImporto+20%) I made @x,y button ...action Ins_Ritenuta(oBrw) Function Ins_Ritenuta(oBrw) WITH OBJECT oBrw:InsCol( 8 ) :bEditValue := { || AScan( oBrw:aSelected, oBrw:BookMark ) > 0 } :SetCheck() :nHeadBmpNo := { || If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) } :cHeader := "Rit." END oBrw:bLClicked := { |r,c,f,oBrw| If( oBrw:MouseColPos( c ) == 8 , ; If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ; AAdd( oBrw:aSelected, oBrw:BookMark ), ; ADel( oBrw:aSelected, f, .t. ) ), nil ), ; oBrw:RefreshCurrent() } oBrw:refresh() return nil but it make errors I tried also with WITH OBJECT oBrw:InsCol( 8 ) :lHide := lRitenuta :bEditValue := { || AScan( oBrw:aSelected, oBrw:BookMark ) > 0 } :SetCheck() :nHeadBmpNo := { || If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) } :cHeader := "Rit." END at the init lRitenuta is false the the use can press a button and change lritenuta @x,y button ACTION ( lRitenuta:=IF(lRitenuta,.f.,.t.), oBrw:refresh() ) the browse is not refreshed
Add Xbrowse Column at runtime
ok now i resolved it now run ok First.... [img:2ddyb92f]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2014/11/rit1&#46;jpg[/img:2ddyb92f] [b:2ddyb92f]then press the button[/b:2ddyb92f] [img:2ddyb92f]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2014/11/rit2&#46;jpg[/img:2ddyb92f] @ x,y Xbrowse.... WITH OBJECT oBrw WITH OBJECT oBrw:InsCol( 8 ) :lHide := !lRitenuta :bEditValue := { || AScan( oBrw:aSelected, oBrw:BookMark ) > 0 } :SetCheck() :nHeadBmpNo := { || If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) } :cHeader := "Rit." END :lFastEdit = .T. :nStretchCol := STRETCHCOL_WIDEST :lHscroll:=.F. :lVscroll:=.T. :lRecordSelector := .F. :nRowDividerStyle := LINESTYLE_LIGHTGRAY :nColDividerStyle := LINESTYLE_LIGHTGRAY :bLClicked := { |r,c,f,oBrw| If( oBrw:MouseColPos( c ) == 8 , ; If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ; AAdd( oBrw:aSelected, oBrw:BookMark ), ; ADel( oBrw:aSelected, f, .t. ) ), nil ), ; oBrw:RefreshCurrent() } END @10,10 button .... action lRitenuta:=IF(lRitenuta,.f.,.t.),; oBrw:aCols[8]:lHide:=!lRitenuta, oBrw:refresh() the problem : [b:2ddyb92f]I not see the last header of Importo [/b:2ddyb92f] and I wish if it possble check all when the user set the lritenuta
Add a Checkbox() column
Hi, There is xBrowse(). At some point I need to add a Checkbox() column to it. However, it does not work. Tell me what I'm wrong about ? [code=fw:120z92x0]<div class="fw" id="{CB}" style="font-family: monospace;">oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrBtn</span>:=&<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'{||{'</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>CLR_BLACK<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">','</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>CLR_WHITE<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">'}}'</span><span style="color: #000000;">&#41;</span><br />&nbsp;oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>:=<span style="color: #ff0000;">""</span><br />&nbsp;oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span>, .T.<span style="color: #000000;">&#41;</span><br />&nbsp;oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span>:=<span style="color: #000000;">20</span></div>[/code:120z92x0]
Add a Checkbox() column
<!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=36197">viewtopic.php?f=3&t=36197</a><!-- l --> <!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=36959">viewtopic.php?f=3&t=36959</a><!-- l -->
Add a Checkbox() column
I was asking about adding a checkbox column to a working browser, not about creating a browser with such a column
Add a Checkbox() column
First you need to add a column with all logical values. Then Set oCol:SetCheck(,.T. )
Add a Checkbox() column
Instead of setcheck(, .T.), I used the icons and everything worked fine [code=fw:31g6rvp3]<div class="fw" id="{CB}" style="font-family: monospace;">  oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lBmpTransparent</span>:= .T.<br />        oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"p_chk1"</span>, <span style="color: #ff0000;">"p_chk2"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />        oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bBmpData</span>:=<span style="color: #000000;">&#123;</span>||iif<span style="color: #000000;">&#40;</span>oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />        oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span>:=<span style="color: #00C800;">NIL</span><br />        oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bLDClickData</span>:=<span style="color: #000000;">&#123;</span>||oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:=! oDlg:<span style="color: #000000;">oClient</span>:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span></div>[/code:31g6rvp3]
Add a Checkbox() column
5 lines of the code above can be reduced to a single line [code=fw:a84twrk7]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"p_chk1"</span>, <span style="color: #ff0000;">"p_chk2"</span> <span style="color: #000000;">&#125;</span>, .T. <span style="color: #000000;">&#41;</span></div>[/code:a84twrk7]
Add a Checkbox() column
Thank you, Rao! Very elegant.
Add a Checkbox() column
I have a xbrowse of a dbf table, this is a table created specifically to make selections. In the last column I want to show a logical field that permit to select some of the record that I see in ths xbrowse for instance this is the penultimane columnt is define in this way oCol = oBrw:AddCol() oCol:bStrData = { || TRANSFORM( field->imp_eff, "@ZE 999,999,999.99" ) } oCol:cHeader = "TOTALE CLIENTE" oCol:nEditType = EDIT_NONE oCol:nWidth = 100 oCol:nDataStrAlign := AL_RIGHT How can I add another column that read / edit the value of field->seleziona Logical type? I want to see the classic two bitmap CHECKON and CHECKOFF many thanks
Add a Checkbox() column
[code=fw:in3oly6b]<div class="fw" id="{CB}" style="font-family: monospace;">WITH OBJECT oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">&#123;</span> |x| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> x == <span style="color: #00C800;">nil</span>, <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->SELEZIONA, <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->SELEZIONA := x <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, .t. <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// uses default bitmaps</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// OR to use your own bitmaps</span><br />&nbsp; &nbsp;:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <bmpOn>, <bmpOff> <span style="color: #000000;">&#125;</span>, .t. <span style="color: #000000;">&#41;</span><br />END<br />&nbsp;</div>[/code:in3oly6b] <bmpOn>, <bmpOff> can be names of any bmp or any image files or resource names.
Add a Method on specific class
IT is possible to Add a Method on specific class from a prg ? With OVERRIDE COMMAND I can change a method
Add a Method on specific class
Silvio, This is also possible in Harbour: #include "hbclass.ch" #include "c:\harbour\contrib\xhb\xhbcls.ch" EXTEND CLASS ClassName WITH DATA DataName and EXTEND CLASS ClassName WITH MESSAGE MessageName( param, ... ) It does not follow OOP rules but it works also <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Add a Method on specific class
Create a new class, inherit from the one you wish to add to, and add your methods. Example: tData inherits from tDatabase and both adds, and overrides, some methods from the primary class. I have created classes that inherit from tData but add specific methods. For example, I can create an Inventory class that inherits from tData, and is used to call the inventory database. I can then add methods which enhance that class. James Bott has two white papers on the subject that are referenced in this forum many times.
Add a button search in Xbrowse cell in edit mode
Hi to all. Is there the possibility to add a button or a bitmap to Xbrowse cell when I'm in edit mode ? I want to add this button for some cells, for looking into a table and returning back a value inside the get. Thanks a lot.
Add a button search in Xbrowse cell in edit mode
oCol:nEditType := EDIT_BUTTON oCol:bEditBlock := { || <button action> }
Add a button search in Xbrowse cell in edit mode
Works perfectly. Is it possible to add a bitmap to that little button ? Thanks a lot.
Add a button search in Xbrowse cell in edit mode
Here's what I did, [code=fw:25e8chyv]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">addResource</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"BitmapInResourceName"</span> <span style="color: #000000;">&#41;</span><br />oCol:<span style="color: #000000;">nBtnBmp</span> := <span style="color: #000000;">1</span>         <br /> </div>[/code:25e8chyv]
Add a extra option to the method ToCSV
METHOD ToCSV( cFile, aCols, lHeaders, cTrue, cFalse ) CLASS TXBrowse I looked into the code of Xbrowse to find out how ToCsv is working. I see that the delimeter is hard code as a comma ( , ) I need i to be ( ; ) Is it a idea to add this option into Xbrowse source ? (extra : cDelimiter) Or is there a other way ? I prefer NOT to change source of FWH in order to keep the updates. I do have read that it is possible to subclass from a source of FWH. Just out of interest how this could work for my learning curve, maybe someone can use this code from source (Xbrowse) and make this work I just named it MY_ToCSV (reference that it is My version) Then I can change the "," into ";" without Mr. Rao to change the sources of FWH [code=fw:hbb129tr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> MY_ToCSV<span style="color: #000000;">&#40;</span> cFile, aCols, lHeaders, cTrue, cFalse <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br />   <span style="color: #00C800;">local</span> cCsv    := <span style="color: #ff0000;">""</span><br />   <span style="color: #00C800;">local</span> n, cLine, uVal, c, uBm, hFile<br />   <span style="color: #00C800;">local</span> oExcel, oBook<br /><br />   <span style="color: #00C800;">if</span> aCols == <span style="color: #00C800;">nil</span><br />      aCols  := ::<span style="color: #000000;">GetVisibleCols</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      AEval<span style="color: #000000;">&#40;</span> aCols, <span style="color: #000000;">&#123;</span> |o,i| aCols<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> := ::<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">DEFAULT</span> lHeaders := .t., cTrue := cXlTrue, cFalse := cXlFalse<br /><br />   <span style="color: #00C800;">if</span> lHeaders<br />      <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> n > <span style="color: #000000;">1</span><br />            cCsv  += <span style="color: #ff0000;">","</span><br />         <span style="color: #00C800;">endif</span><br />         cCsv  += <span style="color: #ff0000;">'"'</span> + StrTran<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>, CRLF, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'"'</span><br />      <span style="color: #00C800;">next</span><br />   <span style="color: #00C800;">endif</span><br /><br />   uBm      := ::<span style="color: #000000;">BookMark</span><br />   Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bGoTop</span> <span style="color: #000000;">&#41;</span><br /><br />   REPEAT<br />      cLine    := <span style="color: #ff0000;">""</span><br /><br />      <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br /><br />         c     := <span style="color: #ff0000;">""</span><br /><br />         uVal  := aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><br />         c := FW_ValToCSV<span style="color: #000000;">&#40;</span> uVal, cTrue, cFalse <span style="color: #000000;">&#41;</span><br /><br />         <span style="color: #00C800;">if</span> n > <span style="color: #000000;">1</span><br />            cLine    += <span style="color: #ff0000;">","</span><br />         <span style="color: #00C800;">endif</span><br />         cLine    += c<br /><br />      <span style="color: #00C800;">next</span><br /><br />      <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cCsv <span style="color: #000000;">&#41;</span><br />         cCsv += CRLF<br />      <span style="color: #00C800;">endif</span><br /><br />      cCsv    += cLine<br /><br />   UNTIL Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bSkip</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />   ::<span style="color: #000000;">BookMark</span>  := uBm<br /><br />   <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br />      cFile    := TrueName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> hFile := fCreate<span style="color: #000000;">&#40;</span> cFile, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />         fWrite<span style="color: #000000;">&#40;</span> hFile, cCsv <span style="color: #000000;">&#41;</span><br />         fClose<span style="color: #000000;">&#40;</span> hFile <span style="color: #000000;">&#41;</span><br />         cCsv  := <span style="color: #00C800;">nil</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> IfNil<span style="color: #000000;">&#40;</span> cFile, cCsv <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:hbb129tr]
Add a extra option to the method ToCSV
We will provide a new parameter for the delimiter in our next versions. We will also publish a patch for you here. You can use derived classes of xbrowse very easily. You can use the derived class for the entire application or different derived classes for different browses. Please see samples xbrchild.prg, xbrcalen.prg and xbrstgrd.prg in the samples folder.
Add a extra option to the method ToCSV
Implemented in FWH2009 [code=fw:3bfuy4qn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> ToCSV<span style="color: #000000;">&#40;</span> cFile, aCols, lHeaders, cTrue, cFalse, cDelim <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cCsv &nbsp; &nbsp;:= <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, cLine, uVal, c, uBm, hFile<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oExcel, oBook<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> aCols == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; aCols &nbsp;:= ::<span style="color: #000000;">GetVisibleCols</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; AEval<span style="color: #000000;">&#40;</span> aCols, <span style="color: #000000;">&#123;</span> |o,i| aCols<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> := ::<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lHeaders := .t., cTrue := cXlTrue, cFalse := cXlFalse, cDelim := <span style="color: #ff0000;">","</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lHeaders<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> n > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cCsv &nbsp;+= cDelim<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cCsv &nbsp;+= <span style="color: #ff0000;">'"'</span> + StrTran<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>, CRLF, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'"'</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;uBm &nbsp; &nbsp; &nbsp;:= ::<span style="color: #000000;">BookMark</span><br />&nbsp; &nbsp;Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bGoTop</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;REPEAT<br />&nbsp; &nbsp; &nbsp; cLine &nbsp; &nbsp;:= <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c &nbsp; &nbsp; := <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;uVal &nbsp;:= aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c := FW_ValToCSV<span style="color: #000000;">&#40;</span> uVal, cTrue, cFalse <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> n > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cLine &nbsp; &nbsp;+= cDelim<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cLine &nbsp; &nbsp;+= c<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cCsv <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cCsv += CRLF<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; cCsv &nbsp; &nbsp;+= cLine<br /><br />&nbsp; &nbsp;UNTIL Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bSkip</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp;::<span style="color: #000000;">BookMark</span> &nbsp;:= uBm<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cFile &nbsp; &nbsp;:= TrueName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> hFile := fCreate<span style="color: #000000;">&#40;</span> cFile, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fWrite<span style="color: #000000;">&#40;</span> hFile, cCsv <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fClose<span style="color: #000000;">&#40;</span> hFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cCsv &nbsp;:= <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> IfNil<span style="color: #000000;">&#40;</span> cFile, cCsv <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3bfuy4qn]
Add a extra option to the method ToCSV
Thank you !! I wait till the release
Add a extra option to the method ToCSV
Till then, you can confidently modify your xbrowse.prg like this and keep using it.
Add a extra option to the method ToCSV
[quote="nageswaragunupudi":9l50o3oe]Till then, you can confidently modify your xbrowse.prg like this and keep using it.[/quote:9l50o3oe] I've never done that I have to link en recompile source I believe ?
Add a extra option to the method ToCSV
Marc, You are never too old to learn something new. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> You can link in a copy of xbrowse to your program and make the changes as Mr. Rao said. The generosity of our masters to share the knowledge and the source code is the real freedom Fivewin gives us. Thank you Mr. Rao. Best regards, Otto
Add a extra option to the method ToCSV
[quote="Otto":3n50bhfl]Marc, You are never too old to learn something new. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> You can link in a copy of xbrowse to your program and make the changes as Mr. Rao said. [/quote:3n50bhfl] Out of curiosity : My files : Build.bat [code=fw:3n50bhfl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ECHO <span style="color: #0000ff;">ON</span><br /><span style="color: #00C800;">IF</span> <span style="color: #ff0000;">"%1"</span>==<span style="color: #ff0000;">"O"</span> DEL OBJ/Q<br /><span style="color: #00C800;">IF</span> <span style="color: #ff0000;">"%1"</span>==<span style="color: #ff0000;">"o"</span> DEL OBJ/Q<br />DEL OBJ/Q<br /><br /><span style="color: #ff0000;">"C:<span style="color: #000000;">\B</span>orland<span style="color: #000000;">\B</span>CC7<span style="color: #000000;">\B</span>in<span style="color: #000000;">\b</span>rc32.exe"</span> -r TEST.RC<br /><span style="color: #ff0000;">"C:<span style="color: #000000;">\B</span>orland<span style="color: #000000;">\B</span>CC7<span style="color: #000000;">\B</span>in<span style="color: #000000;">\m</span>ake.exe"</span> -f TEST.MAK<br /><br />echo ERRORLEVEL<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO COMPILEERRORS<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">0</span> goto DONE<br /><span style="color: #00C800;">pause</span><br />GOTO EXIT<br /><br />:<span style="color: #000000;">COMPILEERRORS</span><br /><span style="color: #00C800;">pause</span><br />GOTO EXIT<br /><br />:<span style="color: #000000;">DONE</span><br />test.exe<br /><br />:<span style="color: #000000;">EXIT</span><br /> </div>[/code:3n50bhfl] test.mak [code=fw:3n50bhfl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#Borland make sample, <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> FiveTech Software <span style="color: #000000;">2005</span><span style="color: #000000;">-2009</span><br /><br />HBDIR=c:\harbour<br />BCDIR=c:\borland\bcc7<br />FWDIR=c:\fwharb<br /><br />#change these paths as needed<br />.path.OBJ = .\obj<br />.path.PRG = .\<br />.path.ch  = $<span style="color: #000000;">&#40;</span>FWDIR<span style="color: #000000;">&#41;</span>\include;$<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\include<br />.path.C   = .\<br />.path.RC  = .\<br /><br />#important: <span style="color: #000000;">Use</span> Uppercase <span style="color: #00C800;">for</span> filenames extensions, in the <span style="color: #00C800;">next</span> two rules!<br /><br />PRG =      \<br />TEST1.PRG  <br /><br />C =        \<br />TEST1.C    <br /><br />OBJ = $<span style="color: #000000;">&#40;</span>PRGS:.PRG=.\OBJ<span style="color: #000000;">&#41;</span><br />OBJS = $<span style="color: #000000;">&#40;</span>OBJ:.\=.\obj\<span style="color: #000000;">&#41;</span><br /><br />PROJECT    : <span style="color: #000000;">TEST</span>.EXE<br /><br />#RES-file wordt door COMPRES.BAT aangemaakt<br />#TEST.EXE  : $<span style="color: #000000;">&#40;</span>PRG:.PRG=.OBJ<span style="color: #000000;">&#41;</span> $<span style="color: #000000;">&#40;</span>C:.C=.OBJ<span style="color: #000000;">&#41;</span> TEST.RES<br />TEST.EXE  : $<span style="color: #000000;">&#40;</span>PRG:.PRG=.OBJ<span style="color: #000000;">&#41;</span> $<span style="color: #000000;">&#40;</span>C:.C=.OBJ<span style="color: #000000;">&#41;</span><br />   echo off<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\c0w32.obj + > b32.bc<br />#  echo $<span style="color: #000000;">&#40;</span>OBJS<span style="color: #000000;">&#41;</span>, + >> b32.bc<br />   echo OBJ\TEST1.OBJ, + >> b32.bc<br /><br />   echo TEST.EXE, + >> b32.bc<br />   echo TEST.MAP, + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>FWDIR<span style="color: #000000;">&#41;</span>\lib\FiveH.lib $<span style="color: #000000;">&#40;</span>FWDIR<span style="color: #000000;">&#41;</span>\lib\FiveHC.lib $<span style="color: #000000;">&#40;</span>FWDIR<span style="color: #000000;">&#41;</span>\lib\libmysql.lib $<span style="color: #000000;">&#40;</span>FWDIR<span style="color: #000000;">&#41;</span>\lib\BARLIB32.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbrtl.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbvm.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\gtgui.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hblang.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbmacro.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbrdd.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\rddntx.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\rddcdx.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\rddfpt.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbsix.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbdebug.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbcommon.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbpp.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbwin.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbcpage.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbct.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\png.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbcplr.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\xhb.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbtip.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbzlib.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbmzip.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbziparc.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\minizip.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\hbpcre.lib + >> b32.bc<br /><br />   rem Uncomment these two lines <span style="color: #0000ff;">to</span> use Advantage RDD<br />   rem echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\rddads.lib + >> b32.bc<br />   rem echo $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\lib\Ace32.lib + >> b32.bc<br /><br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\cw32.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\uuid.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\import32.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\ws2_32.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\wininet.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\psdk\odbc32.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\psdk\nddeapi.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\psdk\iphlpapi.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\psdk\msimg32.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\psdk\rasapi32.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\psdk\gdiplus.lib + >> b32.bc<br />   echo $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\lib\psdk\shell32.lib, >> b32.bc<br /><br />   <span style="color: #00C800;">IF</span> EXIST TEST.RES echo TEST.RES >> b32.bc<br />   $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\bin\ilink32 -Gn -aa -Tpe -s @b32.bc<br /><br />.PRG.OBJ:<br />  $<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\bin\harbour $< /N /W0 /V /Oobj\ /I$<span style="color: #000000;">&#40;</span>FWDIR<span style="color: #000000;">&#41;</span>\include;$<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\include<br />  $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\bin\bcc32 -c -tWM -I$<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\include -oobj\$& obj\$&.c<br /><br />.C.OBJ:<br />  echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp<br />  echo -I$<span style="color: #000000;">&#40;</span>HBDIR<span style="color: #000000;">&#41;</span>\include;$<span style="color: #000000;">&#40;</span>FWDIR<span style="color: #000000;">&#41;</span>\include >> tmp<br />  $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\bin\bcc32 -oobj\$& @tmp $&.c<br />  del tmp<br /><br />#RES-file wordt door COMPRES.BAT aangemaakt<br />#TEST.RES : ..\RES\TEST.RC<br />#  $<span style="color: #000000;">&#40;</span>BCDIR<span style="color: #000000;">&#41;</span>\bin\brc32.exe -r ..\RES\TEST.RC<br /><br /> </div>[/code:3n50bhfl] So, 1. I can take the xbrowse.prg file from source dir, change the code from mr. Rao and save this into the DIR of the application i'm working on. 2. I add in the files above (the prg = and the C = section) below test1.prg the xbrowse.prg, so the 2 prg files are linked and that's it ? No rebuilding of lib files needed ? it can't be that easy <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: -->
Add a extra option to the method ToCSV
Marc, yes. That is what I do. I am sure Mr. Rao will explain it here for us. Best regards, Otto
Add a extra option to the method ToCSV
[quote="Marc Venken":2umtxiw8]Thank you !! I wait till the release[/quote:2umtxiw8] Revised version of FWH2008 is released. You will find this change also in this version. Please download.
Add a extra option to the method ToCSV
Great !!! Thanks
Add a function afther the errors has occured (SOLVED)
Can I executed a function ather the program has created the error.log with the standard errsysw.prg ? I would like to keep always the standard programs from FWH in every new build, but like now, it would become handy if I have the possibility to save the error in a online oRs: database. (before or afther the log is created) I have different soccer trainers that uses a member program online. So if a error occures, they must be online, and the error could be written to a online database. On the other hand, if I must use the original errsysw.prg, then where to I best put my extra errorhandling function? function MyExtraError() // open database and fill with needed data // proceed with error handling from FWH standard return NIL
Add a function afther the errors has occured (SOLVED)
FWH provides the following functions for user customization. 1. SetErrorPath( cErrorLogPath ) --> cOldPath 2. SetErrorFileName( cErrorLogFileName ) --> cOldName 3. SetPostErrorAction( bAction ) --> bOldAction bAction is evaluated with cErrFileName (with path) and oError as parameters This codeblock is executed after the ErrorDialog is closed. In this PostErrorAction codeblock you can do anything you want, but make sure you do not create any more runtime errors. Please read \fwh\source\function\errsysw.prg for better clarity.
Add a function afther the errors has occured (SOLVED)
Afther some search... I put this in the MAIN program SetPostErrorAction( { |cErrorLogFileName, oError| MyErrorAction( cErrorLogFileName, oError ) } ) and the function : [code=fw:184qj8f5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> MyErrorAction<span style="color: #000000;">&#40;</span> cErrorLogFileName, oError <span style="color: #000000;">&#41;</span><br /> <br />    cErrText := memoread<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"error.log"</span> <span style="color: #000000;">&#41;</span><br />    oCn:<span style="color: #000000;">Insert</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"errors"</span>, <span style="color: #ff0000;">"datum,uur,user,error,errorlog"</span>, <span style="color: #000000;">&#123;</span> date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, setup_naam, oError:<span style="color: #000000;">dEscription</span>,cErrText <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Foutmelding is opgenomen"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:184qj8f5] Thanks.
Add a function afther the errors has occured (SOLVED)
From FWH17.08, it is possible to replace default error dialog with your own dialog without modifying errsysw.prg [code=fw:3qa5dquy]<div class="fw" id="{CB}" style="font-family: monospace;"><br />SetErrorDialog<span style="color: #000000;">&#40;</span> bOwnDialg <span style="color: #000000;">&#41;</span> --> bPrevious<br />&nbsp;</div>[/code:3qa5dquy] FWH instead of displaying the default error dialog will Eval( bOwnDlg, oError, aStack, cErrLogText, cErrLogFile )
Add a line on report from xbrowse (NO HTML)
in a Report type printout created with the Treport class and printed from an Xbrowse table I have this problem: [img:232oit4o]https&#58;//i&#46;postimg&#46;cc/mkzH5Xk4/hh&#46;jpg[/img:232oit4o] After the text [b:232oit4o]"Provincia:AG" [/b:232oit4o]there is a list of cities I would like to add a white line after the text[b:232oit4o] "Provincia:AG" [/b:232oit4o] I create the prints using xbrowse's method Report() [code=fw:232oit4o]<div class="fw" id="{CB}" style="font-family: monospace;">  oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> cTitle, , , ;<br />         <span style="color: #000000;">&#123;</span> |oRep, oBrw| MySetUp<span style="color: #000000;">&#40;</span> oRep, oBrw, oDbf,aGroup,nGroup,lEject,aCampi <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:232oit4o] on MySetup function I insert the Group sintax [code=fw:232oit4o]<div class="fw" id="{CB}" style="font-family: monospace;">AAdd<span style="color: #000000;">&#40;</span>oRep:<span style="color: #000000;">aGroups</span>,trGroup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> bCampo2<span style="color: #000000;">&#40;</span> afields, nGroup,oDbf <span style="color: #000000;">&#41;</span>,;    <span style="color: #B900B9;">//campo</span><br />           <span style="color: #000000;">&#123;</span>|| aGroup<span style="color: #000000;">&#91;</span>nGroup<span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">" :"</span>+oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cValue</span><span style="color: #000000;">&#125;</span>,;                       <span style="color: #B900B9;">//header</span><br />           <span style="color: #000000;">&#123;</span>|| <span style="color: #ff0000;">"Totale "</span>+aGroup<span style="color: #000000;">&#91;</span>nGroup<span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">": "</span>+oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cValue</span>+<span style="color: #ff0000;">" ("</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCounter</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")"</span><span style="color: #000000;">&#125;</span>,; <span style="color: #B900B9;">//footer</span><br />           <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span>,;   <span style="color: #B900B9;">// Font</span><br />           .f.,oRep<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>     <span style="color: #B900B9;">//leject</span><br />           oRep:<span style="color: #000000;">bPostGroup</span> :=  <span style="color: #000000;">&#123;</span> || oRep:<span style="color: #000000;">Newline</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></div>[/code:232oit4o] I wish the Line after the header [b:232oit4o] {|| aGroup[nGroup]+" :"+oRep:aGroups[1]:cValue},; [/b:232oit4o] How I can resolve ? I allready try with [b:232oit4o]oRep:bStartGroup := { || oRep:Newline() }[/b:232oit4o] NOT RUN OK If I insert [b:232oit4o]oRep:bStartLine := { || oRep:Newline() }[/b:232oit4o] then inser newline after the header but insert lines also another part ( each line od records) as you can see here [img:232oit4o]https&#58;//i&#46;postimg&#46;cc/kGw7W8Wb/kkkkk&#46;png[/img:232oit4o]
Add a line on report from xbrowse (NO HTML)
Using the default behavior of :Report( nil, .t., .t., nil, { 1 } ) The group headers are in bold and adequate to distinguish from the body. [url=https&#58;//imageshack&#46;com/i/pnlmSCwVp:ggg5sbsq][img:ggg5sbsq]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq70/923/lmSCwV&#46;png[/img:ggg5sbsq][/url:ggg5sbsq] [code=fw:ggg5sbsq]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; USE CUSTOMER <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp;SET ORDER <span style="color: #0000ff;">TO</span> TAG STATE<br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;XBROWSER <span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> COLUMNS <span style="color: #ff0000;">"State"</span>,<span style="color: #ff0000;">"FIRST"</span>,<span style="color: #ff0000;">"CITY"</span>,<span style="color: #ff0000;">"SALARY"</span> SETUP <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Salary</span>:<span style="color: #000000;">nFooterType</span> := &nbsp;AGGR_SUM, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">&#123;</span> |r,c,f,o| o:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, .t., .t., <span style="color: #00C800;">nil</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:ggg5sbsq]
Add a line on report from xbrowse (NO HTML)
Nages, I need to have a function for setup to insert many vars on your image I need to insert a line whereis the red arrow [img:2jq31f2m]https&#58;//i&#46;postimg&#46;cc/KjZ5vS8r/lmSCwV&#46;jpg[/img:2jq31f2m]
Add a taskpanel on line
How can I insert a taskpanel into Texplorerbar online, i.e. controlled by the end user? I did this test but it doesn't work because the oExbar doesn't refresh at init the taskpanel n. 2 is not showed [b:10qu110m]explbar.prg modified[/b:10qu110m] [code=fw:10qu110m]<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: #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: #00C800;">local</span> oWnd, oExBar, oPanel1, oPanel2, oPanel3, oPanel4<br /><br />   <span style="color: #00C800;">local</span> aSections :=  <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>eople.bmp"</span>,.t. <span style="color: #000000;">&#125;</span>,;<br />                        <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Two"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\c</span>ase.bmp"</span>,.f. <span style="color: #000000;">&#125;</span>,;<br />                        <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Three"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\g</span>raphics.bmp"</span>,.t. <span style="color: #000000;">&#125;</span>,;<br />                        <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Four"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>eople.bmp"</span>,.t. <span style="color: #000000;">&#125;</span>     <span style="color: #000000;">&#125;</span><br /><br />    <span style="color: #00C800;">local</span> bClick := <span style="color: #000000;">&#123;</span> | o | change_array<span style="color: #000000;">&#40;</span>@aSections,oExBar<span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#125;</span><br /><br /><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;">"FWH Class TExplorerBar"</span><br /><br />   oWnd:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">350</span>, <span style="color: #000000;">600</span> <span style="color: #000000;">&#41;</span><br /><br />   oExBar = TExplorerBar<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 />   oPanel1 = oExBar:<span style="color: #000000;">AddPanel</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>eople.bmp"</span> <span style="color: #000000;">&#41;</span><br />   oPanel1:<span style="color: #000000;">AddLink</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Add Panel 2"</span>, bClick, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\a</span>dditem.bmp"</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">If</span> aSections<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />        oPanel2 = oExBar:<span style="color: #000000;">AddPanel</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Two"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\c</span>ase.bmp"</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">Endif</span><br /><br />   oPanel3 = oExBar:<span style="color: #000000;">AddPanel</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Three"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\g</span>raphics.bmp"</span> <span style="color: #000000;">&#41;</span><br /><br />   oPanel4 = oExBar:<span style="color: #000000;">AddPanel</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Four"</span> <span style="color: #000000;">&#41;</span><br /><br />   oWnd:<span style="color: #000000;">oClient</span> = oExBar<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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> change_array<span style="color: #000000;">&#40;</span>aSections,oExBar<span style="color: #000000;">&#41;</span><br />   aSections<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:= .t.<br />   oExBar:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /> </div>[/code:10qu110m]
Add bitmap to taskbar
I would like to show wi-fi signal status icon on the taskbar rather than within the app window is it possible ? TIA Peter p.s. running WM6.1
Add bitmap to taskbar
Peter, Could you please post some screenshots to better understand what you mean ? thanks
Add bitmap to taskbar
[img:3ki44ds3]https&#58;//bitbucket&#46;org/fivetech/screenshots/downloads/wifi_windows_mobile&#46;jpg[/img:3ki44ds3] Antonio I would like to place the 5 bar icon currently at at top right of the screen onto the taskbar next to the title, in this example WiFi Status Thanks Peter p.s. preview of message not showing photo but it is at <!-- m --><a class="postlink" href="https://imgur.com/a/Ssb1E">https://imgur.com/a/Ssb1E</a><!-- m -->
Add bitmap to taskbar
Peter, Are you creating that Wifi status window using FWPPC ? If so, could you please post the code here ? I guess that if we use the WM_NCPAINT message then you may be able to paint anything you need on the caption bar
Add bitmap to taskbar
Antonio Code was found here or another forum, I can't remember now <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: --> Regards Peter [code=fw:2k6jaiy2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><br />    #ifdef UNICODE<br />       <span style="color: #00D7D7;">#define</span> UNDER_CE<br />    #endif<br /><br />    <span style="color: #00D7D7;">#include</span> <hbapi.h><br />    <span style="color: #00D7D7;">#include</span> <windows.h><br />    <span style="color: #00D7D7;">#include</span> <aygshell.h><br />    <span style="color: #00D7D7;">#include</span> <ntddndis.h><br />    <span style="color: #00D7D7;">#include</span> <nuiouser.h><br />    <span style="color: #00D7D7;">#include</span> <winioctl.h><br />    <span style="color: #00D7D7;">#include</span> <iphlpapi.h><br /><br />    BOOL GetFirstRFEthernetSignalStrength<span style="color: #000000;">&#40;</span> int*, int* <span style="color: #000000;">&#41;</span>; <br /><br />    <span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SIGNAL  <span style="color: #000000;">&#41;</span><br />    <span style="color: #000000;">&#123;</span><br />    int nStrength = <span style="color: #000000;">0</span>;<br />    int nQuality = <span style="color: #000000;">0</span>;<br />    GetFirstRFEthernetSignalStrength<span style="color: #000000;">&#40;</span>&nStrength, &nQuality<span style="color: #000000;">&#41;</span>;<br />    hb_retnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> long <span style="color: #000000;">&#41;</span> nQuality <span style="color: #000000;">&#41;</span>;<br />    <span style="color: #000000;">&#125;</span><br /><br />    HRESULT GetSignalStrength<span style="color: #000000;">&#40;</span><br />    TCHAR *ptcDeviceName,<br />    int* piSignalStrength,<br />    int* piSignalQuality<br />    <span style="color: #000000;">&#41;</span><br />    <span style="color: #000000;">&#123;</span> PNDISUIO_QUERY_OID queryOID;<br />       DWORD  dwBytesReturned = <span style="color: #000000;">0</span>;<br />       UCHAR  QueryBuffer<span style="color: #000000;">&#91;</span>sizeof<span style="color: #000000;">&#40;</span>NDISUIO_QUERY_OID<span style="color: #000000;">&#41;</span> +sizeof<span style="color: #000000;">&#40;</span>DWORD<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>;<br />       HANDLE  ndisAccess = INVALID_HANDLE_VALUE;<br />       BOOL  retval;<br />       HRESULT  hr; <span style="color: #B900B9;">// Attach to NDISUIO.</span><br />       ndisAccess = CreateFile<span style="color: #000000;">&#40;</span> NDISUIO_DEVICE_NAME,    <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #00C800;">NULL</span>, OPEN_EXISTING,  FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,    INVALID_HANDLE_VALUE <span style="color: #000000;">&#41;</span>;<br />       <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ndisAccess == INVALID_HANDLE_VALUE <span style="color: #000000;">&#41;</span> <br />       <span style="color: #00C800;">return</span> E_FAIL; <span style="color: #B900B9;">// ????</span><br />       <span style="color: #B900B9;">// Get Signal strength</span><br />       queryOID = <span style="color: #000000;">&#40;</span>PNDISUIO_QUERY_OID<span style="color: #000000;">&#41;</span>&QueryBuffer<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span>;<br />       queryOID->ptcDeviceName = ptcDeviceName;<br />       queryOID->Oid = OID_802_11_RSSI;<br />       retval = DeviceIoControl<span style="color: #000000;">&#40;</span> ndisAccess,  IOCTL_NDISUIO_QUERY_OID_VALUE,  <span style="color: #000000;">&#40;</span>LPVOID<span style="color: #000000;">&#41;</span> queryOID,  sizeof<span style="color: #000000;">&#40;</span>NDISUIO_QUERY_OID<span style="color: #000000;">&#41;</span> + sizeof<span style="color: #000000;">&#40;</span>DWORD<span style="color: #000000;">&#41;</span>,  <span style="color: #000000;">&#40;</span>LPVOID<span style="color: #000000;">&#41;</span> queryOID,  sizeof<span style="color: #000000;">&#40;</span>NDISUIO_QUERY_OID<span style="color: #000000;">&#41;</span> + sizeof<span style="color: #000000;">&#40;</span>DWORD<span style="color: #000000;">&#41;</span>,  &dwBytesReturned,  <span style="color: #00C800;">NULL</span><span style="color: #000000;">&#41;</span>;<br />       <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> retval && piSignalStrength && piSignalQuality <span style="color: #000000;">&#41;</span><br />          <span style="color: #000000;">&#123;</span> <br />          hr = S_OK; <br />          *piSignalStrength = *<span style="color: #000000;">&#40;</span>DWORD *<span style="color: #000000;">&#41;</span>&queryOID->Data; <br />          <span style="color: #B900B9;">//Here's Microsoft's interpretation </span><br />          <span style="color: #B900B9;">//of the return value </span><br />          <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>*piSignalStrength < <span style="color: #000000;">-90</span><span style="color: #000000;">&#41;</span>               <br />             *piSignalQuality =  <span style="color: #000000;">0</span>; <span style="color: #B900B9;">// No signal </span><br />          <span style="color: #00C800;">else</span> <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>*piSignalStrength < <span style="color: #000000;">-81</span><span style="color: #000000;">&#41;</span>   <br />             *piSignalQuality  = <span style="color: #000000;">1</span>; <span style="color: #B900B9;">// Very low </span><br />          <span style="color: #00C800;">else</span> <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>*piSignalStrength < <span style="color: #000000;">-71</span><span style="color: #000000;">&#41;</span>   <br />             *piSignalQuality  = <span style="color: #000000;">2</span>; <span style="color: #B900B9;">// Low </span><br />          <span style="color: #00C800;">else</span> <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>*piSignalStrength < <span style="color: #000000;">-67</span><span style="color: #000000;">&#41;</span>   <br />             *piSignalQuality  = <span style="color: #000000;">3</span>; <span style="color: #B900B9;">// Good </span><br />          <span style="color: #00C800;">else</span> <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>*piSignalStrength < <span style="color: #000000;">-57</span><span style="color: #000000;">&#41;</span>   <br />              *piSignalQuality  = <span style="color: #000000;">4</span>; <span style="color: #B900B9;">// Very good </span><br />          <span style="color: #00C800;">else</span> *piSignalQuality  = <span style="color: #000000;">5</span>; <span style="color: #B900B9;">// Excellent</span><br />          <span style="color: #000000;">&#125;</span><br />          <span style="color: #00C800;">else</span><br />          <span style="color: #000000;">&#123;</span> <br />             hr = E_FAIL;<br />          <span style="color: #000000;">&#125;</span><br />          CloseHandle<span style="color: #000000;">&#40;</span> ndisAccess <span style="color: #000000;">&#41;</span>;<br />          <span style="color: #00C800;">return</span> hr;<br />       <span style="color: #000000;">&#125;</span><br />       BOOL GetFirstRFEthernetSignalStrength<span style="color: #000000;">&#40;</span><br />          int* pSignalStrength,<br />          int* pSignalQuality<br />          <span style="color: #000000;">&#41;</span><br />          <span style="color: #000000;">&#123;</span> BOOL retval = <span style="color: #00C800;">FALSE</span>;<br />          <span style="color: #B900B9;">// Get the size of the adapters list.</span><br />          DWORD <span style="color: #0000ff;">size</span> = <span style="color: #000000;">0</span>;<br />          GetAdaptersInfo<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NULL</span>, &size <span style="color: #000000;">&#41;</span>;<br />          <span style="color: #B900B9;">// Allocate space for the list.</span><br />          IP_ADAPTER_INFO *info =   <br />            <span style="color: #000000;">&#40;</span>IP_ADAPTER_INFO*<span style="color: #000000;">&#41;</span><span style="color: #00C800;">new</span> char<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">&#93;</span>;<br />            DWORD err;<br />            <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>err = GetAdaptersInfo<span style="color: #000000;">&#40;</span>info, &size <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>   <br />             == NO_ERROR <span style="color: #000000;">&#41;</span><br />             <span style="color: #000000;">&#123;</span><br />             IP_ADAPTER_INFO *cinfo = info; <br />             <span style="color: #00C800;">while</span> <span style="color: #000000;">&#40;</span> cinfo <span style="color: #000000;">&#41;</span> <br />                <span style="color: #000000;">&#123;</span>   <br />                 <span style="color: #B900B9;">// Check the interface media type for   </span><br />                 <span style="color: #B900B9;">// Ethernet, which both   </span><br />                 <span style="color: #B900B9;">// standard Ethernet and RF Ethernet will return.   </span><br />                 <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cinfo->Type == MIB_IF_TYPE_ETHERNET <span style="color: #000000;">&#41;</span>   <br />                   <span style="color: #000000;">&#123;</span>   <br />                   TCHAR wName<span style="color: #000000;">&#91;</span> MAX_ADAPTER_NAME_LENGTH + <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>;   <br />                   MultiByteToWideChar<span style="color: #000000;">&#40;</span> CP_ACP, <span style="color: #000000;">0</span>,    cinfo->AdapterName, <span style="color: #000000;">-1</span>,     wName,     sizeof<span style="color: #000000;">&#40;</span> wName <span style="color: #000000;">&#41;</span> / sizeof<span style="color: #000000;">&#40;</span> wName<span style="color: #000000;">&#91;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />                   <span style="color: #B900B9;">// Try to get the signal strength.   </span><br />                   <span style="color: #B900B9;">// If it works, we   </span><br />                   <span style="color: #B900B9;">// return the information.   </span><br />                   <span style="color: #B900B9;">// If not, we move on.   </span><br />                   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> GetSignalStrength<span style="color: #000000;">&#40;</span> wName,     <br />                       pSignalStrength, pSignalQuality <span style="color: #000000;">&#41;</span> == S_OK <span style="color: #000000;">&#41;</span>   <br />                       <span style="color: #000000;">&#123;</span>   <br />                        retval = <span style="color: #00C800;">TRUE</span>;     <br />                        <span style="color: #00C800;">break</span>;   <br />                        <span style="color: #000000;">&#125;</span>   <br />                    <span style="color: #000000;">&#125;</span>   <br />                    <span style="color: #B900B9;">// Go to the next adapter in the list.   </span><br />                    cinfo = cinfo->Next;<br />                    <span style="color: #000000;">&#125;</span><br />                   <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// Don't forget to delete the allocation.</span><br />                   delete <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> info;<br />                   <span style="color: #00C800;">return</span> retval;<br />    <span style="color: #000000;">&#125;</span><br />    <span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:2k6jaiy2]
Add bitmap to taskbar
Peter, ok, thanks So in your PRG you call Signal() and then paint the wifi icon, right ? Please post here the PRG code used to paint the wifi icon too so we can modify it to be painted in the caption area, thanks
Add bitmap to taskbar
Antonio Here it is Regards Peter [code=fw:fx9pbboe]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FWCE.ch"</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> oWnd,oBMP<br /><span style="color: #00C800;">statiC</span> cDir <br /><br /><br /> <span style="color: #00D7D7;">#define</span> INTERVAL_SECONDS  <span style="color: #000000;">5</span><br /><br /> <br /> <span style="color: #00C800;">static</span> aWifi := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"wifi-0.bmp"</span>,<span style="color: #ff0000;">"wifi-1.bmp"</span>,<span style="color: #ff0000;">"wifi-2.bmp"</span>,<span style="color: #ff0000;">"wifi-3.bmp"</span>,<span style="color: #ff0000;">"wifi-4.bmp"</span>,<span style="color: #ff0000;">"wifi-5.bmp"</span><span style="color: #000000;">&#125;</span><br /><br />***********************<br />Procedure Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <br />  <span style="color: #00C800;">LOCAl</span> oBtn<br />      <br />  cDir :=  CurDir<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"WiFi Status"</span> <br /><br />    @ <span style="color: #000000;">0</span>, <span style="color: #000000;">26</span> BITMAP oBmp FILENAME cDir +<span style="color: #ff0000;">"<span style="color: #000000;">\"</span>+aWiFi[ SIGNAL() +1 ] NOBORDER <br /><br />    @ 260, 15   BTNBMP  oBtn    SIZE 25, 25 FILE cDir + "</span>\EXIT.bmp<span style="color: #ff0000;">" ACTION FINISH() <br /><br />  ACTIVATE WINDOW oWnd ON INIT BuildTimer()<br /> <br />*********************<br />FUNCTION BuildTimer()<br /><br />   LOCAL oTmr <br />   <br /><br />   DEFINE TIMER oTmr INTERVAL INTERVAL_SECONDS * 1000  ACTION TimerCalls( )<br />  <br /> ACTIVATE TIMER oTmr<br /><br />return nil<br />*********************<br />Function TimerCalls()<br /><br />    oBmp:LoadBMP(     cDir +"</span>\<span style="color: #ff0000;">"+  aWifi[ SIGNAL() + 1 ] )<br /><br /> <br /><br />****************<br />FUNCTION FINISH()<br /><br /> IF ! MSGNOYES("</span>Exit<span style="color: #ff0000;">")<br />    RETURN .f.<br /> ENDIF<br /> <br /> oWnd:END() </span></div>[/code:fx9pbboe]
Add bitmap to taskbar
Peter, Please try your example with these changes and let me know if you get a beep, thanks replace this line: DEFINE WINDOW oWnd TITLE "WiFi Status" with: oWnd = TMyWindow():New( "WiFi Status" ) and add this code to your prg: [code=fw:1nks9i7x]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> WM_NCPAINT           <span style="color: #000000;">133</span>    <span style="color: #B900B9;">// 0x085</span><br /><br /><span style="color: #00C800;">CLASS</span> TMyWindow <span style="color: #0000ff;">FROM</span> TWindow<br /><br />   <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">&#40;</span> nMsg, nWParam, nLParam <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">&#40;</span> nMsg, nWParam, nLParam <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMyWindow<br /><br />   <span style="color: #00C800;">if</span> nMsg == WM_NCPAINT<br />      MsgBeep<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: #00C800;">Super</span>:<span style="color: #000000;">HandleEvent</span><span style="color: #000000;">&#40;</span> nMsg, nWParam, nLParam <span style="color: #000000;">&#41;</span></div>[/code:1nks9i7x]
Add bitmap to taskbar
Antonio MsgBeep() does not get called and then crashes with variable does not exist Super Regards Peter
Add bitmap to taskbar
Please use ::Super instead of Super
Add bitmap to taskbar
MsgBeep() still not called Regards
Add column in xBrowse
Hi, As I can add columns in one xbrowse already created ?
Add column in xBrowse
Yes. You can add, delete, insert and swap columns in xbrowse at any time after creation.
Add column in xBrowse
How ?
Add column in xBrowse
Just use the AddCol, DelCol, InsCol methods as usual and then call obrw:refresh( .t. )
Add decimals to an existing numeric field
Hello, I've a dbf with a numeric field without decimals. I would change the field adding 2 decimals, but I don't know. When I hace to change the structure of a DBF I create a nuew structure with dbcreate and then append the data from the old dbf. Doing this with character fields doesn't give an error, but if I do this with numeric field adding decimals it give me an error. I use EMAGdbu from Enrico and this program changes the size of the numeric fields without problems, but I don't know how to do this in my programs. Regards, José Luis
Add decimals to an existing numeric field
Hi, Please, have a took at Fivedbu sources, there is such routine.
Add decimals to an existing numeric field
Jose Luis: Perhaps the problem is the field's size, remember, you will need a field size + 3, for sample: If your field has a lenght 7 with no decimals (7,0), (1234567) when you add the decimals you need a field with leght 10 with 2 decimals, 1234567.89 Regards
Add decimals to an existing numeric field
I have downloaded the latest public fivedbu sources from code.google. The routine in fivedbu sources is the same I use, and gives the same error when you change a numerical field with 2 integer positions - numeric (2,0) - to another with 2 integer positions and 2 decimals - numeric (5,2) -. Any help, please ? Regards,
Add element near scrollbar
Hello, In my program would like to add a combo box near the scroll bar at bottom, in this way: [img:zvud0746]https&#58;//i&#46;imgur&#46;com/jGh6YYO&#46;png[/img:zvud0746] (I did it in GIMP) But I don't found a way to resize the built in scrollbar or reduce the window client area... Someone know how do that?
Add element near scrollbar
This is a possible solution although it is not the most correct. Put your combobox in column 0 of the msgbar, or define an item with the width you consider and insert your combobox in that item. The same can be done by inserting your scrollbar in a second item. Note that you probably have to program the behavior of the scrollbar control and resize this control [code=fw:3ug486l0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWindow <span style="color: #0000ff;">FROM</span> nRow, nCol <span style="color: #0000ff;">TO</span> nWAlto + nRow, nWAncho + nCol ; <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, Rgb<span style="color: #000000;">&#40;</span> <span style="color: #000000;">182</span>, <span style="color: #000000;">182</span>, <span style="color: #000000;">182</span> <span style="color: #000000;">&#41;</span> <br /><br />&nbsp; &nbsp; &nbsp; oMsg &nbsp;:= TMsgBar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oWindow, , .F., .F., .F., .F., oWindow:<span style="color: #000000;">nClrtext</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oWindow:<span style="color: #000000;">nClrPane</span>, , .F., .F., .F., .F., .T. <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//l2010, lBorder, l2015 )</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//METHOD New( nRow, nCol, nMin, nMax, nPgStep, lVertical, oWnd, nWidth, nHeight,;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp;bUpAct, bDownAct, bPgUp, bPgDown, bPos, lPixel, nClrText,;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp;nClrBack, cMsg, lUpdate, bWhen, bValid, lDesign ) CLASS TScrollBar</span><br />&nbsp; &nbsp; &nbsp; oHScroll := TScrollbar<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;">1</span>, <span style="color: #000000;">250</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">100</span>, , .F., oMsg, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oMsg:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">&#40;</span> <span style="color: #000000;">250</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> - oMsg:<span style="color: #000000;">nHeight</span> * <span style="color: #000000;">2</span> + <span style="color: #000000;">2</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oMsg:<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">2</span>, , , , , , .T. <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3ug486l0]
Add image to this forum
Dear All, How do we add/insert an image to this forum. Toyet
Add image to this forum
Toyet, Use <!-- w --><a class="postlink" href="http://www.imageshack.us">www.imageshack.us</a><!-- w --> and copy here the fourth provided URL once you upload an image
Add image to this forum
This is another good site (also free). <!-- m --><a class="postlink" href="http://www.freeimagehosting.net/">http://www.freeimagehosting.net/</a><!-- m --> James
Add images to oImageList
Hi, all ! There is a TTreeview object. It contains a set of files of different types. I need to add icons associated with the file type to ::oImageList. I do this: img=BmpFromIcon( EXTRACTASSICON (0, MyFile, @sol)) - handle bitmap TTreeview: oImageList:Add(img, NIL) But get the error: Class 'NUMERIC' has no exported method 'HBITMAP' What I am wrong ?
Add images to oImageList
Class TImageList Method Add() expects a Class TBitmap object and not a bitmap handle Try it this way: TTreeview: oImageList:Add( TBitmap():Define( ,, oWnd, img ), oWnd )
Add images to oImageList
Thank You, Antonio ! Work normally
Add new feature to menu class
To Antonio: Why not create this feature for menu class ? [img:2sbvpad2]http&#58;//img687&#46;imageshack&#46;us/img687/7831/immagineupq&#46;jpg[/img:2sbvpad2] then we can show only the option we want ( principal options) some option are visibles and some option can be showed from user
Add news resource ids to app ?
Hi, An app dialog linked with DLL ,could I add new resource ids at runtime ? for example: function main() define dialog odlg resource "odlg" redefine get cget1 id 101 of odlg redefine button id 102 of odlg activate dialog odlg on init (addnewids()) return function addnewids() redefine button id 103 of odlg // id 103 does not exists in resource odlg return Best regrad! Shuming Wang
Add news resource ids to app ?
Shuming, function addnewids() @ 2, 2 BUTTON "Another" of odlg return
Add news resource ids to app ?
Antonio, Thanks! Shuming Wang
Add news resource ids to app ?
Hi, Antonio , can objects from source be merged with objects from resources ? Maybe a better aproach is to first redefine all objects from the dll , but then hide what not is needed frank
Add news resource ids to app ?
Frank, > can objects from source be merged with objects from resources ? viceversa: objects from resources with objects from source code
Add on for EasyReport: Area designer
I started working on a very basic add on tool for ER. Best regards, Otto [img:donw1ori]http&#58;//www&#46;atzwanger-software&#46;com/fw/ERAreaDesigner&#46;jpg[/img:donw1ori]
Add on for EasyReport: Area designer
Area designer is an end user tool How does it work. AD reads from the original VRD file from the [Items] section. The window opens in the size of the area. After positioning the labels AD stores the changes back to the VRD file. Original VRD designer has no zoom. Therefore it is hard to position the labels. Best regards, Otto [img:3u6b0qyp]http&#58;//www&#46;atzwanger-software&#46;com/fw/ERAreaDesigner2&#46;jpg[/img:3u6b0qyp]
Add or remove startup apps in Windows 10
[url:1oga7883]http&#58;//winaero&#46;com/blog/how-to-add-or-remove-startup-apps-in-windows-10/[/url:1oga7883]
Add or remove startup apps in Windows 10
Antonio I have been using ( free ) Ccleaner from Piriform .. the new 5.11 version comes with the ability to remove many Windows apps as well .. [img:16gjh12e]http&#58;//i64&#46;tinypic&#46;com/10zpzz4&#46;jpg[/img:16gjh12e] As well as compete control of your machine startup.. [img:16gjh12e]http&#58;//i66&#46;tinypic&#46;com/fwqgxl&#46;jpg[/img:16gjh12e] Here is the link : <!-- m --><a class="postlink" href="https://www.piriform.com/ccleaner/download">https://www.piriform.com/ccleaner/download</a><!-- m --> Rick Lipkin
Add pauze function to Chronometer
Mr. Rao posted a chronometer on the forum : I'm not able to change the code so that when you hit START and then STOP, the program should continue with the value that is on the digit. Hitting CLEAR is correct : it goes to zero Hitting START also goes to zero and then start. This should go on ... [code=fw:3acvj2kl]<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 /><br />   <span style="color: #00C800;">local</span> nSecsLapsed<br /><br />   nSecsLapsed := ChronoMeter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   ? nSecsLapsed, SECTOTIME<span style="color: #000000;">&#40;</span> nSecsLapsed, .t. <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> ChronoMeter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oSay, oBtnStart, oBtnStop, oTimer, oFont, oBold<br />   <span style="color: #00C800;">local</span> nStartSec, nSecsLapsed := <span style="color: #000000;">0</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-16</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-32</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>,<span style="color: #000000;">120</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />   @ <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBtnStart <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"START"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br />      <span style="color: #0000ff;">WHEN</span> nStartSec == <span style="color: #00C800;">nil</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> nStartSec := SECONDS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBtnStop:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">40</span>,<span style="color: #000000;">170</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">&#123;</span> || SECTOTIME<span style="color: #000000;">&#40;</span> nSecsLapsed, .t. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">CENTER</span> VCENTER <span style="color: #0000ff;">UPDATE</span> ;<br />      <span style="color: #0000ff;">COLOR</span> CLR_HGREEN, CLR_BLACK<br /><br />   @ <span style="color: #000000;">40</span>,<span style="color: #000000;">360</span> <span style="color: #0000ff;">BTNBMP</span> oBtnStop <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nStartSec == <span style="color: #00C800;">nil</span> .and. nSecsLapsed > <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"CLEAR"</span>, <span style="color: #ff0000;">"STOP"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">UPDATE</span> ;<br />      <span style="color: #0000ff;">WHEN</span> nStartSec != <span style="color: #00C800;">nil</span> .or. nSecsLapsed > <span style="color: #000000;">0</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />      <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nStartSec == <span style="color: #00C800;">nil</span>, ;<br />      <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nSecsLapsed > <span style="color: #000000;">0</span>, nSecsLapsed := <span style="color: #000000;">0</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span>, ;<br />      <span style="color: #000000;">&#40;</span> nSecsLapsed := SecsLapsed<span style="color: #000000;">&#40;</span> nStartSec <span style="color: #000000;">&#41;</span>, nStartSec := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />      oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBtnStart:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   oDlg:<span style="color: #000000;">bInit</span> := <||<br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">100</span> ;<br />         <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nStartSec == <span style="color: #00C800;">nil</span>,,<span style="color: #000000;">&#40;</span> nSecsLapsed := SecsLapsed<span style="color: #000000;">&#40;</span> nStartSec <span style="color: #000000;">&#41;</span>,oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTimer<br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />      ><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont, oBold<br /><br /><span style="color: #00C800;">return</span> nSecsLapsed<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SecsLapsed<span style="color: #000000;">&#40;</span> nStart <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nLapsed := <span style="color: #000000;">0</span><br /><br />   <span style="color: #00C800;">if</span> nStart != <span style="color: #00C800;">nil</span><br />      nLapsed  := SECONDS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - nStart<br />      <span style="color: #00C800;">if</span> nLapsed < <span style="color: #000000;">0</span><br />         nLapsed   += <span style="color: #000000;">86400.0</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> nLapsed<br /> </div>[/code:3acvj2kl]
Add pauze function to Chronometer
Change this: [code=fw:2g7b50gq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> nStartSec := SECONDS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBtnStop:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:2g7b50gq] with this: [code=fw:2g7b50gq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> nStartSec := SECONDS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - nSecsLapsed, oBtnStop:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:2g7b50gq]
Add record count to xBrowse() function
To All It would be nice to add a record count to the xBrowse() function. So many times I use xBrowse() to debug a program and it would be nice to have that record count to verify a query or filter results. Many Thanks Rick Lipkin
Add record count to xBrowse() function
Please try USE CUSTOMER XBROWSER "CUSTOMER" SHOW SLNUM // OR SHOW RECID
Add second MsgBar in a window?
Hi, I use msgbar in my main program. Is it possible to add a second msgbar above the first msgbar? Thanks,
Add second MsgBar in a window?
Hakan, Are you using a MDI window or is it a non MDI one ?
Add second MsgBar in a window?
[quote="Antonio Linares":1bca17ew]Hakan, Are you using a MDI window or is it a non MDI one ?[/quote:1bca17ew] Hi Antonio, I use non MDI. Thanks,
Add some functions for Tensorflow
Hello. I adding some functions/method for Tensoflow for Fivewin like following.^^ METHOD GraphNextOperation( nPos ) DLL FUNCTION TF_GraphNextOperation( hGraph AS LONG, @nPos AS LONG ) AS LONG LIB hDLL DLL FUNCTION TF_OperationName( hOperation AS LONG ) AS LPSTR LIB hDLL DLL FUNCTION TF_OperationOpType( hOperation AS LONG ) AS LPSTR LIB hDLL DLL FUNCTION TF_OperationDevice( hOperation AS LONG ) AS LPSTR LIB hDLL DLL FUNCTION TF_OperationNumOutputs( hOperation AS LONG ) AS LONG LIB hDLL DLL FUNCTION TF_OperationNumInputs( hOperation AS LONG ) AS LONG LIB hDLL [code=fw:14h9eaf2]<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: #00D7D7;">#define</span> TF_INT32   <span style="color: #000000;">3</span><br /><span style="color: #00D7D7;">#define</span> TF_STRING  <span style="color: #000000;">7</span><br /><span style="color: #00D7D7;">#define</span> TF_INT64   <span style="color: #000000;">9</span><br /><br /><span style="color: #00C800;">static</span> hDLL<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oTF  := TensorFlow<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 />   <span style="color: #00C800;">LOCAL</span> nOp<br />   <span style="color: #00C800;">LOCAL</span> nCounter := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">LOCAL</span> nPos := <span style="color: #000000;">1</span><br />   <span style="color: #00C800;">LOCAL</span> nOld  := <span style="color: #000000;">0</span><br /><br />   oTF:<span style="color: #000000;">ImportGraph</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"graph.pb"</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">WHILE</span> .T.<br />       nOp := oTF:<span style="color: #000000;">GraphNextOperation</span><span style="color: #000000;">&#40;</span> @nPos <span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #00C800;">IF</span> nOp == <span style="color: #000000;">0</span><br />           EXIT<br />       <span style="color: #00C800;">ENDIF</span><br /><br />       ?TF_OperationName<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span>,TF_OperationOpType<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span>, TF_OperationDevice<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span>, TF_OperationNumOutputs<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span>, TF_OperationNumInputs<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #00C800;">IF</span> nPos == nOld<br />          EXIT<br />       <span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #00C800;">ENDDO</span><br /><br /><br /><br />   <span style="color: #B900B9;">//MsgInfo( oTF:Version() )</span><br /><br />  <span style="color: #B900B9;">// oTF:Run( oTF:Mul( oTF:Constant( 5, "Five" ), oTF:Constant( 3, "three" ) ) )</span><br /><br />  <span style="color: #B900B9;">//   MsgInfo( oTF:Output() )</span><br /><br />   oTF:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">DATA</span> hGraph<br />   <span style="color: #00C800;">DATA</span> hOptions<br />   <span style="color: #00C800;">DATA</span> hStatus<br />   <span style="color: #00C800;">DATA</span> hSession<br />   <span style="color: #00C800;">DATA</span> hTensorOutput<br /><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> Add<span style="color: #000000;">&#40;</span> hOperation1, hOperation1, cName <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> Mul<span style="color: #000000;">&#40;</span> hOperation1, hOperation2, cName <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> MatMul<span style="color: #000000;">&#40;</span> hOperation1, hOperation2, cName <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> Version<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> TF_Version<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> ImportGraph<span style="color: #000000;">&#40;</span> cFileName <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> TensorNum<span style="color: #000000;">&#40;</span> nValue <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> TensorString<span style="color: #000000;">&#40;</span> cString <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> StatusCode<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> Variable<span style="color: #000000;">&#40;</span> cVarName, nDataType <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> Constant<span style="color: #000000;">&#40;</span> uValue, cName <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> Run<span style="color: #000000;">&#40;</span> hOperation <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> Output<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">METHOD</span> GraphNextOperation<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   hDLL = LoadLibrary<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"tensorflow.dll"</span> <span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">hGraph</span> = TF_NewGraph<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">hOptions</span> = TF_NewSessionOptions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">hStatus</span> = TF_NewStatus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">hSession</span> = TF_NewSession<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hGraph</span>, ::<span style="color: #000000;">hOptions</span>, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #00C800;">METHOD</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   TF_CloseSession<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hSession</span>, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br />   TF_DeleteSession<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hSession</span>, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br />   TF_DeleteStatus<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br />   TF_DeleteSessionOptions<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hOptions</span> <span style="color: #000000;">&#41;</span><br /><br />   FreeLibrary<span style="color: #000000;">&#40;</span> hDLL <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;">METHOD</span> Add<span style="color: #000000;">&#40;</span> hOperation1, hOperation2, cName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> hOperationDescription := TF_NewOperation<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hGraph</span>, <span style="color: #ff0000;">"AddN"</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> cName == <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"AddN"</span>, cName <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> hOperation, hOutput<br /><br />   TF_AddInputList<span style="color: #000000;">&#40;</span> hOperationDescription, hOutput := TF_Output2<span style="color: #000000;">&#40;</span> hOperation1, hOperation2 <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br />   hOperation = TF_FinishOperation<span style="color: #000000;">&#40;</span> hOperationDescription, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br />   hb_xfree<span style="color: #000000;">&#40;</span> hOutput <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> TF_Message<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Error creating AddN operator: "</span> + Str<span style="color: #000000;">&#40;</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</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;">return</span> hOperation<br /><br /><br /><span style="color: #B900B9;">/*<br /><br /><br />*/</span><br /><br /><span style="color: #00C800;">METHOD</span> Mul<span style="color: #000000;">&#40;</span> hOperation1, hOperation2, cName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> hOperationDescription := TF_NewOperation<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hGraph</span>, <span style="color: #ff0000;">"Mul"</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> cName == <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"Mul"</span>, cName <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> hOperation, hOutput1, hOutput2<br /><br /><br />   TF_AddInput<span style="color: #000000;">&#40;</span> hOperationDescription, hOutput1 := TF_Output<span style="color: #000000;">&#40;</span> hOperation1 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   TF_AddInput<span style="color: #000000;">&#40;</span> hOperationDescription, hOutput2 := TF_Output<span style="color: #000000;">&#40;</span> hOperation2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />   hOperation = TF_FinishOperation<span style="color: #000000;">&#40;</span> hOperationDescription, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br />   hb_xfree<span style="color: #000000;">&#40;</span> hOutput1 <span style="color: #000000;">&#41;</span><br />   hb_xfree<span style="color: #000000;">&#40;</span> hOutput2 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> TF_Message<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Error creating AddN operator: "</span> + Str<span style="color: #000000;">&#40;</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</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;">return</span> hOperation<br /><br /><br /><span style="color: #00C800;">METHOD</span> MatMul<span style="color: #000000;">&#40;</span> hOperation1, hOperation2, cName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> hOperationDescription := TF_NewOperation<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hGraph</span>, <span style="color: #ff0000;">"MatMul"</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> cName == <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"MatMul"</span>, cName <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> hOperation, hOutput1, hOutput2<br /><br /><br />   TF_AddInput<span style="color: #000000;">&#40;</span> hOperationDescription, hOutput1 := TF_Output<span style="color: #000000;">&#40;</span> hOperation1 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   TF_AddInput<span style="color: #000000;">&#40;</span> hOperationDescription, hOutput2 := TF_Output<span style="color: #000000;">&#40;</span> hOperation2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   hOperation = TF_FinishOperation<span style="color: #000000;">&#40;</span> hOperationDescription, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br />   hb_xfree<span style="color: #000000;">&#40;</span> hOutput1 <span style="color: #000000;">&#41;</span><br />   hb_xfree<span style="color: #000000;">&#40;</span> hOutput2 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> TF_Message<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Error creating 0perator: "</span> + Str<span style="color: #000000;">&#40;</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</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;">return</span> hOperation<br /><br /><span style="color: #00C800;">METHOD</span> ImportGraph<span style="color: #000000;">&#40;</span> cFileName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> cGraph := MemoRead<span style="color: #000000;">&#40;</span> cFileName <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> hGraphDefOptions := TF_NewImportGraphDefOptions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> lOk := .F.<br /><br />   <span style="color: #00C800;">IF</span> !FILE <span style="color: #000000;">&#40;</span> cFileName <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">RETURN</span> lOk<br />   <span style="color: #00C800;">ENDIF</span><br /><br />   TF_GraphImportGraphDef<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hGraph</span>, TF_NewBufferFromString<span style="color: #000000;">&#40;</span> cGraph, Len<span style="color: #000000;">&#40;</span> cGraph <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, hGraphDefOptions, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">IF</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> TF_Message<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Error importing a Graph file"</span> <span style="color: #000000;">&#41;</span><br />      lOk := .F.<br />   <span style="color: #00C800;">ELSE</span><br />      lOk := .T.<br />   <span style="color: #00C800;">ENDIF</span><br /><br />   TF_DeleteImportGraphDefOptions<span style="color: #000000;">&#40;</span> hGraphDefOptions <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> lOk<br /><br /><span style="color: #00C800;">METHOD</span> TensorNum<span style="color: #000000;">&#40;</span> nValue <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> hTensor := TF_AllocateTensor<span style="color: #000000;">&#40;</span> TF_INT32, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br /><br />   Memset<span style="color: #000000;">&#40;</span> TF_TensorData<span style="color: #000000;">&#40;</span> hTensor <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br />   Memcpy<span style="color: #000000;">&#40;</span> TF_TensorData<span style="color: #000000;">&#40;</span> hTensor <span style="color: #000000;">&#41;</span>, L2Bin<span style="color: #000000;">&#40;</span> nValue <span style="color: #000000;">&#41;</span>, Len<span style="color: #000000;">&#40;</span> L2Bin<span style="color: #000000;">&#40;</span> nValue <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> hTensor<br /><br /><span style="color: #00C800;">METHOD</span> TensorString<span style="color: #000000;">&#40;</span> cString <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> hTensor := TF_AllocateTensor<span style="color: #000000;">&#40;</span> TF_STRING, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">8</span> + TF_StringEncodedSize<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> cString <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   Memset<span style="color: #000000;">&#40;</span> TF_TensorData<span style="color: #000000;">&#40;</span> hTensor <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br /><br />   TF_StringEncode<span style="color: #000000;">&#40;</span> cString, Len<span style="color: #000000;">&#40;</span> cString <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">8</span> + TF_TensorData<span style="color: #000000;">&#40;</span> hTensor <span style="color: #000000;">&#41;</span>, TF_StringEncodedSize<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> cString <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> TF_GetCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> TF_Message<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Error creating a Tensor string"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> hTensor<br /><br /><span style="color: #00C800;">METHOD</span> Variable<span style="color: #000000;">&#40;</span> cVarName, nDataType <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> hOperationDescription := TF_NewOperation<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hGraph</span>, <span style="color: #ff0000;">"Variable"</span>, cVarName <span style="color: #000000;">&#41;</span><br /><br />   TF_SetAttrType<span style="color: #000000;">&#40;</span> hOperationDescription, <span style="color: #ff0000;">"dtype"</span>, nDataType <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> TF_FinishOperation<span style="color: #000000;">&#40;</span> hOperationDescription, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">METHOD</span> Constant<span style="color: #000000;">&#40;</span> uValue, cName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> hOperationDescription, hTensor<br /><br />   <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />      <span style="color: #00C800;">case</span> ValType<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />         hTensor = ::<span style="color: #000000;">TensorString</span><span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">case</span> ValType<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"N"</span><br />         hTensor = ::<span style="color: #000000;">TensorNum</span><span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endcase</span><br /><br />   hOperationDescription = TF_NewOperation<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hGraph</span>, <span style="color: #ff0000;">"Const"</span>, cName <span style="color: #000000;">&#41;</span><br />   TF_SetAttrTensor<span style="color: #000000;">&#40;</span> hOperationDescription, <span style="color: #ff0000;">"value"</span>, hTensor, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br />   TF_SetAttrType<span style="color: #000000;">&#40;</span> hOperationDescription, <span style="color: #ff0000;">"dtype"</span>, TF_TensorType<span style="color: #000000;">&#40;</span> hTensor <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> TF_FinishOperation<span style="color: #000000;">&#40;</span> hOperationDescription, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">METHOD</span> Run<span style="color: #000000;">&#40;</span> hOperation <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> hTensorOutput := <span style="color: #000000;">0</span>, hOutput<br /><br />   TF_SessionRun<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hSession</span>, <span style="color: #000000;">0</span>,;<br />                  <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,;  <span style="color: #B900B9;">// Inputs</span><br />                  hOutput := TF_Output<span style="color: #000000;">&#40;</span> hOperation, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, @hTensorOutput, <span style="color: #000000;">1</span>,;  <span style="color: #B900B9;">// Outputs</span><br />                  hOperation, <span style="color: #000000;">1</span>,;  <span style="color: #B900B9;">// Operations</span><br />                  <span style="color: #000000;">0</span>, ::<span style="color: #000000;">hStatus</span> <span style="color: #000000;">&#41;</span><br /><br />   hb_xfree<span style="color: #000000;">&#40;</span> hOutput <span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">hTensorOutput</span> = hTensorOutput<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">METHOD</span> Output<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br /><br />   <span style="color: #00C800;">local</span> nType := TF_TensorType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hTensorOutput</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> uValue<br /><br />   <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />      <span style="color: #00C800;">case</span> nType == TF_STRING<br />         uValue = TF_TensorString<span style="color: #000000;">&#40;</span> TF_TensorData<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hTensorOutput</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">case</span> nType == TF_INT64 .or. nType == TF_INT32<br />         uValue = TF_TensorNum<span style="color: #000000;">&#40;</span> TF_TensorData<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hTensorOutput</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">otherwise</span><br />         MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"type not supported in Method Output yet"</span>, nType <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">return</span> uValue<br /><br /><span style="color: #B900B9;">/*<br />  2019-01-12 by. Charles Kwon<br />*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GraphNextOperation<span style="color: #000000;">&#40;</span> nPos <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TensorFlow<br />   <span style="color: #00C800;">LOCAL</span> nOp  := TF_GraphNextOperation<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hGraph</span>, @nPos <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> nOp<br /><br /><br /><br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_Version<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> AS LPSTR LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_NewGraph<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_NewSessionOptions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_NewStatus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_NewSession<span style="color: #000000;">&#40;</span> hGraph AS LONG, hOptions AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_CloseSession<span style="color: #000000;">&#40;</span> hSession AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_DeleteSession<span style="color: #000000;">&#40;</span> hSession AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_DeleteStatus<span style="color: #000000;">&#40;</span> hStatus AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_DeleteSessionOptions<span style="color: #000000;">&#40;</span> hOptions AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_NewImportGraphDefOptions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_GraphImportGraphDef<span style="color: #000000;">&#40;</span> hGraph AS LONG, hBuffer AS LONG, hGraphDefOptions AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_NewBufferFromString<span style="color: #000000;">&#40;</span> cString AS LPSTR, nLegth AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_GetCode<span style="color: #000000;">&#40;</span> hStatus AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_DeleteImportGraphDefOptions<span style="color: #000000;">&#40;</span> hGraphDefOptions AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_NewTensor<span style="color: #000000;">&#40;</span> nType AS LONG, @pDims AS LONG, nDims AS LONG, @pData AS LONG, nLength AS LONG, pDeallocator AS LONG,;<br />                           pDeallocatorArgs AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_AllocateTensor<span style="color: #000000;">&#40;</span> nType AS LONG, pDims AS LONG, nDims AS LONG, nLegth AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_StringEncodedSize<span style="color: #000000;">&#40;</span> nLength AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_TensorData<span style="color: #000000;">&#40;</span> hTensor AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_StringEncode<span style="color: #000000;">&#40;</span> cString AS LPSTR, nLength AS LONG, pDest AS LONG, nDestLength AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_SessionRun<span style="color: #000000;">&#40;</span> hSession AS LONG, hRunOptions AS LONG, hInputs AS LONG, @hInputValues AS LONG, nInputs AS LONG,;<br />                            hOutputs AS LONG, @hOutputValues AS LONG, nOutputs AS LONG, @hTargetOperations AS LONG, nTargets AS LONG,;<br />                            hRunMetadata AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_Message<span style="color: #000000;">&#40;</span> hStatus AS LONG <span style="color: #000000;">&#41;</span> AS LPSTR LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_NewOperation<span style="color: #000000;">&#40;</span> hGraph AS LONG, cOperationType AS LPSTR, cOperationName AS LPSTR <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_SetAttrTensor<span style="color: #000000;">&#40;</span> hOperationDescription AS LONG, cAttributeName AS LPSTR, hTensor AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_TensorType<span style="color: #000000;">&#40;</span> hTensor AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_SetAttrType<span style="color: #000000;">&#40;</span> hOperationDescription AS LONG, cAttributeName AS LPSTR, nDataType AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_FinishOperation<span style="color: #000000;">&#40;</span> hOperationDescription AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_AddInput<span style="color: #000000;">&#40;</span> hOperationDescription AS LONG, nInput AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_AddInputList<span style="color: #000000;">&#40;</span> hOperationDescription AS LONG, hInputs AS LONG, nInputs AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_GraphSetTensorShape<span style="color: #000000;">&#40;</span> hGraph AS LONG, hOutput AS LONG, @pDims AS LONG, nDims AS LONG, hStatus AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_SetAttrShape<span style="color: #000000;">&#40;</span> hOperationDescription AS LONG, cAttributeName AS LPSTR, @pDims AS LONG, nDims AS LONG <span style="color: #000000;">&#41;</span> AS VOID LIB hDLL<br /><br /><span style="color: #B900B9;">/*<br />  2019-01-12 by. Charles Kwon<br />*/</span><br />DLL <span style="color: #00C800;">FUNCTION</span> TF_GraphNextOperation<span style="color: #000000;">&#40;</span> hGraph AS LONG, @nPos AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br />DLL <span style="color: #00C800;">FUNCTION</span> TF_OperationName<span style="color: #000000;">&#40;</span> hOperation AS LONG <span style="color: #000000;">&#41;</span> AS LPSTR LIB hDLL<br />DLL <span style="color: #00C800;">FUNCTION</span> TF_OperationOpType<span style="color: #000000;">&#40;</span> hOperation AS LONG <span style="color: #000000;">&#41;</span> AS LPSTR LIB hDLL<br />DLL <span style="color: #00C800;">FUNCTION</span> TF_OperationDevice<span style="color: #000000;">&#40;</span> hOperation AS LONG <span style="color: #000000;">&#41;</span> AS LPSTR LIB hDLL<br />DLL <span style="color: #00C800;">FUNCTION</span> TF_OperationNumOutputs<span style="color: #000000;">&#40;</span> hOperation AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br />DLL <span style="color: #00C800;">FUNCTION</span> TF_OperationNumInputs<span style="color: #000000;">&#40;</span> hOperation AS LONG <span style="color: #000000;">&#41;</span> AS LONG LIB hDLL<br /><br /><br /><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br />typedef struct TF_Output <span style="color: #000000;">&#123;</span><br />  void * oper;<br />  int <span style="color: #0000ff;">index</span>;<br /><span style="color: #000000;">&#125;</span> TF_Output;<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> TF_OUTPUT <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   TF_Output * hOutput = <span style="color: #000000;">&#40;</span> TF_Output * <span style="color: #000000;">&#41;</span> hb_xgrab<span style="color: #000000;">&#40;</span> sizeof<span style="color: #000000;">&#40;</span> TF_Output <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><br />   hOutput->oper = <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />   hOutput->index = hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br /><br />   hb_retnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> HB_LONGLONG <span style="color: #000000;">&#41;</span> hOutput <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> TF_OUTPUT2 <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   TF_Output * hOutput = <span style="color: #000000;">&#40;</span> TF_Output * <span style="color: #000000;">&#41;</span> hb_xgrab<span style="color: #000000;">&#40;</span> sizeof<span style="color: #000000;">&#40;</span> TF_Output <span style="color: #000000;">&#41;</span> * <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br /><br />   hOutput<span style="color: #000000;">&#91;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#93;</span>.oper = <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />   hOutput<span style="color: #000000;">&#91;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#93;</span>.<span style="color: #0000ff;">index</span> = <span style="color: #000000;">0</span>;<br />   hOutput<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>.oper = <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br />   hOutput<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>.<span style="color: #0000ff;">index</span> = <span style="color: #000000;">0</span>;<br /><br />   hb_retnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> HB_LONGLONG <span style="color: #000000;">&#41;</span> hOutput <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> TF_TENSORSTRING <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   hb_retc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> char * <span style="color: #000000;">&#41;</span> hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> TF_TENSORNUM <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   hb_retnl<span style="color: #000000;">&#40;</span> * <span style="color: #000000;">&#40;</span> int * <span style="color: #000000;">&#41;</span> hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> MEMSET <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   hb_retnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> HB_LONGLONG <span style="color: #000000;">&#41;</span> memset<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> MEMCPY <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   hb_retnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> HB_LONGLONG <span style="color: #000000;">&#41;</span> memcpy<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> HB_XFREE <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   hb_xfree<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> hb_parnll<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:14h9eaf2]