topic
stringlengths
1
63
text
stringlengths
1
577k
Clase FILEXLS
Gracias Jose amablemente ya me habian enviado la clase al correo Ruben, <!-- w --><a class="postlink" href="http://www.sitasoft.net/fivewin/files/xlslib.zip">www.sitasoft.net/fivewin/files/xlslib.zip</a><!-- w -->
Clase GETBTN
Hola Alguien tiene o sabe donde puedo conseguir la clase GETBTN ?
Clase GETBTN
No és la BTNGET.PRG? GETBTN.PRG no conozco.
Clase GETBTN
[code=fw:2exaf61b]<div class="fw" id="{CB}" style="font-family: monospace;"><br />*-- PROGRAM FILE -------------------------------------------------------<br />* &nbsp;Application: <span style="color: #000000;">Addon</span> <span style="color: #00C800;">for</span> FiveWin<br />* &nbsp;Description: <span style="color: #000000;">TBtnGet</span> - Colored TGet <span style="color: #00C800;">class</span> with <span style="color: #0000ff;">button</span><br />* &nbsp; &nbsp;File <span style="color: #0000ff;">Name</span>: <span style="color: #000000;">tbtnget</span>.prg<br />* &nbsp; &nbsp; &nbsp; Author: <span style="color: #000000;">Ricardo</span> Ramirez &nbsp; &nbsp; &nbsp; Tester: <span style="color: #000000;">Ricardo</span> Ramirez<br />* Date created: <span style="color: #000000;">1998</span><span style="color: #000000;">-01</span><span style="color: #000000;">-01</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Date updated: þ<span style="color: #000000;">2001</span><span style="color: #000000;">-03</span><span style="color: #000000;">-26</span><br />* Time created: <span style="color: #000000;">8</span>:<span style="color: #000000;">17</span>:12PM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Time updated: þ<span style="color: #000000;">16</span>:<span style="color: #000000;">028</span>:17M<br />* &nbsp; &nbsp;Copyright: <span style="color: #000000;"><span style="color: #000000;">&#40;</span>c</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">1998</span><span style="color: #000000;">-2000</span> by Punto-Co<br />*<br />&nbsp;* $Id: <span style="color: #000000;">btnget</span>.prg,v <span style="color: #000000;">1.4</span> <span style="color: #000000;">2001</span>/<span style="color: #000000;">08</span>/<span style="color: #000000;">10</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">12</span>:<span style="color: #000000;">21</span> RRamirez <span style="color: #0000ff;">Exp</span> $<br />*<br />* Compliments <span style="color: #0000ff;">of</span>:<br /><span style="color: #000000;">*</span> &nbsp;George Georguiev<br />*-----------------------------------------------------------------------<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> GWL_STYLE &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">-16</span><br /><span style="color: #00D7D7;">#define</span> GWL_EXSTYLE &nbsp; &nbsp; &nbsp; <span style="color: #000000;">-20</span><br /><span style="color: #00D7D7;">#define</span> DS_3DLOOK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> SM_CYVSCROLL &nbsp; &nbsp; &nbsp; <span style="color: #000000;">20</span><br /><br /><span style="color: #00C800;">CLASS</span> TBtnGet <span style="color: #0000ff;">FROM</span> TGet<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp; bAction, cResName, oBtn, lBtnORBmp<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp; nClrPFoText, nClrPFoPane, nClrDef<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp; nBmpWidth, bTmpValid<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp; nClrFocusText, nClrFocusPane <span style="color: #B900B9;">// added. There was erased from FW 2.2c</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ClassName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> <span style="color: #ff0000;">"TGET"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nRow, nCol, bSetGet, oWnd, nWidth, nHeight, cPict, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bValid, nClrFore, nClrBack, oFont, lDesign, oCursor, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lPixel, cMsg, lUpdate, bWhen, lCenter, lRight, bChanged,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lReadOnly, lPassword, lNoBorder, nHelpId, cResName, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bAction, lSpinner, bUp, bDown, bMin, bMax, nBmpWidth <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CONSTRUCTOR<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">ReDefine</span><span style="color: #000000;">&#40;</span> nId, bSetGet, oWnd, nHelpId, cPict, bValid, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nClrFore, nClrBack, oFont, oCursor, cMsg, lUpdate, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bWhen, bChanged, lReadOnly, lSpinner, bUp, bDown, bMin, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bMax, cResName, bAction <span style="color: #000000;">&#41;</span> CONSTRUCTOR<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">Default</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> Initiate<span style="color: #000000;">&#40;</span> hDlg <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Initiate</span><span style="color: #000000;">&#40;</span> hDlg <span style="color: #000000;">&#41;</span>, ::<span style="color: #00C800;">Default</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> SetIniClr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> CalcDims<span style="color: #000000;">&#40;</span> nTop, nLeft, nWidth, nHeight <span style="color: #000000;">&#41;</span><br /><br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nRow, nCol, bSetGet, oWnd, nWidth, nHeight, cPict, bValid,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nClrFore, nClrBack, oFont, lDesign, oCursor, lPixel, cMsg,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lUpdate, bWhen, lCenter, lRight, bChanged, lReadOnly,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lPassword, lNoBorder, nHelpId, cResName, bAction, lSpinner,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bUp, bDown, bMin, bMax, nBmpWidth <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnGet<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nRow, nCol, bSetGet, oWnd, nWidth, nHeight, cPict, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bValid, nClrFore, nClrBack, oFont, lDesign, oCursor, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lPixel, cMsg, lUpdate, bWhen, lCenter, lRight, bChanged, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReadOnly, lPassword, lNoBorder, nHelpId, lSpinner,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bUp, bDown, bMin, bMax <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nBmpWidth := <span style="color: #000000;">17</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">nStyle</span> := nOr<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nStyle</span>, ES_MULTILINE <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">bAction</span> &nbsp; := bAction<br />&nbsp; &nbsp;::<span style="color: #000000;">cResName</span> &nbsp;:= cResName<br />&nbsp; &nbsp;::<span style="color: #000000;">lBtnORBmp</span> := .F.<br />&nbsp; &nbsp;::<span style="color: #000000;">nBmpWidth</span> := nBmpWidth<br />&nbsp; &nbsp;::<span style="color: #000000;">SetIniClr</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;">Self</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">ReDefine</span><span style="color: #000000;">&#40;</span> nId, bSetGet, oWnd, nHelpId, cPict, bValid, nClrFore,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nClrBack, oFont, oCursor, cMsg, lUpdate, bWhen, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bChanged, lReadOnly, lSpinner, bUp, bDown, bMin, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bMax, cResName, bAction, nBmpWidth <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnGet<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Super</span>:<span style="color: #0000ff;">ReDefine</span><span style="color: #000000;">&#40;</span> nId, bSetGet, oWnd, nHelpId, cPict, bValid, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nClrFore, nClrBack, oFont, oCursor, cMsg, lUpdate, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bWhen, bChanged, lReadOnly, lSpinner, bUp, bDown, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bMin, bMax <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nBmpWidth := <span style="color: #000000;">22</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">nStyle</span> &nbsp; &nbsp;:= nOr<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nStyle</span>, ES_MULTILINE <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">bAction</span> &nbsp; := bAction<br />&nbsp; &nbsp;::<span style="color: #000000;">cResName</span> &nbsp;:= cResName<br />&nbsp; &nbsp;::<span style="color: #000000;">lBtnORBmp</span> := .F.<br />&nbsp; &nbsp;::<span style="color: #000000;">nBmpWidth</span> := nBmpWidth<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">SetIniClr</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;SetWindowLong<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, GWL_STYLE, nOr<span style="color: #000000;">&#40;</span> GetWindowLong<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, GWL_STYLE <span style="color: #000000;">&#41;</span> , ES_MULTILINE <span style="color: #000000;">&#41;</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> <span style="color: #00C800;">Default</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnGet<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRectLen, l3Dlook<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nTop, nLeft, nWidth, nHeight<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bAction</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;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//MSGINFO( GetWindowLong( ::oWnd:hWnd, GWL_STYLE ))</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !lAnd<span style="color: #000000;">&#40;</span> GetWindowLong<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, GWL_STYLE <span style="color: #000000;">&#41;</span>, ES_MULTILINE <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//MsgStop("Sorry, but you need to define the ID " + ltrim( str( ::nId ) ) + " as MULTILINE ")</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">&#40;</span> GetWindowLong<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, GWL_STYLE <span style="color: #000000;">&#41;</span> , ES_MULTILINE <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//MsgInfo("Si soy")</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//MsgInfo("no soy")</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//SetWindowLong( ::hWnd, GWL_EXSTYLE, nOr( GetWindowLong( ::hWnd, GWL_EXSTYLE ) , ES_MULTILINE ) )</span><br /><br />&nbsp; &nbsp;nRectLen := ::<span style="color: #000000;">CalcDims</span><span style="color: #000000;">&#40;</span> @nTop, @nLeft, @nWidth, @nHeight <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">oBtn</span> := TBtnDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nTop, nLeft, nWidth, nHeight, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cResName</span>,, ::<span style="color: #000000;">cResName</span>,, <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">Self</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bAction</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #00C800;">Self</span>,<span style="color: #ff0000;">""</span>,, .F., .F.,<span style="color: #ff0000;">""</span>, ,, , .f. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">bKeyDown</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> | nKey | IIF<span style="color: #000000;">&#40;</span> nKey == VK_F7, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bAction</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">oBtn</span>:<span style="color: #000000;">bGotFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">bTmpValid</span> := ::<span style="color: #000000;">bValid</span>, ::<span style="color: #000000;">bValid</span> := <span style="color: #00C800;">nil</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nLastKey</span> := <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">oBtn</span>:<span style="color: #000000;">bLostFocus</span> := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">bValid</span> := ::<span style="color: #000000;">bTmpValid</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;GetBtn<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, nRectLen <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> SetIniClr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnGet<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">nClrFocusText</span> := nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">000</span>, <span style="color: #000000;">000</span>, <span style="color: #000000;">000</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nClrFocusPane</span> := nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">243</span>, <span style="color: #000000;">250</span>, <span style="color: #000000;">200</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nClrPFoText</span> &nbsp; := ::<span style="color: #000000;">nClrText</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nClrPFoPane</span> &nbsp; := ::<span style="color: #000000;">nClrPane</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//</span><br />&nbsp; &nbsp;::<span style="color: #000000;">bGotFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrFocusText</span>, ::<span style="color: #000000;">nClrFocusPane</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">bLostFocus</span> := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrPFoText</span> &nbsp;, ::<span style="color: #000000;">nClrPFoPane</span> &nbsp;<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nTop, nLeft, nWidth, nHeight, lRepaint <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnGet<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nRectLen<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Super</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nTop, nLeft, nWidth, nHeight, lRepaint <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ::<span style="color: #000000;">oBtn</span> != <span style="color: #00C800;">Nil</span><br /><br />&nbsp; &nbsp; &nbsp; nRectLen := ::<span style="color: #000000;">CalcDims</span><span style="color: #000000;">&#40;</span> @nTop, @nLeft, @nWidth, @nHeight <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oBtn</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nTop, nLeft, nWidth, nHeight <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">METHOD</span> CalcDims<span style="color: #000000;">&#40;</span> nTop, nLeft, nWidth, nHeight <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnGet<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nRectLen<br /><br />&nbsp; &nbsp;nRectLen := ::<span style="color: #000000;">nBmpWidth</span> + <span style="color: #000000;">4</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lAnd<span style="color: #000000;">&#40;</span> GetWindowLong<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">hWnd</span>, GWL_STYLE <span style="color: #000000;">&#41;</span>, DS_3DLOOK <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cResName</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLeft &nbsp; := ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">16</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nWidth &nbsp;:= <span style="color: #000000;">12</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLeft &nbsp; := ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">26</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nWidth &nbsp;:= <span style="color: #000000;">22</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; nTop &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nHeight := ::<span style="color: #000000;">nHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">4</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cResName</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLeft &nbsp; := ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">15</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nWidth &nbsp;:= <span style="color: #000000;">14</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLeft &nbsp; := ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">25</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nWidth &nbsp;:= <span style="color: #000000;">24</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; nTop &nbsp; &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; nHeight := ::<span style="color: #000000;">nHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">2</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cResName</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nRectLen -= <span style="color: #000000;">9</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">oVScroll</span> != <span style="color: #00C800;">Nil</span><br />&nbsp; &nbsp; &nbsp; nLeft &nbsp;-= GetSysMetrics<span style="color: #000000;">&#40;</span> SM_CYVSCROLL <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nLeft++<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">Return</span> nRectLen<br />&nbsp;</div>[/code:2exaf61b] 
Clase GETBTN
[url:3aj997qy]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=11311&p=55715&hilit=clase+btnget#p55715[/url:3aj997qy] Saludos.
Clase GETBTN
Hola Alguien tiene o sabe donde puedo conseguir la clase GETBTN ?
Clase GETBTN
FWH proporciona la misma funcionalidad con la claúsula ACTION de los GETs: ... GET ... ACTION ... BITMAP ...
Clase GETBTN
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=190908">viewtopic.php?p=190908</a><!-- l -->
Clase GETBTN
Y esta clase ya no esta disponible ?
Clase GETBTN
Muchas gracias a todos
Clase MultiPreview para xHarbour
Esta clase es muy útil, la he usado en Clipper. Alguien la tiene para [x]Harbour?
Clase MultiPreview para xHarbour
Antonio, El cambio del preview de impresión en este build logra un efecto parecido al que se obtenía con MultiPreview?
Clase MySql Nativa de FWH (SOLUCIONADO)
Hola para poder utilizar la clase nativa de conexión con MySql, además de actualizar mi FW, hay que instalar algún conector ODBC? O funciona sin instalar nada, como lo hace la clase TDolphin, que funciona solamente con la LIB y la DLL? Gracias! Roberto
Clase MySql Nativa de FWH (SOLUCIONADO)
Funciona como TDolphin, no necesitas ningún conector ... Saludos
Clase MySql Nativa de FWH (SOLUCIONADO)
Gracias! Entonces habrá que pensar el actualizarse... Muchas gracias! Roberto
Clase Nativa MySql
Estimados: Estoy tratando de migrar desde TDolphin a la clase nativa de MySql/MariaDB Intento encontrar los métodos similares que utilizaba en TDolphin. Los mismos son los siguientes: GetRowObj() Para obtener un objeto copia el registro actual GetBlankRow() Para obtener un objeto con los datos en blanco GetAutoIncrement(cTable) Para obtener el próximo valor del autoincremental de una tabla oRow para asignar un objeto obtenido previamente con GetRowObj al objeto oRs y luego hacer Save() Otra consulta La clase esta disponible en source\classes ? En caso de que no, donde puedo ver todos los metodos de la clase y sus variables? Consulte este hilo <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=32657&start=0">viewtopic.php?f=3&t=32657&start=0</a><!-- l --> pero no se si está todo lo que incluye la clase. Agradecido de antemano
Clase Nativa MySql
Los fuentes no son incluidos en source, la clase no puede heredar, esos metodos no existenten. la documentación esta aca [url:34vk7ste]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_class_fwmariaconnection[/url:34vk7ste] [url:34vk7ste]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_class_fwmariarowset[/url:34vk7ste]
Clase Nativa MySql
Muchas gracias por la info Carlos. [quote:2xkzryex]esos metodos no existenten.[/quote:2xkzryex] Existen algunos similares?
Clase Nativa MySql
Instead of GetRowObj(), use [code=fw:1jzhf0sb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRec := oQry:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// returns FW_Record/TDataRow Object</span><br />&nbsp;</div>[/code:1jzhf0sb] You may edit the oRec object using oRec:FieldName in the Gets,etc/ Instead of GetBlankRow(), use [code=fw:1jzhf0sb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRec := oQry:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// returns blank FW_Record/TDataRow objecct</span><br />&nbsp;</div>[/code:1jzhf0sb] [quote:1jzhf0sb] oRow to assign a previously obtained object with GetRowObj to the oRs object and then Save() [/quote:1jzhf0sb] This is not necessary. After editing the existing or blank FW_Record objec, simple call [code=fw:1jzhf0sb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1jzhf0sb] In case of existing records, the changes will be written to that record and in case of blank record, a new record will be appended to the rowset. You can also use oRec:Edit() or oQry:Edit() or oQry:Edit( .t. ) Please try.
Clase Nativa MySql
Excelente Mr. Rao! Voy entendiendo la lógica. El GetAutoIncrement(cTable) lo reemplace por una funcion propia simple: [code=fw:2esfdbah]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> GetAutoIncrement<span style="color: #000000;">&#40;</span>cTable,cField<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> oApp:<span style="color: #000000;">oServer</span>:<span style="color: #000000;">QueryResult</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'SELECT MAX('</span>+cField+<span style="color: #ff0000;">') FROM '</span> + cTable<span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span></div>[/code:2esfdbah] Pero no me lo deja asignar al campo Esto funciona: [code=fw:2esfdbah]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRec := oQry:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br />oRec:<span style="color: #000000;">ciudad</span> := <span style="color: #ff0000;">"Mercedes (B)"</span><br />&nbsp;</div>[/code:2esfdbah] Esto no funciona: [code=fw:2esfdbah]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRec := oQry:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br />oRec:<span style="color: #000000;">codigo</span> := &nbsp;GetAutoIncrement<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ciudades"</span>,<span style="color: #ff0000;">"codigo"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Campo codigo es autoincremental</span><br />&nbsp;</div>[/code:2esfdbah] Me da el siguiente error [code=fw:2esfdbah]<div class="fw" id="{CB}" style="font-family: monospace;">Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">39</span> &nbsp;Escritura no autorizada: <span style="color: #000000;">TDATAROW</span>:<span style="color: #000000;">codigo</span><br />&nbsp; &nbsp;Args:<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> &nbsp; <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = O &nbsp; TDATAROW</div>[/code:2esfdbah] Entiendo que debe ser porque el campo es autoincremental. Pero un registro nuevo igualmente puede tener un código libre, eso lo permite MySql. Espero haber sido claro. Muchas gracias por su tiempo!
Clase Nativa MySql
[quote:1pu67rlu] Pero un registro nuevo igualmente puede tener un código libre, eso lo permite MySql. Espero haber sido claro. English: But a new record can still have a free code, that is allowed by MySql. I hope I was clear. [/quote:1pu67rlu] Yes. But this is a very unsafe practice for regular insertion of records. We can use this feature in rate occasions like, 1) fill gaps in auto-inc values due to deletions 2) reseed the auto-increment value to a higher value. Even for this, it is more appropriate to use ALTER TABLE command than inserting a higher value. [quote:1pu67rlu] El GetAutoIncrement(cTable) lo reemplace por una funcion propia simple: [code=fw:1pu67rlu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> GetAutoIncrement<span style="color: #000000;">&#40;</span>cTable,cField<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> oApp:<span style="color: #000000;">oServer</span>:<span style="color: #000000;">QueryResult</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'SELECT MAX('</span>+cField+<span style="color: #ff0000;">') FROM '</span> + cTable<span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span><br />&nbsp;</div>[/code:1pu67rlu] [/quote:1pu67rlu] It is not as simple as that. Even MySql server does not know the next autoinc value, till the time it actually inserts the record in the table. Between the moment server answers the query "SELECT MAX(fld) FROM table" and the time the new record is actually inserted, several other users might have already inserted several records and this insertion will result in an error. [i:1pu67rlu]Note: We are not discussing single user applications here.[/i:1pu67rlu] Let us see this example. There is a small table with these records. [code=fw:1pu67rlu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">ID</span> FLD1 FLD2<br />&nbsp;<span style="color: #000000;">1</span> AA &nbsp; AAAA<br />&nbsp;<span style="color: #000000;">2</span> BB &nbsp; BBBB<br />&nbsp;</div>[/code:1pu67rlu] ID is the auto-increment primary field. User-A and User-B (and may be more users) are running our application inserting new transactions. Both users A and B (and also other users) will assume the next autoinc id will be 3, using the above function. Mr. A is about to commit his new record with this sql statement [code=fw:1pu67rlu]<div class="fw" id="{CB}" style="font-family: monospace;"><br />INSERT INTO table <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ID</span>,FLD1,FLD2<span style="color: #000000;">&#41;</span> VALUES <span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span>, <span style="color: #ff0000;">'CC'</span>,<span style="color: #ff0000;">'CCCC'</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1pu67rlu] Just a split second before, User-B inserts his new data with [code=fw:1pu67rlu]<div class="fw" id="{CB}" style="font-family: monospace;"><br />INSERT INTO table <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ID</span>,FLD1,FLD2<span style="color: #000000;">&#41;</span> VALUES <span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span>, <span style="color: #ff0000;">'DD'</span>,<span style="color: #ff0000;">'DDDD'</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1pu67rlu] User-B's insertion will be successful. But User-A's insertion fails with an error. Note: The problem remains the same even if we read auto_increment value from the table_schema. So, the safe practice as well as widely adopted practice is to insert the record without any value to auto-inc field and then get the LAST_INSERT_ID to inform the user. By default, the RowSet class treats auto-increment field as read-only. TDatarow inherts the readonly attribute from the RowSet object. In my next post I will explain how to over-ride this default behavior.
Clase Nativa MySql
Muy clara su explicación Mr. Rao, y es así como ud. lo indica. Igualmente, siguiendo su ejemplo, el error se puede capturar con un TRY CATCH e indicárselo al usuario: [code=fw:i8ugties]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">TRY</span><br />&nbsp; oCn:<span style="color: #000000;">BeginTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; oQry:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; oCn:<span style="color: #000000;">CommitTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />CATCH oError<br />&nbsp; MsgStop<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Error al grabar"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span>+oError:<span style="color: #000000;">description</span>,<span style="color: #ff0000;">"Error"</span><span style="color: #000000;">&#41;</span><br />&nbsp; oCn:<span style="color: #000000;">RollBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br />&nbsp;</div>[/code:i8ugties] Esto está bien? De esta manera le puedo mostrar al usuario y dejarle elegir que id poner, y controlar por programa si el código ya existe. Entiendo perfectamente que no es la mejor práctica, pero es válida si se controla correctamente. El problema me surge cuando las tablas ya están definidas y son usadas por otros sistemas que no puedo modificar (comparto tablas entre sistemas web y mis aplicaciones). En mi caso, sería de mucha utilidad poder anular esa comportamiento por default Desde ya muchas gracias
Clase Nativa MySql
[quote="cmsoft":1rg43rk6] Igualmente, siguiendo su ejemplo, el error se puede capturar con un TRY CATCH e indicárselo al usuario: [code=fw:1rg43rk6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">TRY</span><br />  oCn:<span style="color: #000000;">BeginTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  oQry:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  oCn:<span style="color: #000000;">CommitTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />CATCH oError<br />  MsgStop<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Error al grabar"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span>+oError:<span style="color: #000000;">description</span>,<span style="color: #ff0000;">"Error"</span><span style="color: #000000;">&#41;</span><br />  oCn:<span style="color: #000000;">RollBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /> </div>[/code:1rg43rk6] Esto está bien? [/quote:1rg43rk6] TRY/CATCH construct not only does not work but can be misleading too because the FWH lib does not raise Runtime Error for any MySql error. oRs:Save() returns true/false for success/failure and the execution goes to the next line, i.e., commit transaction and oCn:RollBack() is never executed. Also for saving to single table, transactions are not necessary. Recommended: [code=fw:1rg43rk6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> oRs:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Success</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// appropriate code</span><br /><span style="color: #00C800;">else</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// failure</span><br />&nbsp; &nbsp;oCn:<span style="color: #000000;">ShowError</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// optional</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// suitable action on failure</span><br /><span style="color: #00C800;">endif</span><br />&nbsp;</div>[/code:1rg43rk6] OR [code=fw:1rg43rk6]<div class="fw" id="{CB}" style="font-family: monospace;">oCn:<span style="color: #000000;">lShowErrors</span> := .t.<br /><span style="color: #00C800;">if</span> oRs:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// success</span><br /><span style="color: #00C800;">else</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// failure. Automatic error message</span><br /><span style="color: #00C800;">endif</span><br />&nbsp;</div>[/code:1rg43rk6] We need to use Transactions when saving changes to two or more RowSets simultaneously. (i.e., either all should be saved or none): [code=fw:1rg43rk6]<div class="fw" id="{CB}" style="font-family: monospace;">oCn:<span style="color: #000000;">lShowErrors</span> := .t. <span style="color: #B900B9;">// can be a global setting</span><br />oCn:<span style="color: #000000;">BeginTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">if</span> oRs1:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. oRs2:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. ;<br />&nbsp; &nbsp;oRs3:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. oRs4:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCn:<span style="color: #000000;">CommitTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">else</span><br />&nbsp; &nbsp;oCn:<span style="color: #000000;">RollBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br />&nbsp;</div>[/code:1rg43rk6] Note: if one of the Save()s fails with an error, automatic error message is displayed and subsequent Save()s are not executed and RollBack() is executed.
Clase Nativa MySql
Excelente su explicación Mr. Rao. Veo que la lógica de la librería nativa es bastante diferente a la de la clase Dolphin. Es cuestión de cambiar el modelo de programación. El mismo criterio se aplicia a una instrucción Execute? Esto estaría mal: [code=fw:1mvmaqlb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">TRY</span><br />  oCn:<span style="color: #000000;">BeginTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span>cSql1<span style="color: #000000;">&#41;</span><br />  oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span>cSql2<span style="color: #000000;">&#41;</span><br />  oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span>cSql3<span style="color: #000000;">&#41;</span><br />  oCn:<span style="color: #000000;">CommitTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />CATCH oError<br />  MsgStop<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Error al grabar"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span>+oError:<span style="color: #000000;">description</span>,<span style="color: #ff0000;">"Error"</span><span style="color: #000000;">&#41;</span><br />  oCn:<span style="color: #000000;">RollBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /> </div>[/code:1mvmaqlb] Debería ser así ? [code=fw:1mvmaqlb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">lShowErrors</span> := .t. <span style="color: #B900B9;">// can be a global setting</span><br />oCn:<span style="color: #000000;">BeginTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">if</span> oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span>cSql1<span style="color: #000000;">&#41;</span> .and. oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span>cSql2<span style="color: #000000;">&#41;</span> .and. ;<br />   oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span>cSql3<span style="color: #000000;">&#41;</span><br />   oCn:<span style="color: #000000;">CommitTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">else</span><br />   oCn:<span style="color: #000000;">RollBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br /> </div>[/code:1mvmaqlb] Quiero ir entendiendo la lógica, por eso la consulta... [b:1mvmaqlb]Editado[/b:1mvmaqlb] Veo que execute devuelve : a) nulo si no hay resultado o si ocurrió un error. En caso de error, oCn:nError y oCn:cError proporcionan la información del error. Opcionalmente, configurar lShowError muestra el error o el resultado de la instrucción sql, b) Numérico: en caso de inserción, actualización, etc., indicando las filas afectadas c) Si el resultado es un conjunto de resultados, se devuelve como matriz Multi-Dim Como recomienda que debería ser el proceso indicado?
Clase Nativa MySql
Execute(...) method does not return true or false. Execute( "SELECT ... " ) returns an array of selected values. Execute( "UPDATE .." OR "INSERT..." ) returns number of records affected. Only test: if oCn:nError == 0; success; else; fail; endif Now, different ways: [b:23c2c79z]Sample - 1[/b:23c2c79z]: [code=fw:23c2c79z]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">lShowErrors</span> := .t. <span style="color: #B900B9;">// global setting</span><br /><br />oCn:<span style="color: #000000;">BeginTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />lSuccess := .t.<br /><span style="color: #00C800;">for</span> each cSql in <span style="color: #000000;">&#123;</span> cSql1, cSql2, ... cSqlN <span style="color: #000000;">&#125;</span><br />   oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cSql <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> oCn:<span style="color: #000000;">nError</span> != <span style="color: #000000;">0</span><br />      lSucess := .f.<br />      EXIT<br />   <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span><br /><span style="color: #00C800;">if</span> lSuccess<br />   oCn:<span style="color: #000000;">CommitTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">else</span><br />   oCn:<span style="color: #000000;">RollBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br /> </div>[/code:23c2c79z] [b:23c2c79z]Sample - 2[/b:23c2c79z]: [code=fw:23c2c79z]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">lShowErrors</span> := .t. <span style="color: #B900B9;">// global setting</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oCn:<span style="color: #000000;">BeginTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> each cSql in <span style="color: #000000;">&#123;</span> cSql1, cSql2, ... cSqlN <span style="color: #000000;">&#125;</span><br />      oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cSql <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> oCn:<span style="color: #000000;">nError</span> != <span style="color: #000000;">0</span><br />         <span style="color: #00C800;">THROW</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">next</span><br />   oCn:<span style="color: #000000;">CommitTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />CATCH<br />   oCn:<span style="color: #000000;">RollBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END<br /> </div>[/code:23c2c79z] [b:23c2c79z]Sample - 3[/b:23c2c79z]: FWH 21.11 onwards only: If the flag oCn:lThrowError (default .F.) is set to .T., method Execute() raises Run-time error, in case of any server error. We request to use this flag only locally when using transactions. [code=fw:23c2c79z]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">lShowErrors</span> := .t. <span style="color: #B900B9;">// global setting</span><br />oCn:<span style="color: #000000;">lThrowError</span> := .t. <span style="color: #B900B9;">// local setting</span><br /><span style="color: #00C800;">TRY</span><br />   oCn:<span style="color: #000000;">BeginTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> each cSql in <span style="color: #000000;">&#123;</span> cSql1, cSql2, ... cSqlN <span style="color: #000000;">&#125;</span><br />      oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cSql <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span><br />   oCn:<span style="color: #000000;">CommitTransaction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />CATCH<br />   oCn:<span style="color: #000000;">RollBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END<br />oCn:<span style="color: #000000;">lThrowError</span> := .f.<br /> </div>[/code:23c2c79z] May I know your FWH version?
Clase Nativa MySql
Muchas gracias Mr. Rao. Mi version la acabo de actualizar la semana pasada por la ultima Compiler version: Harbour 3.2.0dev (r2008190002) FiveWin version: FWH 21.11 C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Clase Nativa MySql
Then, your present TRY/CATCH constructs should continue to work, when enclosed between oCn:lThrowError := .t. and .f. like this. [code=fw:deqy76uk]<div class="fw" id="{CB}" style="font-family: monospace;">oCn:<span style="color: #000000;">lThrowError</span> := .t.<br />YOUR PRESENT <span style="color: #00C800;">TRY</span>/CATCH CODE<br />oCn:<span style="color: #000000;">lThrowError</span> := .f.</div>[/code:deqy76uk]
Clase Nativa MySql
Excelente Mr. Rao... Eso me evita bastante cambios en mis codigos existentes... Muchas gracias!
Clase Nativa MySql
esto no esta funcionando, no revienta el error en el catch... (maria16.prg modificado) [code=fw:1911x5lf]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// parent and 2 childs</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oCn, o<br />   <span style="color: #00C800;">local</span> oRsState, oRsCity, oRsCust<br />   <span style="color: #00C800;">local</span> oBrwState, oBrwCity, oBrwCust<br />   <span style="color: #00C800;">local</span> oDlg, oFont<br /><br />   oCn   := FW_DemoDB<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">//oCn:lShowErrors   := .t.</span><br />   <br />   MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Reading tables"</span>, <span style="color: #ff0000;">"Please Wait..."</span>, ;<br />   <||<br />      oCn:<span style="color: #000000;">lThrowError</span> := .t.<br />      <span style="color: #00C800;">try</span><br />        oRsState := oCn:<span style="color: #000000;">RowSet</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT * FROM states ORDER BY name"</span> <span style="color: #000000;">&#41;</span><br />        oRsCity  := oCn:<span style="color: #000000;">RowSet</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT id, state, city FROM customer ORDER BY state, city"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//es customers</span><br />        oRsCust  := oCn:<span style="color: #000000;">RowSet</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT id, state, CONCAT_WS( ', ', first, last ) AS Name FROM customers ORDER by state,Name"</span> <span style="color: #000000;">&#41;</span><br />      catch o<br />         ?o:<span style="color: #000000;">Description</span><br />         <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />      end<br />      oCn:<span style="color: #000000;">lThrowError</span> := .f.<br />      oRsCity:<span style="color: #000000;">SetFilter</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"STATE = ?"</span>, <span style="color: #000000;">&#123;</span> oRsState:<span style="color: #000000;">code</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      oRsCust:<span style="color: #000000;">SetFilter</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"STATE = ?"</span>, <span style="color: #000000;">&#123;</span> oRsState:<span style="color: #000000;">code</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>      <br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   > <span style="color: #000000;">&#41;</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;">-10</span> PTS<br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"MARIADB - PARENT WITH TWO CHILD TABLES"</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrwState <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg DATASOURCE oRsState ;<br />      COLUMNS <span style="color: #ff0000;">"NAME"</span>,<span style="color: #ff0000;">"CODE"</span> CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrwState<br />      :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PARENT"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">nStretchCol</span>   := <span style="color: #000000;">1</span><br />      :<span style="color: #000000;">lHScroll</span>      := .f.<br />      :<span style="color: #000000;">bChange</span>       := <||<br />                        oRsCity:<span style="color: #000000;">ReFilter</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> oRsState:<span style="color: #000000;">code</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                        oRsCust:<span style="color: #000000;">ReFilter</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> oRsState:<span style="color: #000000;">code</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                        oBrwCity:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                        oBrwCust:<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 />                        ><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">XBROWSE</span> oBrwCity <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg DATASOURCE oRsCity ;<br />      COLUMNS <span style="color: #ff0000;">"STATE"</span>,<span style="color: #ff0000;">"CITY"</span> CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrwCity<br />      :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CHILD-1"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">nStretchCol</span>   := <span style="color: #000000;">2</span><br />      :<span style="color: #000000;">lHScroll</span>      := .f.<br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   @ <span style="color: #000000;">280</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">XBROWSE</span> oBrwCust <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg DATASOURCE oRsCust ;<br />      COLUMNS <span style="color: #ff0000;">"STATE"</span>,<span style="color: #ff0000;">"NAME"</span> CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrwCust<br />      :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CHILD-2"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">nStretchCol</span>   := <span style="color: #000000;">2</span><br />      :<span style="color: #000000;">lHScroll</span>      := .f.<br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   oCn:<span style="color: #000000;">Close</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 /> </div>[/code:1911x5lf]
Clase Nativa MySql
Rao, es necesario implementarlo en los RowSet, Query, por ejemplo usar el ejemplo maria16.prg original, y da error en el oRsCity:setfilter dado que oRsCity es nil, ya que fallo el RecSet.
Clase Nativa MySql
[quote:1mci9bb3]* New: FWMARIADB: New DATA lThrowError INIT .f. If set to .T., any failed DML (INSERT,UPDATE,REPLACE,DELETE) operation will raise a runtime error. This applies to execution of any DML statements with method Execute() or using methods Insert(...), Upsert(...) and Update(...) This us provided to faclititate grouping of several DML statements/ methods inside TRY/CATCH block for Transactions. Example Usage: // -------- local lError := .f. oCn:BeginTransaction() oCn:lThrowError := .t. TRY oCn:Insert(....) oCn:Update(...) oCn:Execute( "INSERT ... " ) ... CATCH lError := .t. END oCn:lThrowError := .f. if lError oCn:RollBack() else oCn:CommitTransaction() endif // --------[/quote:1mci9bb3] no esta funcionando..., dont work
Clase PDF propia de fivewin
Buenos Días amigos del foro, he estado buscando una clase o alguna forma de crear archivos en pdf por medio de programa pero sin buenos resultados, si alguien sabe de algo que se pueda implementar directamente en la programación se los voy a agradecer. FWH64_11.08 BCC582
Clase PDF propia de fivewin
Se puede usar PDFLIB.LIB by xHarbour. [code=fw:t4ou7qnf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> criapdf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cMyRun, oPdf<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//-> &nbsp;Crear la carpeta: c:\pdf para grabar</span><br />&nbsp; &nbsp;opdf := tpdf<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: #ff0000;">'c:<span style="color: #000000;">\p</span>df<span style="color: #000000;">\m</span>eupdf.pdf'</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">Pdfnewpage</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"A4"</span>,<span style="color: #ff0000;">"P"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">Pdfatsay</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"HOLA MUNDO!!!!!!!!!!!"</span>,<span style="color: #000000;">800</span>,<span style="color: #000000;">10</span>,.t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">Pdfclosepage</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">pdfclose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Adobe debe estar instalado</span><br />&nbsp; &nbsp;cMyRun := <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"C:<span style="color: #000000;">\P</span>DF<span style="color: #000000;">\M</span>EUPDF.PDF"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;MYRUN<span style="color: #000000;">&#40;</span> cMyRun <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> .t.<br /><br /><br /><span style="color: #00C800;">function</span> filesize<span style="color: #000000;">&#40;</span>cfile<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nfiles := directory<span style="color: #000000;">&#40;</span>cfile<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> nfiles<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br /><br /><br /><span style="color: #00C800;">Function</span> MYRUN<span style="color: #000000;">&#40;</span> cComando <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;***************************<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oShell, RET, lOk:=.T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; #IFDEF __XHARBOUR__<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oShell := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"WScript.Shell"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; #ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oShell := Win_OleCreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"WScript.Shell"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; #ENDIF<br /><br />&nbsp; &nbsp;CATCH<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#IFDEF __XHARBOUR__<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oShell := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"WScript.Shell"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oShell := Win_OleCreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"WScript.Shell"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#ENDIF<br /><br />&nbsp; &nbsp; &nbsp; CATCH<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lOk:=.F.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lOk<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//.F. = Nao espera a aplicacao fechar, .T. espera.</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oShell:<span style="color: #000000;">Run</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"%comspec% /c "</span> + cComando, <span style="color: #000000;">0</span>, .T. <span style="color: #000000;">&#41;</span> <br /><br />&nbsp; &nbsp; &nbsp; CATCH<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOk:=.F.<br /><br />&nbsp; &nbsp; &nbsp; END<br /><br />&nbsp; &nbsp; &nbsp; oShell := <span style="color: #00C800;">NIL</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//-- &nbsp; RET := oShell:Run( "%comspec% /c " + cComando, 0) &nbsp;//, .T. )</span><br /><br /><span style="color: #00C800;">RETURN</span> lOk<br />&nbsp;</div>[/code:t4ou7qnf] 
Clase PDF propia de fivewin
Lo pruebo y te comento y muchas gracias por responder.
Clase PDF propia de fivewin
Hola karinha: Des afortunadamente no he podido echar a andar el ejemplo que me mandaste, me marca este error al compilar: _HB_FUN___CLSACTIVE
Clase PDF propia de fivewin
Pareciera que tienes algun .obj compilado con xHarbour. Mi recomendacion es que re-montes completamente la aplicacion. saludos
Clase PDF propia de fivewin
[url:3s7fcz8k]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=21745&start=0[/url:3s7fcz8k] [url:3s7fcz8k]https&#58;//code&#46;google&#46;com/p/fivewin-contributions/downloads/detail?name=TPDF&#46;zip&can=2&q=[/url:3s7fcz8k] By Surgom [url:3s7fcz8k]https&#58;//app&#46;box&#46;com/shared/qfbeha7cb7[/url:3s7fcz8k] Prueba de TEST.PRG by Surgom: [img:3s7fcz8k]http&#58;//i&#46;imgur&#46;com/conA6ZP&#46;png[/img:3s7fcz8k] Saludos.
Clase PDF propia de fivewin
[code=fw:34grth4z]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"PdfHbDoc.ch"</span><br /><br /><span style="color: #00C800;">Static</span> oWnd, n<br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oMenu<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"My First Pdf"</span> <span style="color: #0000ff;">ACTION</span> creapdfcc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">function</span> creapdfcc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> dresult <span style="color: #B900B9;">// := &nbsp;DEHASTA()</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cImpdos<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oprn<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nsaldo := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nvalor := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> z := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPath := <span style="color: #ff0000;">"C:<span style="color: #000000;">\P</span>DF<span style="color: #000000;">\M</span>EUPDF.pdf"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPdf<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> ntotal := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;n &nbsp;:= <span style="color: #000000;">2.9</span><br /><br />&nbsp; &nbsp;opdf := tpdf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span>cPath<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">Pdfnewpage</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"A4"</span>,<span style="color: #ff0000;">"P"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">Pdfimage</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">".<span style="color: #000000;">\Q</span>RCODE.jpg"</span>, cm2dpi<span style="color: #000000;">&#40;</span><span style="color: #000000;">2.5</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>,<span style="color: #000000;">85</span>,<span style="color: #000000;">66</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">Pdfatsay</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"QUÍMICA MEGA SA"</span>,cm2dpi<span style="color: #000000;">&#40;</span> .<span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">100</span>,.T.<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oPdf:<span style="color: #000000;">Pdfatsay</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Matanza 1456/58"</span>,cm2dpi<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1.2</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">100</span>,.T.<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oPdf:<span style="color: #000000;">Pdfatsay</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Avellaneda-Pcia Bs As"</span>,cm2dpi<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1.6</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">100</span>,.T.<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oPdf:<span style="color: #000000;">Pdfatsay</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"T.E.: 4289-2700(Rotativas)"</span>,cm2dpi<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2.0</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">100</span>,.T.<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oPdf:<span style="color: #000000;">Pdfatsay</span><span style="color: #000000;">&#40;</span>replicate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"_"</span>,<span style="color: #000000;">115</span><span style="color: #000000;">&#41;</span>,cm2dpi<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2.5</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">10</span>,.T.<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">Pdfclosepage</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;opdf:<span style="color: #000000;">pdfclose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Archivo creado con éxito"</span>,<span style="color: #ff0000;">"Aviso del sistema"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp;if !empty(cmail)<br />&nbsp; &nbsp; &nbsp; correo(cMail,,("Enviamos resumen de cuenta desde " + transform(dresult[1],"@d") + " hasta " + &nbsp;transform(dresult[1],"@d") ),"Resumen de cuenta", alltrim(cPath ) )<br />&nbsp; &nbsp;endif<br />&nbsp; &nbsp;*/</span><br /><br />&nbsp; &nbsp;ShellExecute<span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">hWnd</span>, <span style="color: #ff0000;">"open"</span>, <span style="color: #ff0000;">"c:<span style="color: #000000;">\p</span>df<span style="color: #000000;">\m</span>eupdf.pdf"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> .t.<br /><br /><span style="color: #B900B9;">/*******************************************************************************/</span><br /><br /><span style="color: #00C800;">function</span> cm2dpi<span style="color: #000000;">&#40;</span> nCM, <span style="color: #0000ff;">page</span>, lHeight <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nHeight,nDpi := <span style="color: #000000;">72</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nRes <br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> empty<span style="color: #000000;">&#40;</span> lHeight <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lHeight := .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lHeight<br />&nbsp; &nbsp; &nbsp; nHeight := <span style="color: #000000;">842.0</span><br />&nbsp; &nbsp; &nbsp; nRes := nHeight - <span style="color: #000000;">&#40;</span> nCM * nDpi / <span style="color: #000000;">2.54</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; nRes := <span style="color: #000000;">&#40;</span> nCM * nDpi / <span style="color: #000000;">2.54</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> nRes<br />&nbsp;</div>[/code:34grth4z]  [img:34grth4z]http&#58;//i&#46;imgur&#46;com/IN1aGO8&#46;png[/img:34grth4z] saludos.
Clase PreView no compatible con Temas Visuales de XP ???
Antonio, despues de varios dias probando, quitando, poniendo, etc. He descubierto que si le quito a la App el look XP, ya no me cierra y sigue todo trabajando OK, lo activo y empiezan los problemas..... Este es el contenido de mi archivo, por si tiene algo raro o erroneo : <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity name="MiniGUI" processorArchitecture="x86" version="5.1.0.0" type="win32"/> <description>Windows Shell</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly> Saludos a todos
Clase PreView no compatible con Temas Visuales de XP ???
Ray, Usa el que proporcionamos en samples\winxp
Clase PreView no compatible con Temas Visuales de XP ???
Ya lo hice Antonio, con resultados identicos : Lo activo, hay problemas, lo desactivo, se van, pero queda la apariencia de la App, pues.... simplemente simplona <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> Saludos
Clase PreView no compatible con Temas Visuales de XP ???
Prueba los siguiente: Comenta la linea en el archivo rc [code:hqlnv557] //1 24 "winxp&#46;man" [/code:hqlnv557] luego, en el directorio de tu aplicación, toma el archivo winxp.man y renombralo a: [code:hqlnv557] nombredemiaplicacion&#46;exe&#46;manifest [/code:hqlnv557] si tu app se llama ray.exe, renombra el archivo manifest a [code:hqlnv557] ray&#46;exe&#46;manifest [/code:hqlnv557] cuando el programa finaliza, te crea un archivo error.log? otra situacion se da cuando usas la libreria tsbrowse, esa libreria usa un preview.prg y un metafil.prg modificado, ademas de ser versiones algo antiguas. el caso es que normalmente nosotros agregamos esas tsbrowse.lib antes de las lib de fwh por lo que estariamos usando esas clases antiguas y no las nuevas. de ser asi lo adecuado es extraer los modulos antiguos de la lib tsbwrowse para evitar usarlos [code:hqlnv557] tlib tsbrowse&#46;lib *-rpreview&#46;obj *-tmetafil&#46;obj [/code:hqlnv557] salu2 carlos vargas
Clase PreView no compatible con Temas Visuales de XP ???
WWOOOOWWW !!!!!!!! <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> Carlos, eres un genio !!!! Ya no me cerro la App, hay algunos detalles en algunas pantallas, pero creo que seran faciles de arreglar. Gracias amigo, te veo por privado mañana lunes <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
Clase PreView no compatible con Temas Visuales de XP ???
Gracias Carlos, a mi tambien me fue muy util. Cesar
Clase PreView no compatible con Temas Visuales de XP ???
de nada <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> salu2 carlos vargas
Clase Printer [ Liberar memoria ]
Buen día Estoy usando la versión FWH64.1311 El problema que tengo es con la clase TPrinter, al crear cualquier reporte, la clase no libera la memoria utilizada. Algún tip que puedan compartir ? Saludos
Clase Printer [ Liberar memoria ]
Cual és lá version del windows e la memória disponilbe? En windows de 64 bits, el mejor, és que se use 8 Gbs de Ram. Saludos.
Clase Printer [ Liberar memoria ]
Vikthor, Estás usando algún PEN ó algún FONT que finalmente no liberes ? Usando SetResCheck() puedes comprobar que objetos GDI no han sido liberados: [url:3996wlwl]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_function_setresdebug[/url:3996wlwl] Si se trata de memoria de Harbour no liberada, prueba a llamar a hb_gcAll()
Clase Printer [ Liberar memoria ]
Antonio El método BuildListView() de la clase TPrview es el causante del consumo de memoria. Al cargar las imágenes en TImageList() del arreglo ::oDevice:aMeta Saludos
Clase Printer [ Liberar memoria ]
Vikthor, Me suena que eso ya se arregló en su momento. Puedes proporcionar un ejemplo simple para probarlo ? gracias
Clase QT
Antonio Saludos cordiales Sera posible linkar esta clase, veo que incorpora valores de Entorno QT, ejemplo: Colores. <!-- m --><a class="postlink" href="http://doc.qt.io/qt-4.8/qt.html">http://doc.qt.io/qt-4.8/qt.html</a><!-- m -->
Clase QT
Juan, Lo acabo de intentar pero parece que no está implementada en la capa QT para Harbour. Habría que comentarlo con Pritpal Bedi. Voy a ver si le localizo.
Clase QT
Hi Jumping in... QT is not a class as other classes and is callable on C++ level only. This namespace only defines the ENUMS in C++ and #defines in Harbour. QtContribs contain all the defines in hbqt/qtgui/hbqtgui.ch header file. Just include it as oyou normally do. Contstants in hbqtgui.ch are defined like this : QT Harbour Qt::white Qt_white Only "::" has been replaced with "_". It would be nice if you post your queries ( in English only ) at <!-- m --><a class="postlink" href="https://groups.google.com/forum/?fromgroups#!forum/qtcontribs">https://groups.google.com/forum/?fromgr ... qtcontribs</a><!-- m --> (a dedicated newsgroup for HbQt related questions) I am here because Antonio pointed this out to me so it is not possible for me to reach to this forum anyway. Pritpal Bedi a student of software analysis & concepts
Clase QT
Pritpal, thanks! As you all may know, thanks to Pritpal we have QT support in Harbour and he is the best expert about QT and Harbour
Clase QT
Antonio Gracias, se que le ha puesto mucho trabajo con este excelente producto. He visto que son definciiones que posiblemente se puedan remplazar con un #include, ejemplo el tema de los colores. No he podido implementar los colores en QT.
Clase REPEXCEL
Hola, He descobierto un pequeño bug en el TSalXls en el momento de imprimir los headers de Groups en el archivo XLS. Ahi va la nueva versión. <!-- m --><a class="postlink" href="http://hyperupload.com/download/022a95eb63/REPEXCEL.rar.html">http://hyperupload.com/download/022a95e ... L.rar.html</a><!-- m --> Saludos,
Clase REPEXCEL
Hola a los amigos del foro!!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Pongo a vuestra disposición [u:71uyxija][b:71uyxija]la última versión de la clase RepExcel[/b:71uyxija][/u:71uyxija]. Gracias <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> a : [b:71uyxija]Renomas[/b:71uyxija], autor de la clase, [b:71uyxija][u:71uyxija]a Antonio Linares quien una vez más me ha autorizado a publicarla incluyendo archivos pertenecientes a FWH 6.12 con las modificaciones necesarias.[/u:71uyxija][/b:71uyxija] y a [b:71uyxija]Kleyber Derick[/b:71uyxija], por su modificación en la generacion de grupos en la planilla. Ahora, con las nuevas modificaciones que he hecho, no existe diferencia en el preview de esta clase y el de FWH, los menúes y botones, así como la presentación de los números de página son idénticos, de manera que los usuarios no notarán NINGUNA DIFERENCIA, entre el uso de la clase TReport de FWH y la RepExcel con el pasaje de los reportes a planillas excel, aquellos que utilizan versiones recientes notarán el incremento en la rapidez de generación de la excel por la optimización de la clase TReport. Pueden Bajarla del siguiente LINK: <!-- m --><a class="postlink" href="http://hyperupload.com/download/027ca04378/RepExcel.exe.html">http://hyperupload.com/download/027ca04 ... l.exe.html</a><!-- m --> QUE LA DISFRUTEN!!! <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
Clase REPEXCEL
Hola. ¿se puede mandar un reporte directamente a excel sin un usar preview\guardar como? Saludos. Jose rios.
Clase REPEXCEL
[quote="José Ríos":2k0rstx6]Hola. ¿se puede mandar un reporte directamente a excel sin un usar preview\guardar como? Saludos. Jose rios.[/quote:2k0rstx6] Si la pregunta es si se puede con Repexcel imprimir a excel sin preview, la respuesta es no, la clase no lo contempla actualmente. Lo que si se puede es generar una excel con FileXls directamente, puedes ver en la clase (aquí en el foro) varios ejemplos.
Clase REPEXCEL
Hola. Muchas gracias por tu respuesta. Saludos. Jose Rios
Clase REPEXCEL
Alguien me puede decir de donde puedo bajar la clase REPEXCEL ya que el enlace no me esta funcionando Gracias
Clase REPEXCEL
[quote="BenD":32ecyf8b]Alguien me puede decir de donde puedo bajar la clase REPEXCEL ya que el enlace no me esta funcionando Gracias[/quote:32ecyf8b] En este link hallarás varias clases y entre ellas RepExcel. <!-- m --><a class="postlink" href="http://www.box.net/shared/lck9effuyn">http://www.box.net/shared/lck9effuyn</a><!-- m -->
Clase RMChart
Algun compañero que tenga la clase RmChart y los wrappers por favor envienmela a <!-- e --><a href="mailto:georgeabinader@msn.com">georgeabinader@msn.com</a><!-- e --> Gracias George
Clase RMChart
George, just sent to you Stefan
Clase RMChart
Stefan I just recieved, thanks George
Clase RMChartX
Alguien tiene el código de la clase que maneja RMChartX para HARBOUR (Yo lo tengo para xHarbour). Si así fuera y lo pudiera compartir quedaría muy agradecido, ya que me estoy pasando a Harbour y no puedo hacer andar esta clase.
Clase RMChartX
[url:1p2wtkcv]http&#58;//www&#46;pctoledo&#46;com&#46;br/forum/viewtopic&#46;php?f=4&t=17133&start=30[/url:1p2wtkcv] [url:1p2wtkcv]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?p=52512[/url:1p2wtkcv]
Clase Report ?
Hola Como puedo saber el número de filas que puedo imprimir en una página ? Un saludo y gracias
Clase Report ?
No es posible saberlo de antemano, el objeto REPORT va imprimiendo linea por linea, calculando al mismo tiempo el espacio que le queda para imprimir, tomando en cuenta el tamaño de la hoja en base a los datos que le devuelve el driver. Por partes. El objeto REPORT en realidad es un objeto PRINTER inteligente, que realiza los cálculos de tamaño y espacio de manera automatica. Para que PRINTER pueda imprimir, valga la redundancia, necesita información del driver de la impresora sobre la cual va a imprimir, esta informacion es por ejemplo la resolucion, el tamaño de la hoja los margenes de la misma, etc. En base a esa informacion, el objeto PRINTER sabe que area efectiva de impresion tiene. REPORT es otra historia, porque basado en las metricas devueltas por Printer, REPORT imprime primero cabeceras, titulos y pies de pagina, luego calcula el espacio disponible para el cuerpo y procede a imprimir linea por linea contado la longitud que lleva impresa en base a la fuente sobre la cual está definido el reporte. Te comento que no puedes saber cuantas lineas vas a poder imprimir, porque de ante mano cada impresora tiene resolucion distinta, con lo cual, quiza puedas imprimir tal cantidad de lineas en una impresora, pero en otra puedes imprimir mas o menos lineas, dependiendo de la resolucion. Tampoco puedes saber cuantas lineas hay, porque algunas impresoras manejan "margenes" predefinidos dentro del driver, con lo cual, a menos que manualmente anules los drivers (con la funcion PrinterSetup() ) tampoco puedes saber que tamaño real de impresion va a tener tu hoja.
Clase Report ?
Gracias Rene Un saludo Gabriel
Clase Report modificada por RenOmaS
Holas, estoy utilizando la clase report modificada por RenOmaS para poder pasar los reportes a Excel. El problema esta que con esta clase no se puede visualizar las lineas cuando se difine le reporte con oReport:cellView(), a simple vista todo parece estar correcto, pero al previsualizar el reporte, no aparece el cuadriculado que deberia. Alguien tiene el mismo problema? y si tiene la solucion aun mejor. saludos Marcelo
Clase Report modificada por RenOmaS
Estas seguro... oReport:CellView() tienes que ejecutarlo despues de haber definidos las columnas del reporte, siempre ha funcionado asi.. al menos en la version que tengo...que es un poco antigua Salu2 <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->
Clase Report modificada por RenOmaS
Hola, (gracias por responder) si, no me sale el grid, tan solo el contorno y no las lineas horizontales de division de cada linea. Mira tu codigo es completemente claro, y no estas tocando el codigo de la clase original me parece muy raro, sera que puedes enviarme tus clases para probarlas (report y mreport) (via at dicyt.umss.edu.bo) Desde ya muchas gracias un saludo Marcelo
Clase Report modificada por RenOmaS
La que utilizo. es la que esta en utilidades (en este foro), es la que posteo Jose M. salu2 <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->
Clase Report modificada por RenOmaS
Holas, la solucion para el problema del cellview, va reemplazando el metodo startline de la clase TMReport [quote:2xppfa7p] METHOD StartLine( nHeight, lSeparator ) CLASS TMReport If ::lSalida ::oSalida:StartLine( nHeight ) Else Super:StartLine( nHeight, lSeparator ) EndIf Return NIL [/quote:2xppfa7p] saludos Marcelo
Clase Report modificada por RenOmaS
Marcelo, Puedes enviarme esta clase hacia <!-- e --><a href="mailto:jnavas@datapronet.com">jnavas@datapronet.com</a><!-- e --> [quote="Marcelo Via Giglio":202hrj49]Holas, la solucion para el problema del cellview, va reemplazando el metodo startline de la clase TMReport [quote:202hrj49] METHOD StartLine( nHeight, lSeparator ) CLASS TMReport If ::lSalida ::oSalida:StartLine( nHeight ) Else Super:StartLine( nHeight, lSeparator ) EndIf Return NIL [/quote:202hrj49] saludos Marcelo[/quote:202hrj49]
Clase Report y FwhMariaDb
Colegas, tengo un reporte realizado con FwhMariaDb y lo parametricé de la siguiente manera [code=fw:14eastnj]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRpt : <span style="color: #000000;">bSkip</span>  := <span style="color: #000000;">&#123;</span> || oRs : <span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><span style="color: #0000ff;">Activate</span> Report oRpt    <span style="color: #00C800;">While</span> <span style="color: #000000;">&#40;</span> !oRs : <span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>  <br /> </div>[/code:14eastnj] Cuando ejecuto el reporte la consulta nunca llega al final. Si bien me lista los registros, una vez terminado de listar me genera un sin fin de páginas en blanco y no termina nunca el proceso, debo cancelarlo. Me falta algo mas en la configuración ? Muchísimas gracias. Saludos
Clase Report y FwhMariaDb
Algo asi: REPORT oPrn ..... ... ... .. oRpt:bSkip := {|| oRs:Skip(), SYSREFRESH() } END REPORT ACTIVATE REPORT oRpt WHILE !oRs:EOF()
Clase Report y FwhMariaDb
Gracias Willy por tu sugerencia pero tampoco funciona. Posteo una imagen del problema [img:1hyk80uu]http&#58;//i65&#46;tinypic&#46;com/2mrtsia&#46;jpg[/img:1hyk80uu] Saludos
Clase Report y FwhMariaDb
[url:21omcr51]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=19685&p=111915&hilit=ACTIVATE+REPORT+oRpt#p111915[/url:21omcr51]
Clase Report y FwhMariaDb
Gracias Joao por el post. Pude solucionarlo con la sugerencia de Ramón. Saludos
Clase Report y FwhMariaDb
[code=fw:2asdllfx]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> lEof := .f.<br /><br />REPORT oRep PREVIEW<br /><br /><columns><br />oRep:<span style="color: #000000;">bSkip</span> &nbsp;:= <span style="color: #000000;">&#123;</span> |n| lEof := <span style="color: #000000;">&#40;</span> oRs:<span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> != n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />ENDREPORT<br /><br /><span style="color: #0000ff;">ACTIVATE</span> REPORT oRep <span style="color: #00C800;">WHILE</span> !lEof<br />&nbsp;</div>[/code:2asdllfx]
Clase TActiveX mejorada y RibbonBar más fácil
Gracias a las pruebas que estamos haciendo estos dias con el RibbonBar de CodeJock, hemos mejorado la Clase TActiveX para que automaticamente use objetos TOleAuto en los eventos, por lo que el uso del RibbonBar es mucho más simple y fácil <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Aqui teneis un ejemplo de uso. Fijaros en la forma en que oControl se obtiene desde RibbonBarEvent(): [code=fw:2x0efj1d]<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> xtpControlButton &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span><br /><br /><span style="color: #00D7D7;">#define</span> xtpFlagRightAlign &nbsp; &nbsp; <span style="color: #000000;">1</span><br /><br /><span style="color: #00D7D7;">#define</span> ID_ADDTAB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">10</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDGROUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">20</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDBUTTON &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">30</span><br /><br /><span style="color: #00C800;">static</span> oRb<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oAct, oMenu, oTabs, oGroups, oControls<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Visual RibbonBar"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> ACTIVEX oAct PROGID <span style="color: #ff0000;">"Codejock.CommandBarsFrame.12.1.1"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;oAct:<span style="color: #000000;">bOnEvent</span> = <span style="color: #000000;">&#123;</span> | cEvent, aParams | RibbonBarEvent<span style="color: #000000;">&#40;</span> cEvent, aParams <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AttachToWindow"</span>, oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oRb = oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AddRibbonBar"</span>, <span style="color: #ff0000;">"fwh"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oMenu = oRb:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Menu"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oMenu:<span style="color: #000000;">Flags</span> = xtpFlagRightAlign<br /><br />&nbsp; &nbsp;oTabs = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Tabs"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oTabs:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDTAB, <span style="color: #ff0000;">"Add"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oGroups = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Groups"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oGroups:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDGROUP, <span style="color: #ff0000;">"Add"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oControls = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Controls"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oControls:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDBUTTON, <span style="color: #ff0000;">"Add Button"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> RibbonBarEvent<span style="color: #000000;">&#40;</span> cEvent, aParams <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oControl, oTab, oGroup, oItem <br /><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> cEvent == <span style="color: #ff0000;">"Execute"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl = aParams<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDTAB<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl = oRb:<span style="color: #000000;">InsertTab</span><span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Tab "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl:<span style="color: #0000ff;">Id</span> = oRb:<span style="color: #000000;">TabCount</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl:<span style="color: #000000;">Selected</span> = .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDGROUP<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">TabCount</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGroup = oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">AddGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Group "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDBUTTON<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGroup = oRb:<span style="color: #000000;">FindGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oItem = oGroup:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> xtpControlButton, <span style="color: #000000;">1</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oItem:<span style="color: #000000;">Caption</span> = <span style="color: #ff0000;">"Button "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oGroup:<span style="color: #0000ff;">Count</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">otherwise</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endcase</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">endcase</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;</div>[/code:2x0efj1d]
Clase TActiveX mejorada y RibbonBar más fácil
Dinamicamente inspeccionando los controles del RibbonBar: [img:2aig2dk9]http&#58;//img518&#46;imageshack&#46;us/img518/467/22476131&#46;png[/img:2aig2dk9] RibonBar.prg [code=fw:2aig2dk9]<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> xtpControlButton &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span><br /><br /><span style="color: #00D7D7;">#define</span> xtpFlagRightAlign &nbsp; &nbsp; <span style="color: #000000;">1</span><br /><br /><span style="color: #00D7D7;">#define</span> ID_ADDTAB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">10</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDGROUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">20</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDBUTTON &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">30</span><br /><br /><span style="color: #00C800;">static</span> oRb<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oAct, oMenu, oTabs, oGroups, oControls<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Visual RibbonBar"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> ACTIVEX oAct PROGID <span style="color: #ff0000;">"Codejock.CommandBarsFrame.12.1.1"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;oAct:<span style="color: #000000;">bOnEvent</span> = <span style="color: #000000;">&#123;</span> | cEvent, aParams | RibbonBarEvent<span style="color: #000000;">&#40;</span> cEvent, aParams <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AttachToWindow"</span>, oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oRb = oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AddRibbonBar"</span>, <span style="color: #ff0000;">"fwh"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oMenu = oRb:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Menu"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oMenu:<span style="color: #000000;">Flags</span> = xtpFlagRightAlign<br /><br />&nbsp; &nbsp;oTabs = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Tabs"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oTabs:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDTAB, <span style="color: #ff0000;">"Add"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oGroups = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Groups"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oGroups:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDGROUP, <span style="color: #ff0000;">"Add"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oControls = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Controls"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oControls:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDBUTTON, <span style="color: #ff0000;">"Add Button"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> RibbonBarEvent<span style="color: #000000;">&#40;</span> cEvent, aParams <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oControl, oTab, oGroup, oItem <br /><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> cEvent == <span style="color: #ff0000;">"Execute"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl = aParams<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDTAB<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl = oRb:<span style="color: #000000;">InsertTab</span><span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Tab "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl:<span style="color: #0000ff;">Id</span> = oRb:<span style="color: #000000;">TabCount</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl:<span style="color: #000000;">Selected</span> = .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDGROUP<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">TabCount</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">AddGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Group "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDBUTTON<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">TabCount</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oControl = oRb:<span style="color: #000000;">InsertTab</span><span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Tab "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oControl:<span style="color: #0000ff;">Id</span> = oRb:<span style="color: #000000;">TabCount</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oControl:<span style="color: #000000;">Selected</span> = .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">AddGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Group "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGroup = oRb:<span style="color: #000000;">FindGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oItem = oGroup:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> xtpControlButton, <span style="color: #000000;">1</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oItem:<span style="color: #000000;">Caption</span> = <span style="color: #ff0000;">"Button "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oGroup:<span style="color: #0000ff;">Count</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">otherwise</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ControlInspect<span style="color: #000000;">&#40;</span> oControl <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endcase</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">endcase</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; &nbsp; <br /><br /><span style="color: #00C800;">function</span> ControlInspect<span style="color: #000000;">&#40;</span> oControl <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, cCaption := PadR<span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Control Properties"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">300</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">0.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Caption:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">1</span>, &nbsp;<span style="color: #000000;">4</span> &nbsp;<span style="color: #0000ff;">GET</span> cCaption <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span> := AllTrim<span style="color: #000000;">&#40;</span> cCaption <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">1.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Width:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">2.2</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">GET</span> oControl:<span style="color: #000000;">Width</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">1.9</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Height:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">2.2</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">GET</span> oControl:<span style="color: #000000;">Height</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span><br />&nbsp; &nbsp;<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;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;</div>[/code:2aig2dk9]
Clase TActiveX mejorada y RibbonBar más fácil
Una Clase TActiveX modificada y ampliada es necesaria para estos ejemplos. Esta Clase la incluiremos en FWH 9.04. Posiblemente publiquemos ya una versión preliminar de FWH 9.04 con estos cambios, para que podais empezar a usarlos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Clase TActiveX mejorada y RibbonBar más fácil
[img:2w2mkpu5]http&#58;//img5&#46;imageshack&#46;us/img5/8151/27850001&#46;png[/img:2w2mkpu5] [img:2w2mkpu5]http&#58;//img5&#46;imageshack&#46;us/img5/9058/20513256&#46;png[/img:2w2mkpu5] [code=fw:2w2mkpu5]<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> xtpControlButton      <span style="color: #000000;">1</span><br /><br /><span style="color: #00D7D7;">#define</span> xtpFlagRightAlign     <span style="color: #000000;">1</span><br /><br /><span style="color: #00D7D7;">#define</span> xtpImageNormal        <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> xtpImageDisabled      <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> xtpImageHot           <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> xtpImageChecked       <span style="color: #000000;">3</span><br /><span style="color: #00D7D7;">#define</span> xtpImagePressed       <span style="color: #000000;">4</span><br /><br /><span style="color: #00D7D7;">#define</span> ID_ADDTAB            <span style="color: #000000;">10</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDGROUP          <span style="color: #000000;">20</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDBUTTON         <span style="color: #000000;">30</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDIMAGE          <span style="color: #000000;">40</span><br /><br /><span style="color: #00C800;">static</span> oIcons, oRb <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, oAct, oMenu, oTabs, oGroups, oControls, oImages<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;">"Visual RibbonBar"</span><br /><br />   @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> ACTIVEX oAct PROGID <span style="color: #ff0000;">"Codejock.CommandBarsFrame.12.1.1"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><br /><br />   oAct:<span style="color: #000000;">bOnEvent</span> = <span style="color: #000000;">&#123;</span> | cEvent, aParams | RibbonBarEvent<span style="color: #000000;">&#40;</span> cEvent, aParams <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AttachToWindow"</span>, oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br /><br />   oIcons = oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"icons"</span> <span style="color: #000000;">&#41;</span><br /><br />   oRb = oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AddRibbonBar"</span>, <span style="color: #ff0000;">"fwh"</span> <span style="color: #000000;">&#41;</span><br /><br />   oMenu = oRb:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Menu"</span> <span style="color: #000000;">&#41;</span><br />   oMenu:<span style="color: #000000;">Flags</span> = xtpFlagRightAlign<br /><br />   oTabs = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Tabs"</span> <span style="color: #000000;">&#41;</span><br />   oTabs:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDTAB, <span style="color: #ff0000;">"Add"</span> <span style="color: #000000;">&#41;</span><br /><br />   oGroups = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Groups"</span> <span style="color: #000000;">&#41;</span><br />   oGroups:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDGROUP, <span style="color: #ff0000;">"Add"</span> <span style="color: #000000;">&#41;</span><br /><br />   oControls = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Controls"</span> <span style="color: #000000;">&#41;</span><br />   oControls:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDBUTTON, <span style="color: #ff0000;">"Add Button"</span> <span style="color: #000000;">&#41;</span><br /><br />   oImages = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Images"</span> <span style="color: #000000;">&#41;</span><br />   oImages:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDIMAGE, <span style="color: #ff0000;">"Load Image"</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> RibbonBarEvent<span style="color: #000000;">&#40;</span> cEvent, aParams <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oControl, oTab, oGroup, oItem, cBmpFile <br /><br />   <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />      <span style="color: #00C800;">case</span> cEvent == <span style="color: #ff0000;">"Execute"</span><br />           <br />           oControl = aParams<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />           <br />           <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />              <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDTAB<br />                   oControl = oRb:<span style="color: #000000;">InsertTab</span><span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Tab "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />                   oControl:<span style="color: #0000ff;">Id</span> = oRb:<span style="color: #000000;">TabCount</span><br />                   oControl:<span style="color: #000000;">Selected</span> = .T.<br /><br />              <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDGROUP<br />                   <span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">TabCount</span> > <span style="color: #000000;">0</span><br />                      oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">AddGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Group "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />                                             <span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />                   <span style="color: #00C800;">endif</span>   <br /><br />              <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDBUTTON<br />                   <span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">TabCount</span> == <span style="color: #000000;">0</span><br />                      oControl = oRb:<span style="color: #000000;">InsertTab</span><span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Tab "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />                      oControl:<span style="color: #0000ff;">Id</span> = oRb:<span style="color: #000000;">TabCount</span><br />                      oControl:<span style="color: #000000;">Selected</span> = .T.<br />                   <span style="color: #00C800;">endif</span><br />                   <span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> == <span style="color: #000000;">0</span><br />                      oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">AddGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Group "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />                                             <span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />                   <span style="color: #00C800;">endif</span>   <br />                   <span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> > <span style="color: #000000;">0</span><br />                      oGroup = oRb:<span style="color: #000000;">FindGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> <span style="color: #000000;">&#41;</span><br />                      oItem = oGroup:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> xtpControlButton, <span style="color: #000000;">1</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />                      oItem:<span style="color: #000000;">Caption</span> = <span style="color: #ff0000;">"Button "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oGroup:<span style="color: #0000ff;">Count</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;">case</span> oControl:<span style="color: #0000ff;">Id</span> = ID_ADDIMAGE<br />                   cBmpFile = cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"*.bmp"</span>, <span style="color: #ff0000;">"Please select a BMP file"</span> <span style="color: #000000;">&#41;</span> <br />                   <span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cBmpFile <span style="color: #000000;">&#41;</span><br />                      <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oIcons:<span style="color: #0000ff;">Count</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />                      oIcons:<span style="color: #000000;">LoadBitmap</span><span style="color: #000000;">&#40;</span> cBmpFile, oIcons:<span style="color: #0000ff;">Count</span> + <span style="color: #000000;">1</span>, xtpImageNormal <span style="color: #000000;">&#41;</span><br />                   <span style="color: #00C800;">endif</span>   <br />                   <br />              <span style="color: #00C800;">otherwise</span><br />                   <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span> <span style="color: #000000;">&#41;</span><br />                      ControlInspect<span style="color: #000000;">&#40;</span> oControl <span style="color: #000000;">&#41;</span>     <br />                   <span style="color: #00C800;">endif</span>   <br /><br />           <span style="color: #00C800;">endcase</span>        <br />   <span style="color: #00C800;">endcase</span><br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span>     <br /><br /><span style="color: #00C800;">function</span> ControlInspect<span style="color: #000000;">&#40;</span> oControl <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, cCaption := PadR<span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span>, <span style="color: #000000;">30</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;">TITLE</span> <span style="color: #ff0000;">"Control Properties"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">300</span><br />   <br />   @ <span style="color: #000000;">0.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Caption:"</span><br />   <br />   @ <span style="color: #000000;">1</span>,  <span style="color: #000000;">4</span>  <span style="color: #0000ff;">GET</span> cCaption <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span> := AllTrim<span style="color: #000000;">&#40;</span> cCaption <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br />   <br />   @ <span style="color: #000000;">1.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Width:"</span><br />   <br />   @ <span style="color: #000000;">2.2</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">GET</span> oControl:<span style="color: #000000;">Width</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span><br /><br />   @ <span style="color: #000000;">1.9</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Height:"</span><br />   <br />   @ <span style="color: #000000;">2.2</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">GET</span> oControl:<span style="color: #000000;">Height</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span><br /><br />   @ <span style="color: #000000;">2.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Icon Id:"</span><br />   <br />   @ <span style="color: #000000;">3.4</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">GET</span> oControl:<span style="color: #000000;">IconId</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span><br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span>            <br /> </div>[/code:2w2mkpu5]
Clase TActiveX mejorada y RibbonBar más fácil
Podeis descargar una demo (EXE y OCX) desde aqui: <!-- m --><a class="postlink" href="http://www.mediafire.com/?sharekey=414c17b7b136abb70f83d91f6dff7c38cad9543e5e4099ab5621d66e282a0ee8">http://www.mediafire.com/?sharekey=414c ... 6e282a0ee8</a><!-- m -->
Clase TActiveX mejorada y RibbonBar más fácil
Editando el texto del Tab y del Grupo: [img:1kwqrdft]http&#58;//img165&#46;imageshack&#46;us/img165/7715/capturee&#46;png[/img:1kwqrdft] Podeis descargarlo y probarlo desde aqui: <!-- m --><a class="postlink" href="http://www.mediafire.com/?sharekey=d0453478149576bfe7c82ed4b8f0c380e0ca5f9a04effcccce018c8114394287">http://www.mediafire.com/?sharekey=d045 ... 8114394287</a><!-- m --> [code=fw:1kwqrdft]<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> xtpControlButton &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span><br /><br /><span style="color: #00D7D7;">#define</span> xtpFlagRightAlign &nbsp; &nbsp; <span style="color: #000000;">1</span><br /><br /><span style="color: #00D7D7;">#define</span> xtpImageNormal &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> xtpImageDisabled &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> xtpImageHot &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> xtpImageChecked &nbsp; &nbsp; &nbsp; <span style="color: #000000;">3</span><br /><span style="color: #00D7D7;">#define</span> xtpImagePressed &nbsp; &nbsp; &nbsp; <span style="color: #000000;">4</span><br /><br /><span style="color: #00D7D7;">#define</span> ID_ADDTAB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">10</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDGROUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">20</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDBUTTON &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">30</span><br /><span style="color: #00D7D7;">#define</span> ID_ADDIMAGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">40</span><br /><br /><span style="color: #00C800;">static</span> oIcons, oRb <br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oAct, oMenu, oTabs, oGroups, oControls, oImages<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! IsActiveX<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Codejock.CommandBars.v13.0.0.Demo.ocx"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; RegisterServer<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Codejock.CommandBars.v13.0.0.Demo.ocx"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Visual RibbonBar"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> ACTIVEX oAct PROGID <span style="color: #ff0000;">"Codejock.CommandBarsFrame.13.0.0"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;oAct:<span style="color: #000000;">bOnEvent</span> = <span style="color: #000000;">&#123;</span> | cEvent, aParams | RibbonBarEvent<span style="color: #000000;">&#40;</span> cEvent, aParams <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AttachToWindow"</span>, oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oIcons = oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"icons"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oRb = oAct:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AddRibbonBar"</span>, <span style="color: #ff0000;">"fwh"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oMenu = oRb:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Menu"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oMenu:<span style="color: #000000;">Flags</span> = xtpFlagRightAlign<br /><br />&nbsp; &nbsp;oTabs = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Tabs"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oTabs:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDTAB, <span style="color: #ff0000;">"Add"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oGroups = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Groups"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oGroups:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDGROUP, <span style="color: #ff0000;">"Add"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oControls = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Controls"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oControls:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDBUTTON, <span style="color: #ff0000;">"Add Button"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oImages = oMenu:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Images"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oImages:<span style="color: #000000;">CommandBar</span>:<span style="color: #000000;">Controls</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ID_ADDIMAGE, <span style="color: #ff0000;">"Load Image"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> RibbonBarEvent<span style="color: #000000;">&#40;</span> cEvent, aParams <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oControl, oTab, oGroup, oItem, cBmpFile <br /><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> cEvent == <span style="color: #ff0000;">"Execute"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl = aParams<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDTAB<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl = oRb:<span style="color: #000000;">InsertTab</span><span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Tab "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl:<span style="color: #0000ff;">Id</span> = oRb:<span style="color: #000000;">TabCount</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oControl:<span style="color: #000000;">Selected</span> = .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDGROUP<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">TabCount</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">AddGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Group "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> == ID_ADDBUTTON<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">TabCount</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oControl = oRb:<span style="color: #000000;">InsertTab</span><span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Tab "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">TabCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oControl:<span style="color: #0000ff;">Id</span> = oRb:<span style="color: #000000;">TabCount</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oControl:<span style="color: #000000;">Selected</span> = .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">AddGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Group "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGroup = oRb:<span style="color: #000000;">FindGroup</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #0000ff;">Index</span> * <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> + oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Groups</span>:<span style="color: #000000;">GroupCount</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oItem = oGroup:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> xtpControlButton, <span style="color: #000000;">1</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oItem:<span style="color: #000000;">Caption</span> = <span style="color: #ff0000;">"Button "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oGroup:<span style="color: #0000ff;">Count</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oControl:<span style="color: #0000ff;">Id</span> = ID_ADDIMAGE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cBmpFile = cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"*.bmp"</span>, <span style="color: #ff0000;">"Please select a BMP file"</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cBmpFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oIcons:<span style="color: #0000ff;">Count</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oIcons:<span style="color: #000000;">LoadBitmap</span><span style="color: #000000;">&#40;</span> cBmpFile, oIcons:<span style="color: #0000ff;">Count</span> + <span style="color: #000000;">1</span>, xtpImageNormal <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">otherwise</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ControlInspect<span style="color: #000000;">&#40;</span> oControl <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endcase</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">endcase</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; &nbsp; <br /><br /><span style="color: #00C800;">function</span> ControlInspect<span style="color: #000000;">&#40;</span> oControl <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, cCaption := PadR<span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cTabCaption := PadR<span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Caption</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cGrpCaption := PadR<span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">RibbonGroup</span>:<span style="color: #000000;">Caption</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Control Properties"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">300</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">0.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Caption:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">1</span>, &nbsp;<span style="color: #000000;">4</span> &nbsp;<span style="color: #0000ff;">GET</span> cCaption <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">Caption</span> := AllTrim<span style="color: #000000;">&#40;</span> cCaption <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">1.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Width:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">2.2</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">GET</span> oControl:<span style="color: #000000;">Width</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">1.9</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Height:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">2.2</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">GET</span> oControl:<span style="color: #000000;">Height</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">2.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Icon Id:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">3.4</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">GET</span> oControl:<span style="color: #000000;">IconId</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">4.9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Tab caption:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">5.6</span>, <span style="color: #000000;">5.3</span> <span style="color: #0000ff;">GET</span> cTabCaption <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oRb:<span style="color: #000000;">SelectedTab</span>:<span style="color: #000000;">Caption</span> := AllTrim<span style="color: #000000;">&#40;</span> cTabCaption <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">12</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">5.7</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Group caption:"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">6.6</span>, <span style="color: #000000;">5.3</span> <span style="color: #0000ff;">GET</span> cGrpCaption <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> oControl:<span style="color: #000000;">RibbonGroup</span>:<span style="color: #000000;">Caption</span> := AllTrim<span style="color: #000000;">&#40;</span> cGrpCaption <span style="color: #000000;">&#41;</span>, oRb:<span style="color: #000000;">RedrawBar</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">12</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">7</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Ok"</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><br />&nbsp; &nbsp;<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;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;</div>[/code:1kwqrdft]
Clase TActiveX mejorada y RibbonBar más fácil
Hola Antonio, Ya encaramelados con Codejock, podrías darme alguna pista de cómo usar [b:lf6szb2f]TASKPANEL[/b:lf6szb2f] de Codejock. Le doy por todos los lados, y aunque no me sale error no pinta nada. Tengo FWH 8.07 Un abrazo, Carlos Gallego
Clase TActiveX mejorada y RibbonBar más fácil
Carlos, Ni sabia que existiese <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Como la usas ? Pon algunos ejemplos que podamos probar
Clase TActiveX mejorada y RibbonBar más fácil
Antonio, [code=fw:11ye689r]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oWnd<br />   <span style="color: #00C800;">local</span> oTaskP, oGrps<br />   <span style="color: #00C800;">LOCAL</span> oMenu<br /><br />   <span style="color: #0000ff;">MENU</span> oMenu<br />   <span style="color: #0000ff;">ENDMENU</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;">"FWH Support Codejock ActiveX"</span> <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #B900B9;">// MDI</span><br /><br />   oTaskP := TActiveX<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oWnd, <span style="color: #ff0000;">"Codejock.TaskPanel.12.1.1"</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />    oGrps := oTaskP:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Visisble"</span>,.T.<span style="color: #000000;">&#41;</span><br />    oGrps := oTaskP:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Enable"</span>,.T.<span style="color: #000000;">&#41;</span><br />    oGrps := oTaskP:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Expandable"</span>,.T.<span style="color: #000000;">&#41;</span><br />    oGrps := oTaskP:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Groups"</span><span style="color: #000000;">&#41;</span><br /><br />      oItGr1 := oGrps:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #ff0000;">"Uno"</span><span style="color: #000000;">&#41;</span><br />       oItGr1:<span style="color: #000000;">Caption</span> := <span style="color: #ff0000;">"Dificil"</span><br />       oItGr1:<span style="color: #000000;">Special</span> := .T.<br />         xxx := oItGr1:<span style="color: #0000ff;">Items</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>,<span style="color: #ff0000;">"Uno"</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />         oItGr1:<span style="color: #0000ff;">Items</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>,<span style="color: #ff0000;">"Uno"</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span>ValType<span style="color: #000000;">&#40;</span>xxx<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />       oItGr2 := oGrps:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>,<span style="color: #ff0000;">"Dos"</span><span style="color: #000000;">&#41;</span><br />       oItGr3 := oGrps:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span>,<span style="color: #ff0000;">"Tres"</span><span style="color: #000000;">&#41;</span><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 /> </div>[/code:11ye689r] Saludos, Carlos Gallego
Clase TActiveX mejorada y RibbonBar más fácil
También he probado SKINFRAMEWORK, inclusive la combiné con RIBBONBAR, y funciona perfecto !!! en XP y en vista
Clase TActiveX mejorada y RibbonBar más fácil
Realmente Codejock es excepcional. El único problema es que su manual es super difícil de enterder para los que no manejamos Visual Basic. Si nos dieras una buena guía de cómo manejar los objetos en esta OCX estaríamos hechos en cuanto a mejorar sensiblemente la presentación y diseño de nuestras aplicaciones, y, de esta forma, lograrías una excelente dupleta entra FiveWin y Codejock en beneficio de la comunidad fivewinera. Saludos, Carlos Gallego
Clase TActiveX mejorada y RibbonBar más fácil
Carlos, Yo ni siquiera he mirado el manual <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Desde Microsoft Word, abres VBA (Visual Basic for Applications) y tiene un inspector de classes. Y ahi puedes ir viendo datos, metodos y eventos. Es bastante intuitivo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Clase TActiveX mejorada y RibbonBar más fácil
Carlos, Mira a ver si soporta este método: oActiveX&#058;Do( "AttachToWindow", oWnd:hWnd )
Clase TActiveX mejorada y RibbonBar más fácil
Antonio, Seria possível incluir estas mudanças activex na versão de 9.01 ?
Clase TActiveX mejorada y RibbonBar más fácil
Antonio, Si soporta oActiveX&#058;Do( "AttachToWindow", oWnd:hWnd ), pero igual no pinta nada <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Vale la pena que veas el manual "SymbolReference.chm". He revisado con VBA, pero igual, no encuentro por dónde hacerla funcionar, me quedó grande <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: -->
Clase TActiveX mejorada y RibbonBar más fácil
Rossine, > Seria possível incluir estas mudanças activex na versão de 9.01 ? Si <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Clase TActiveX mejorada y RibbonBar más fácil
Carlos, En vez de hacer: oGrps := oTaskP:Do( "Visible",.T.) prueba con: oGrps := oTaskP:SetProp( "Visible", .T. ) Ojo, tenias una "s" extra.
Clase TActiveX mejorada y RibbonBar más fácil
Antonio, "oGrps := oTaskP:SetProp( "Visible", .T. )" Genera error: [errsysw.prg->ERRORDIALOG] (78) Called from: errsysw.prg->(b)ERRORSYS(49) win32ole.prg->TOLEAUTO:_VISIBLE(0) ->__OBJSENDMSG(0) ->ACTXSETPROPERTY(0) .\source\classes\ACTIVEX.PRG->(b)TACTIVEX&#058;TACTIVEX(0) ->TACTIVEX&#058;SETPROP(0) PRUEBA1.prg->MAIN(33) Type: C >>>_VISIBLE<<< Type: C >>>DISP_E_MEMBERNOTFOUND<<< Type: N >>> 0<<< Con oTaskP:Do( "Visible",.T.) no genera error, abre la ventana pero no pinta el panel. Es decir, no hace nada.