topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
clase VLC para crear un player - algunos problemas | Antonio...
El caso es que por error te envie el link a un sitio que usa las api obsoletas.
la cual usa un modo de llamar a comandos lo cual no es lo que deseo.
necesitaria:
crear la venta y iniciar el control en hWnd del control que se cree en la ventana,
esa es la parte que no tengo claro.
ya luego la llamada a las funciones me encargo, ya que usalmente no llevan muchos parametros y son sencillas. (aparentemente)
salu2 |
clase VLC para crear un player - algunos problemas | Estimado Sr. Vargas, ¿está tu prueba trabajando con Harbour y fwh?
Me parece interesante que podría ayudarla.
También podría ser útil para mí en la escuela mostrar algo a los estudiantes directamente desde mis aplicaciones |
clase VLC para crear un player - algunos problemas | Claro, harbour con fwh.
aca lo mas reciente, hay que tener instalado vlc el cual incluye el control activex.
no hay problema con que lo uses, desde que esta acá en el foro es para uso comun.
mplayer.prg, si bien esta reconociendo los eventos, al inicio use un timer para controlar el avance de la reproducción.
hay que entender que esta es una prueba de uso y uso los eventos que necesitare, la cual fue exitosa al 100%.
[code=fw:lhv2mhl7]<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: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">TRUE</span> .t.<br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">FALSE</span> .f.<br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br />REQUEST HB_Lang_ESWIN, HB_CODEPAGE_ESWIN<br /><br />PROCEDURE Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">LOCAL</span> oIcon, oVLCX<br /><br /> <span style="color: #00C800;">PRIVATE</span> oWndMP, oVlc, oTimer<br /> <span style="color: #00C800;">PRIVATE</span> oInfoFN1, oInfoFN2<br /><br /> HB_LangSelect<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ESWIN"</span> <span style="color: #000000;">)</span> <br /> HB_SetCodePage<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ESWIN"</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIcon FILE <span style="color: #ff0000;">"d:<span style="color: #000000;">\v</span>lc_foxpro<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\m</span>yplayer.ico"</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndMP <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">800</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"MyPlayer"</span> <span style="color: #0000ff;">ICON</span> oIcon <span style="color: #0000ff;">PIXEL</span> NOMAXIMIZE<br /> <br /> @ <span style="color: #000000;">010</span>, <span style="color: #000000;">010</span> ACTIVEX oVLCX <span style="color: #0000ff;">OF</span> oWndMP PROGID <span style="color: #ff0000;">"VideoLAN.VLCPlugin.2"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">460</span><br /> <br /> @ <span style="color: #000000;">010</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Abrir archivo"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> MP_LoadFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">040</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Play"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #000000;">Play</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">070</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Pause"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #00C800;">Pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Stop"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #000000;">Stop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> @ <span style="color: #000000;">150</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Vol +"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #000000;">VolumenPlus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">180</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Vol -"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #000000;">VolumenMinus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">480</span>, <span style="color: #000000;">010</span> <span style="color: #0000ff;">SAY</span> oInfoFN1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">""</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">COLOR</span> CLR_BLUE, CLR_CYAN <span style="color: #0000ff;">CENTER</span> VCENTER<br /> @ <span style="color: #000000;">522</span>, <span style="color: #000000;">010</span> <span style="color: #0000ff;">SAY</span> oInfoFN2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">""</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">COLOR</span> CLR_BLUE, CLR_CYAN <span style="color: #0000ff;">CENTER</span> VCENTER<br /><br /> oInfoFN1:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span>CLR_BLUE,CLR_CYAN<span style="color: #000000;">)</span><br /> oInfoFN2:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span>CLR_BLUE,CLR_CYAN<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWndMP <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> MP_OnInit<span style="color: #000000;">(</span> oVLCX <span style="color: #000000;">)</span> <span style="color: #0000ff;">VALID</span> MP_OnClose<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #B900B9;">//oVLC_Control:End()</span><br /> oWndMP:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br />PROCEDURE MP_OnInit<span style="color: #000000;">(</span> oVLCX <span style="color: #000000;">)</span><br /> oTimer := TTimer<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span> <span style="color: #000000;">1000</span>, <span style="color: #000000;">{</span>|| OnTimer<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, oWndMP <span style="color: #000000;">)</span> <br /> <br /> oVlc := TVlc<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span> oVLCX <span style="color: #000000;">)</span><br /> oVlc:<span style="color: #000000;">bOnSetFile</span> := <span style="color: #000000;">{</span>|| oInfoFN1:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> oVlc:<span style="color: #000000;">cFileName</span> <span style="color: #000000;">)</span>, oInfoFN2:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oVlc:<span style="color: #000000;">bOnPlay</span> := <span style="color: #000000;">{</span>|| oTimer:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oVlc:<span style="color: #000000;">bOnPause</span> := <span style="color: #000000;">{</span>|| oTimer:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oVlc:<span style="color: #000000;">bOnStop</span> := <span style="color: #000000;">{</span>|| oTimer:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oVlc:<span style="color: #000000;">bOnEnd</span> := <span style="color: #000000;">{</span>|| oTimer:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oVlc:<span style="color: #000000;">SetStepVolume</span><span style="color: #000000;">(</span><span style="color: #000000;">5</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MP_OnClose<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">TRUE</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br />PROCEDURE OnTimer<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cInfo2 := <span style="color: #ff0000;">"Length: "</span> + oVlc:<span style="color: #000000;">GetLengthStr</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">", nPos: "</span> + oVlc:<span style="color: #000000;">GetTimeStr</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">", Volume: "</span> + StrZero<span style="color: #000000;">(</span> oVlc:<span style="color: #000000;">nVolume</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /> <br /> oInfoFN2:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> cInfo2 <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br />PROCEDURE MP_LoadFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cFileName := cGetFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Video |*.mp4;*.avi;*.wmv|Musica |*.mp3;*.wma"</span>, <span style="color: #ff0000;">"Selecione medio"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">""</span>, <span style="color: #00C800;">FALSE</span>, <span style="color: #00C800;">TRUE</span> <span style="color: #000000;">)</span><br /> oVlc:<span style="color: #000000;">SetFile</span><span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span><br /> oInfoFN1:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">DATA</span> oControl<br /> <span style="color: #00C800;">DATA</span> nStepVolume, nVolume<br /> <span style="color: #00C800;">DATA</span> bOnSetFile<br /> <span style="color: #00C800;">DATA</span> bOnPlay, bOnPause, bOnStop, bOnEnd<br /> <span style="color: #00C800;">DATA</span> bOnVolumePlus, bOnVolumeMinus, bOnVolumeChange<br /> <span style="color: #00C800;">DATA</span> bOnFullScreen<br /> <span style="color: #00C800;">DATA</span> cFileName<br /> <span style="color: #00C800;">DATA</span> lStart<br /> <br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oControl <span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> GetVersion<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> IsPlaying<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Play<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">Pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Stop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetLength<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetLengthStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetTime<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetTimeStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetPosition<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> FullScreen<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetVolume<span style="color: #000000;">(</span> nVolume <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetVolume<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> VolumenPlus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> VolumenMinus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetStepVolume<span style="color: #000000;">(</span> nStep <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">nStepVolume</span> := nStep;<br /> <br /> <span style="color: #00C800;">METHOD</span> Time2MiliSec<span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> MiliSec2Time<span style="color: #000000;">(</span> nMiliSec <span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">METHOD</span> OnEvent<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oControl <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> hb_isObject<span style="color: #000000;">(</span> oControl <span style="color: #000000;">)</span><br /> <br /> oControl:<span style="color: #000000;">bOnEvent</span> := <span style="color: #000000;">{</span> |event, aParams, pParams| ::<span style="color: #000000;">OnEvent</span><span style="color: #000000;">(</span> event, aParams, pParams <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <br /> ::<span style="color: #000000;">nVolume</span> := <span style="color: #000000;">50</span><br /> ::<span style="color: #000000;">nStepVolume</span> := <span style="color: #000000;">1</span><br /><br /> ::<span style="color: #000000;">bOnSetFile</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnPlay</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnPause</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnStop</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnEnd</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnVolumeChange</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnVolumePlus</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnVolumeMinus</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnFullScreen</span> := <span style="color: #00C800;">NIL</span><br /><br /> ::<span style="color: #000000;">oControl</span> := oControl<br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">Toolbar</span> := <span style="color: #00C800;">FALSE</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span> := ::<span style="color: #000000;">nVolume</span><br /> <br /> ::<span style="color: #000000;">lStart</span> := <span style="color: #00C800;">FALSE</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetVersion<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">GetVersionInfo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> SetFile<span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">LOCAL</span> lRet := .f.<br /> <span style="color: #00C800;">IF</span> !empty<span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cFileName</span> := cFileName<br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #0000ff;">items</span>:<span style="color: #000000;">clear</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #000000;">add</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"File:///"</span> + ::<span style="color: #000000;">cFileName</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> HB_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSetFile</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSetFile</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">ENDIF</span><br /> lRet := <span style="color: #00C800;">TRUE</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> lRet<br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> IsPlaying<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #000000;">IsPlaying</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> Play<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> !::<span style="color: #000000;">IsPlaying</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #000000;">play</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPlay</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPlay</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">Pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">IsPlaying</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #00C800;">pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPause</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPause</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> Stop<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">IsPlaying</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #000000;">stop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnStop</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnStop</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetLength<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">length</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetLengthStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">MiliSec2Time</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">length</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetPosition<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">position</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetTime<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">time</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetTimeStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">MiliSec2Time</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">time</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> FullScreen<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">video</span>:<span style="color: #000000;">toggleFullscreen</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnFullScreen</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnFullScreen</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetVolume<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> SetVolume<span style="color: #000000;">(</span> nVolume <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> nVolume >= <span style="color: #000000;">0</span> .and. nVolume <= <span style="color: #000000;">100</span><br /> ::<span style="color: #000000;">nVolume</span> := nVolume<br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span> := ::<span style="color: #000000;">nVolume</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumeChange</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumeChange</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> VolumenPlus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nVolume</span> < <span style="color: #000000;">100</span><br /> ::<span style="color: #000000;">nVolume</span> := ::<span style="color: #000000;">nVolume</span> + ::<span style="color: #000000;">nStepVolume</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nVolume</span> > <span style="color: #000000;">100</span><br /> ::<span style="color: #000000;">nVolume</span> := <span style="color: #000000;">100</span> <br /> <span style="color: #00C800;">ENDIF</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span> := ::<span style="color: #000000;">nVolume</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumePlus</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumePlus</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /> <br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> VolumenMinus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nVolume</span> > <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nVolume</span> := ::<span style="color: #000000;">nVolume</span> - ::<span style="color: #000000;">nStepVolume</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nVolume</span> < <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nVolume</span> := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">ENDIF</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span> := ::<span style="color: #000000;">nVolume</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumeMinus</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumeMinus</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /> <br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> Time2MiliSec<span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">LOCAL</span> nMiliSec := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> nH, nM, nS, nT<br /> <span style="color: #00C800;">IF</span> !empty<span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span><br /> nH = VAL<span style="color: #000000;">(</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> cTime, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nM = VAL<span style="color: #000000;">(</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> cTime, <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nS = VAL<span style="color: #000000;">(</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> cTime, <span style="color: #000000;">7</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nT = <span style="color: #000000;">(</span> nH * <span style="color: #000000;">3600</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> nM * <span style="color: #000000;">60</span> <span style="color: #000000;">)</span> + nS<br /> nMiliSec := nT * <span style="color: #000000;">1000</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> nMiliSec<br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> MiliSec2Time<span style="color: #000000;">(</span> nMiliSec <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">LOCAL</span> cTime := <span style="color: #ff0000;">"00:00:00"</span><br /> <span style="color: #00C800;">LOCAL</span> nHora, nMinuto, nSegundo<br /> <span style="color: #00C800;">IF</span> nMiliSec > <span style="color: #000000;">0</span><br /> nMiliSec := int<span style="color: #000000;">(</span> nMiliSec / <span style="color: #000000;">1000</span> <span style="color: #000000;">)</span><br /> nHora := int<span style="color: #000000;">(</span> nMiliSec / <span style="color: #000000;">3600</span> <span style="color: #000000;">)</span><br /> nMiliSec := nMiliSec - <span style="color: #000000;">(</span> nHora * <span style="color: #000000;">3600</span> <span style="color: #000000;">)</span><br /> nMinuto := int<span style="color: #000000;">(</span> nMiliSec / <span style="color: #000000;">60</span> <span style="color: #000000;">)</span><br /> nSegundo := nMiliSec - <span style="color: #000000;">(</span> nMinuto * <span style="color: #000000;">60</span> <span style="color: #000000;">)</span><br /> cTime := StrZero<span style="color: #000000;">(</span> nHora, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">":"</span> + StrZero<span style="color: #000000;">(</span> nMinuto, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">":"</span> + StrZero<span style="color: #000000;">(</span> nSegundo, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> cTime<br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> OnEvent<span style="color: #000000;">(</span> event, aParams, pParams <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerNothingSpecial"</span> &&mediaplayer en espera<br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerMediaChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerOpening"</span> &&al iniciar reproduccion<br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerPlaying"</span> &&mediplayer esta en reproduccion <br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerPaused"</span> &&pausar reproduccion <br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerPausableChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerStopped"</span> &&detener reproduccion<br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerEndReached"</span> &&finalizar reproduccion<br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnEnd</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnEnd</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span> <br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerMuted"</span> &&enmudecer reproduccion<br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerUnmuted"</span> &&quitar enmudecer reproduccion<br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerAudioVolume"</span> &&cambia volumen de reproduccion<br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerTimeChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerSeekableChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerPositionChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerEncounteredError"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerBackward"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerForward"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerBuffering"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerChapterChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerLengthChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerStopAsyncDone"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerTitleChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerVOut"</span><br /> <span style="color: #00C800;">ENDCASE</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><span style="color: #B900B9;">//EOF</span><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /> </div>[/code:lhv2mhl7] |
clase VLC para crear un player - algunos problemas | sorry where I can found the activex or I must install Vcl application ? |
clase VLC para crear un player - algunos problemas | yes. install vcl, this include the activex.
version most recent.
[code=fw:9y7o53le]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">TRUE</span> .t.<br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">FALSE</span> .f.<br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br />REQUEST HB_Lang_ESWIN, HB_CODEPAGE_ESWIN<br /><br />PROCEDURE Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oIcon, oVLCX<br /><br /> <span style="color: #00C800;">PRIVATE</span> oWndMP, oVlc, oTimer<br /> <span style="color: #00C800;">PRIVATE</span> oInfoFN1, oInfoFN2<br /><br /> HB_LangSelect<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ESWIN"</span> <span style="color: #000000;">)</span><br /> HB_SetCodePage<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ESWIN"</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIcon FILE <span style="color: #ff0000;">"d:<span style="color: #000000;">\v</span>lc_foxpro<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\m</span>yplayer.ico"</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndMP <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">800</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"MyPlayer"</span> <span style="color: #0000ff;">ICON</span> oIcon <span style="color: #0000ff;">PIXEL</span> NOMAXIMIZE<br /> <br /> @ <span style="color: #000000;">010</span>, <span style="color: #000000;">010</span> ACTIVEX oVLCX <span style="color: #0000ff;">OF</span> oWndMP PROGID <span style="color: #ff0000;">"VideoLAN.VLCPlugin.2"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">460</span><br /> <br /> @ <span style="color: #000000;">010</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Abrir archivo"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> MP_LoadFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">040</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Play"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #000000;">Play</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">070</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Pause"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #00C800;">Pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Stop"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #000000;">Stop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> @ <span style="color: #000000;">150</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Vol +"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #000000;">VolumenPlus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">180</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Vol -"</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oVlc:<span style="color: #000000;">VolumenMinus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">480</span>, <span style="color: #000000;">010</span> <span style="color: #0000ff;">SAY</span> oInfoFN1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">""</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">COLOR</span> CLR_BLUE, CLR_CYAN <span style="color: #0000ff;">CENTER</span> VCENTER<br /> @ <span style="color: #000000;">522</span>, <span style="color: #000000;">010</span> <span style="color: #0000ff;">SAY</span> oInfoFN2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">""</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWndMP <span style="color: #0000ff;">COLOR</span> CLR_BLUE, CLR_CYAN <span style="color: #0000ff;">CENTER</span> VCENTER<br /><br /> oInfoFN1:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> CLR_BLUE, CLR_CYAN <span style="color: #000000;">)</span><br /> oInfoFN2:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> CLR_BLUE, CLR_CYAN <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWndMP <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> MP_OnInit<span style="color: #000000;">(</span> oVLCX <span style="color: #000000;">)</span> <span style="color: #0000ff;">VALID</span> MP_OnClose<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #B900B9;">//oVLC_Control:End()</span><br /> oWndMP:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br />PROCEDURE MP_OnInit<span style="color: #000000;">(</span> oVLCX <span style="color: #000000;">)</span> <br /> oVlc := TVlc<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span> oVLCX <span style="color: #000000;">)</span><br /> oVlc:<span style="color: #000000;">bOnSetFile</span> := <span style="color: #000000;">{</span>|| oInfoFN1:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> oVlc:<span style="color: #000000;">cFileName</span> <span style="color: #000000;">)</span>, oInfoFN2:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oVlc:<span style="color: #000000;">bOnTimeChanged</span> := <span style="color: #000000;">{</span>|| oInfoFN2:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Length: "</span> + oVlc:<span style="color: #000000;">GetLengthStr</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">", nPos: "</span> + oVlc:<span style="color: #000000;">GetTimeStr</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">", Volume: "</span> + StrZero<span style="color: #000000;">(</span> oVlc:<span style="color: #000000;">nVolume</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oVlc:<span style="color: #000000;">SetStepVolume</span><span style="color: #000000;">(</span><span style="color: #000000;">5</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MP_OnClose<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">TRUE</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br />PROCEDURE MP_LoadFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cFileName := cGetFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Video |*.mp4;*.avi;*.wmv|Musica |*.mp3;*.wma"</span>, <span style="color: #ff0000;">"Selecione medio"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">""</span>, <span style="color: #00C800;">FALSE</span>, <span style="color: #00C800;">TRUE</span> <span style="color: #000000;">)</span><br /> oVlc:<span style="color: #000000;">SetFile</span><span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">DATA</span> oControl<br /> <span style="color: #00C800;">DATA</span> nStepVolume, nVolume<br /> <span style="color: #00C800;">DATA</span> bOnSetFile<br /> <span style="color: #00C800;">DATA</span> bOnPlay, bOnPause, bOnStop, bOnEnd<br /> <span style="color: #00C800;">DATA</span> bOnVolumePlus, bOnVolumeMinus, bOnVolumeChange<br /> <span style="color: #00C800;">DATA</span> bOnMuted, bOnUnMuted<br /> <span style="color: #00C800;">DATA</span> bOnTimeChanged<br /> <span style="color: #00C800;">DATA</span> bOnFullScreen<br /> <span style="color: #00C800;">DATA</span> cFileName<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oControl <span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> GetVersion<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> IsPlaying<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Play<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">Pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Stop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetLength<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetLengthStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetTime<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetTimeStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Position<span style="color: #000000;">(</span> nPos <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> FullScreen<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetVolume<span style="color: #000000;">(</span> nVolume <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetVolume<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> VolumenPlus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> VolumenMinus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetStepVolume<span style="color: #000000;">(</span> nStep <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">nStepVolume</span> := nStep;<br /> <br /> <span style="color: #00C800;">METHOD</span> Time2MiliSec<span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> MiliSec2Time<span style="color: #000000;">(</span> nMiliSec <span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">METHOD</span> OnEvent<span style="color: #000000;">(</span>event, aParams, pParams<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oControl <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> hb_isObject<span style="color: #000000;">(</span> oControl <span style="color: #000000;">)</span><br /> <br /> oControl:<span style="color: #000000;">bOnEvent</span> := <span style="color: #000000;">{</span> |event, aParams, pParams| ::<span style="color: #000000;">OnEvent</span><span style="color: #000000;">(</span> event, aParams, pParams <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <br /> ::<span style="color: #000000;">nVolume</span> := <span style="color: #000000;">50</span><br /> ::<span style="color: #000000;">nStepVolume</span> := <span style="color: #000000;">1</span><br /><br /> ::<span style="color: #000000;">bOnSetFile</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnPlay</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnPause</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnStop</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnEnd</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnVolumePlus</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnVolumeMinus</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnFullScreen</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnMuted</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnUnMuted</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnVolumeChange</span> := <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">bOnTimeChanged</span> := <span style="color: #00C800;">NIL</span><br /><br /> ::<span style="color: #000000;">oControl</span> := oControl<br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">Toolbar</span> := <span style="color: #00C800;">FALSE</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span> := ::<span style="color: #000000;">nVolume</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetVersion<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">GetVersionInfo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> SetFile<span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">LOCAL</span> lRet := <span style="color: #00C800;">FALSE</span><br /> <span style="color: #00C800;">IF</span> !empty<span style="color: #000000;">(</span> cFileName <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cFileName</span> := cFileName<br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #0000ff;">items</span>:<span style="color: #000000;">clear</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #000000;">add</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"File:///"</span> + ::<span style="color: #000000;">cFileName</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> HB_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSetFile</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSetFile</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">ENDIF</span><br /> lRet := <span style="color: #00C800;">TRUE</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> lRet<br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> IsPlaying<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #000000;">IsPlaying</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> Play<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> !::<span style="color: #000000;">IsPlaying</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #000000;">playitem</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">Pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">IsPlaying</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #00C800;">pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> Stop<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">IsPlaying</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">playlist</span>:<span style="color: #000000;">stop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetLength<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">length</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetLengthStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">MiliSec2Time</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">length</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> Position<span style="color: #000000;">(</span> nPos <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> hb_isNil<span style="color: #000000;">(</span> nPos <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">Position</span> <br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #00C800;">IF</span> nPos >= <span style="color: #000000;">0</span> .and. nPos <= <span style="color: #000000;">1</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">Position</span> := nPos<br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetTime<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">time</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetTimeStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">MiliSec2Time</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">input</span>:<span style="color: #000000;">time</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> FullScreen<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">video</span>:<span style="color: #000000;">toggleFullscreen</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnFullScreen</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnFullScreen</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> GetVolume<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> SetVolume<span style="color: #000000;">(</span> nVolume <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> nVolume >= <span style="color: #000000;">0</span> .and. nVolume <= <span style="color: #000000;">100</span><br /> ::<span style="color: #000000;">nVolume</span> := nVolume<br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span> := ::<span style="color: #000000;">nVolume</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> VolumenPlus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nVolume</span> < <span style="color: #000000;">100</span><br /> ::<span style="color: #000000;">nVolume</span> := ::<span style="color: #000000;">nVolume</span> + ::<span style="color: #000000;">nStepVolume</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nVolume</span> > <span style="color: #000000;">100</span><br /> ::<span style="color: #000000;">nVolume</span> := <span style="color: #000000;">100</span> <br /> <span style="color: #00C800;">ENDIF</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span> := ::<span style="color: #000000;">nVolume</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumePlus</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumePlus</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> <br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> VolumenMinus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nVolume</span> > <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nVolume</span> := ::<span style="color: #000000;">nVolume</span> - ::<span style="color: #000000;">nStepVolume</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nVolume</span> < <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nVolume</span> := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">ENDIF</span><br /> ::<span style="color: #000000;">oControl</span>:<span style="color: #000000;">volume</span> := ::<span style="color: #000000;">nVolume</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumeMinus</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumeMinus</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> <br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> Time2MiliSec<span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">LOCAL</span> nMiliSec := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> nH, nM, nS, nT<br /> <span style="color: #00C800;">IF</span> !empty<span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span><br /> nH = VAL<span style="color: #000000;">(</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> cTime, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nM = VAL<span style="color: #000000;">(</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> cTime, <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nS = VAL<span style="color: #000000;">(</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> cTime, <span style="color: #000000;">7</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nT = <span style="color: #000000;">(</span> nH * <span style="color: #000000;">3600</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> nM * <span style="color: #000000;">60</span> <span style="color: #000000;">)</span> + nS<br /> nMiliSec := nT * <span style="color: #000000;">1000</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> nMiliSec<br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> MiliSec2Time<span style="color: #000000;">(</span> nMiliSec <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">LOCAL</span> cTime := <span style="color: #ff0000;">"00:00:00"</span><br /> <span style="color: #00C800;">LOCAL</span> nHora, nMinuto, nSegundo<br /> <span style="color: #00C800;">IF</span> nMiliSec > <span style="color: #000000;">0</span><br /> nMiliSec := int<span style="color: #000000;">(</span> nMiliSec / <span style="color: #000000;">1000</span> <span style="color: #000000;">)</span><br /> nHora := int<span style="color: #000000;">(</span> nMiliSec / <span style="color: #000000;">3600</span> <span style="color: #000000;">)</span><br /> nMiliSec := nMiliSec - <span style="color: #000000;">(</span> nHora * <span style="color: #000000;">3600</span> <span style="color: #000000;">)</span><br /> nMinuto := int<span style="color: #000000;">(</span> nMiliSec / <span style="color: #000000;">60</span> <span style="color: #000000;">)</span><br /> nSegundo := nMiliSec - <span style="color: #000000;">(</span> nMinuto * <span style="color: #000000;">60</span> <span style="color: #000000;">)</span><br /> cTime := StrZero<span style="color: #000000;">(</span> nHora, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">":"</span> + StrZero<span style="color: #000000;">(</span> nMinuto, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">":"</span> + StrZero<span style="color: #000000;">(</span> nSegundo, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> cTime<br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> OnEvent<span style="color: #000000;">(</span> event, aParams, pParams <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerNothingSpecial"</span> &&mediaplayer en espera<br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerMediaChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerOpening"</span> &&al iniciar reproduccion<br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerPlaying"</span> &&mediplayer esta en reproduccion<br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPlay</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPlay</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerPaused"</span> &&pausar reproduccion<br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPause</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnPause</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerStopped"</span> &&detener reproduccion<br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnStop</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnStop</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerEndReached"</span> &&finalizar reproduccion<br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnEnd</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnEnd</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span> <br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerMuted"</span> &&enmudecer reproduccion<br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnMuted</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnMuted</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span> <br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerUnmuted"</span> &&quitar enmudecer reproduccion<br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnUnMuted</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnUnMuted</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span> <br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerAudioVolume"</span> &&cambia volumen de reproduccion<br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumeChange</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnVolumeChange</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerTimeChanged"</span><br /> <span style="color: #00C800;">IF</span> hb_IsBlock<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnTimeChanged</span> <span style="color: #000000;">)</span><br /> eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnTimeChanged</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerPausableChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerSeekableChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerPositionChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerEncounteredError"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerBackward"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerForward"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerBuffering"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerChapterChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerLengthChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerStopAsyncDone"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerTitleChanged"</span><br /> <span style="color: #00C800;">CASE</span> event == <span style="color: #ff0000;">"MediaPlayerVOut"</span><br /> <span style="color: #00C800;">ENDCASE</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><span style="color: #B900B9;">//EOF</span><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /> </div>[/code:9y7o53le] |
clase VLC para crear un player - algunos problemas | Sorry
I download and install the rel Version 3.0.4 • Windows 64bit
I must compile with specific libs ?
I compiled with Harbour and fwh
[b:1ibpezhj]
here crash[/b:1ibpezhj]
Firma problema:
Nome evento problema: APPCRASH
Nome applicazione: test.Exe
Versione applicazione: 0.0.0.0
Timestamp applicazione: 00000000
Nome modulo con errori: test.Exe
Versione modulo con errori: 0.0.0.0
Timestamp modulo con errori: 00000000
Codice eccezione: c0000005
Offset eccezione: 0003961d
Versione SO: 6.1.7600.2.0.0.768.3
ID impostazioni locali: 1040
Informazioni aggiuntive 1: 0a9e
Ulteriori informazioni 2: 0a9e372d3b4ad19135b953a78882e789
Ulteriori informazioni 3: 0a9e
Ulteriori informazioni 4: 0a9e372d3b4ad19135b953a78882e789
Leggere l'informativa sulla privacy online:
<!-- m --><a class="postlink" href="http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0410">http://go.microsoft.com/fwlink/?linkid= ... cid=0x0410</a><!-- m -->
Se l'informativa sulla privacy online non è disponibile, leggere quella offline:
C:\Windows\system32\it-IT\erofflps.txt |
clase VLC para crear un player - algunos problemas | i use vlc 3.0.4 32 bits.
y build the exe with 92\fwh\samples\buildh myplayer |
clase VLC para crear un player - algunos problemas | Carlos now try to download version 32 bit
But I think it's strange
I compile with Harbour and fwh oldest ( see the bottom of my messages) |
clase VLC para crear un player - algunos problemas | Carlos,
With 32 bit version run ok ( on win7 64 bit) as you can see here ( tried Mp4 and Mp3)
[img:166ttk4a]https://i.postimg.cc/9M7Z6GXZ/mm.png[/img:166ttk4a]
cambios probables
ponga el nombre del archivo y el progreso del archivo en la barra de mensajes (parte inferior) de la ventana
Expanda el control hasta OWnd: oclient y vea cómo hacer el zoom máximo
poner los botones en la barra de botones
Pero tal vez ya lo hayas pensado, ¿verdad? |
clase VLC para crear un player - algunos problemas | NO Silvio, esto es una prueba de funcionalidad, ya que mi intencion es crean un programa de rokonola digital, similar a productos como rokobox, psrokola o mfrokola,
los cuales tiene funcionalidades limitadas en cuanto al reproductor, por tanto muchas cualidades propias de un media player no seran requeridas, solo las mas utilizadas,
tales como agregar archivo, reproducir, finalizar, tiempo del archivo en reproducion, avance en tiempo de reproduccion.-
ya luego viene la parte visual, y administrativa, configuración, etc.
por eso me gustaria usar el api en lugar de activex (lo cual limita a windows como SO), ya que con productos tales como fivelinux podria usar linux como sistema operativo, lo cual es mi mayor interes.
un programa de rokonola digital para linux y windows.
salu2
carlos vargas |
clase VLC para crear un player - algunos problemas | En la lista de preguntas y respuestas (FAQ) de VCL, leí que habría posibilidades de adquirir y transmitir videos.
Ya probaste esta posibilidad o no te importa, por ejemplo, podría ser interesante transmitir videos caseros mientras estás en todo el mundo.
<!-- m --><a class="postlink" href="https://www.videolan.org/developers/bitstream.html">https://www.videolan.org/developers/bitstream.html</a><!-- m --> |
clase VLC para crear un player - algunos problemas | no, realmente no estoy interesado en eso. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
siguiendo con el api, esto es lo que tengo hasta el momento. no me muestra nada.
[url:15jgctx6]https://progur.com/2017/06/how-to-use-vlc-api-in-c.html[/url:15jgctx6]
[quote:15jgctx6]bcc32 -I.\include -L.\lib libvlc.lib myplayer3.c[/quote:15jgctx6]
[code=fw:15jgctx6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <stdio.h><br /><span style="color: #00D7D7;">#include</span> <vlc.h><br /><span style="color: #00D7D7;">#include</span> <stdlib.h><br /><br />int main<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> libvlc_instance_t *my_instance;<br /> libvlc_media_t *my_media_file;<br /> libvlc_media_player_t *my_player;<br /><br /> <span style="color: #B900B9;">//instance</span><br /> my_instance = libvlc_new<span style="color: #000000;">(</span><span style="color: #000000;">0</span>, <span style="color: #00C800;">NULL</span><span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>my_instance == <span style="color: #00C800;">NULL</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span><span style="color: #000000;">(</span><span style="color: #000000;">-1</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><br /> <span style="color: #B900B9;">//use a media file</span><br /> my_media_file = libvlc_media_new_path<span style="color: #000000;">(</span>my_instance, <span style="color: #ff0000;">"video.mp4"</span><span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">// Create player</span><br /> my_player = libvlc_media_player_new_from_media<span style="color: #000000;">(</span>my_media_file<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">// Start playing</span><br /> libvlc_media_player_play<span style="color: #000000;">(</span>my_player<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #0000ff;">Sleep</span><span style="color: #000000;">(</span><span style="color: #000000;">5</span><span style="color: #000000;">)</span>;<br /><br /> libvlc_media_release<span style="color: #000000;">(</span>my_media_file<span style="color: #000000;">)</span>; <br /> libvlc_media_player_release<span style="color: #000000;">(</span>my_player<span style="color: #000000;">)</span>;<br /> libvlc_release<span style="color: #000000;">(</span>my_instance<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">return</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /> </div>[/code:15jgctx6] |
clase autoget | He estado probando esta clase que se encuentra en este foro y me da el siguiente error: Message not found: TAUTOGET:_BPOSTKEY. Me imagino que se refiere a la variable de instancia ::bPostKey que no se necuentra declarada en la clase y si invocada. Compilo con fwh 2.7 y xharbour 0.99.60. Desde ya muchas gracias |
clase autoget | nadie sabe nada de esto ????? gracias de todas maneras |
clase autoget | Horacio,
Creo que FWH 2.7 aun no tiene el bPostKey, intenta cambiar bPostKey por bChange en TAutoGet.prg
Saludos de Brasil!
Maurilio |
clase autoget | Te agradezco muchisimo la respuesta. probaré |
clase autoget | Hola
Te Felicito Maurilio por esta clase, realmente muy útil y simple.
Aprovecho para hacer una consulta sobre la misma:
En el caso que la variable tenga previamente al Get (autoget en este caso) un valor, al borrar el mismo y reingresar los datos, no trabaja como autoget sino como un get común.
Por ej. si por Default la variable tiene un valor, y al editarla borramos el mismo, al ingresar nuevos datos no la auto-rellena.
Espero se entienda...
Saludos a todos y gracias. |
clase browse de hernan | HOLA, DE CASUALIDAD ALGUIEN TENDRA LA CLASE BROWSE DE HERNAN Y ALGUNOS EJEMPLOS BASICOS DE EDICION, MODIFICAR, BORRAR Y ALTA DE REGISTROS, APENAS ESTOY APRENDIENDO, SORRY.. |
clase browse de hernan | Aqui la tienes:
<!-- m --><a class="postlink" href="http://rapidshare.com/files/27920493/TWBrowse_Hernan.zip.html">http://rapidshare.com/files/27920493/TW ... n.zip.html</a><!-- m -->
Si haces una búsqueda en estos foros por BROWSE AND HERNAN encontrarás bastante material |
clase metropanel | Hola FiveWinners
Es posible adicionar a la clase metro, que tome las imagenes de los METROBUTTON desde recursos y no desde una imagen como archivo?
Alguien conoce el truco ?
Saludos |
clase modificada sobre clase standard | Saludos
Quisiera saber como puedo utilizar una clase (La TBar) modificada para que sea prioritaria dobre la TBar standard.
Gracias de antemano |
clase modificada sobre clase standard | Hola Compuin,
lo ideal sería que las clases viniesen con una clase intermedia vacía, como está hecho en la libreria de THaruPdf, no queda otro remedio que modificar el codigo fuente de la clase original.
La forma más práctica de modificar una clase original es renombrar la clase usando el preprocesador y creando la tuya propia con el nombre de la original.
Primero copias la clase original a tu proyecto, en este caso la TBar.prg.
Justo antes donde define la clase, haces un define del nombre a otro. (El token Tbar se transforma en una constante)
[code=fw:2kvtkm95]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">// Esto es lo que tu añades</span><br /><span style="color: #00D7D7;">#define</span> TBar TFWBar<br /><br /><span style="color: #00C800;">CLASS</span> Tbar <span style="color: #0000ff;">FROM</span> TControl .....<br /> </div>[/code:2kvtkm95]
De esta manera la clase queda renombrada y ya puedes crear la tuya propia a partir de esta:
// MyTBar.prg
[code=fw:2kvtkm95]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">CLASS</span> TBar <span style="color: #0000ff;">FROM</span> TFWBar<br /><br /><span style="color: #B900B9;">// ... Tu código</span><br /> </div>[/code:2kvtkm95]
Asi cuando tengas la nueva version de FW, solo tienes que incorporar la nueva TBar, añadirle la línea del define, y ya está. Además todo el código que cambies estará en un prg separado.
Un saludo |
clase modificada sobre clase standard | Carlos
Muchas gracias! |
clase outlook | Compile el ejemplo testoutl.prg
y funciono bien pero...
los "prompts" de los bitmaps se muestran en un color
muy tenue, hay forma de cambiarl el color y el font ?
Saludos |
clase outlook | Marco, intenta esto:
[code:2mp27x4u]
define font oFont name "Arial" size 0, -9 BOLD
...
@ -1, -1 OUTLOOK oOut ;
SIZE 100, oWnd:nHeight() ;
PIXEL ;
COLOR CLR_WHITE, CLR_GRAY ; // <----- Colores!
FONT oFont ; // <--- font
OF oWnd
[/code:2mp27x4u]
Salu2!
Maurilio |
clase outlook | MUCHAS GRACIAS POR LA ATENCION
SALUDOS |
clase para indexar | recientemente publicaron un tema sobre una funcion para indexar, y se me ocurrio compartir con la comunidad una pequena clase que ahorra un poco de tiempo en esa tarea, aunque sencilla algunas veces hasta fastidiosa.solo hay que indicar los archivos a indexar con los campos y tag para generar los indices, realmente lo he probrado solo para los NTX y CDX, esta configurada para trabajar solo con esos dos, pero facilmete se puede incluir otros, mirando las clase se daran cuenta que es muy facil hacerlo.aqui les dejo un link para la descarga si hay alguno que le interese, si no solo serviria que la probaran y hasta les podria servir de arranque para generar algo mejor (siempre hay algo mejor) las sugerencias tambien estan abiertas...el link incluye, la clase, el archivo .CH, un programa ejemplo y varias dbfs para probar<!-- m --><a class="postlink" href="http://www.box.net/shared/asbfjyh6ic">http://www.box.net/shared/asbfjyh6ic</a><!-- m --> |
clase para indexar | Hola McFox,tu aporte es muy interesante, yo hago algo bastante parecido. Si me permites una sugerencia, yo haría un pequeño cambio en el comando que define el indice. Lo que escribes como :[code:l3nrb1xo]
ADD TAG oCdx DBF "part003" TAG { {"codigo","partno"} }
[/code:l3nrb1xo]
lo escribiría como
[code:l3nrb1xo]
ADD INDEX TO DBF "part003" TAG "Codigo" KEY partno FOR !deleted() OF oCdx
[/code:l3nrb1xo]es decir:1) añadir la posibilidad de poner filtros en los índices2) La razón de ser de los comandos es ocultar la complejidad de la implementación de una solución, por lo que habría que evitar el uso de arrays en la declaración y buscar que el comando sea lo mas IMPERATIVO y lo menos DECLARATIVO posible. Creo que es una de las cosas más importante que tenemos en el lenguaje xBase y en Harbour en particular.Coménta cualquier novedad así vamos puliendo nuestros propios diseños. Hace tiempo que vengo pensando en hacer lo que en Delphi es un DataModule, que es un modulo donde estan definidos todas las tablas, indices y relaciones del programa.Un saludo,Carlos.PD: Alguien vendrá a la Simo en noviembre? |
clase para indexar | [quote:n4ksyhwp]
lo escribiría como
Código:
ADD INDEX TO DBF "part003" TAG "Codigo" KEY partno FOR !deleted() OF oCdx
[/quote:n4ksyhwp]
Muchas gracias, es una muy buena suguerencia, realmente es lo que quiero, leer opiniones, pense en hacer algo muy parecido (casi igual), el problema que me encontre, fue que tendria que hacer un comando ADD INDEX por cada TAG por cada DBF, mientras que de la forma que lo coloque con un solo comando puedo agregar todos los TAG para 1 DBFs, es decir, si tengo una DBF con 5 TAG tengo que utilizar 5 ADD INDEX, pero tienes razon igual tendria que poner todos los TAG, seria mas comprensible hacerlo uno por uno lo que podria hacer es que aceptara ARRAY o LITERALES en los TAG y en los KEY.
[quote:n4ksyhwp] añadir la posibilidad de poner filtros en los índices [/quote:n4ksyhwp]perfecto, hoy hacemos esos cambios... |
clase para indexar | Si quieres poner en una sola línea todos los TAGS se podría hacer:[code:2xdohdrf]
ADD INDEX TO DBF "part003" ;
TAG "Codigo" KEY partno FOR !deleted() , ;
TAG "Nombre" KEY partdesc FOR !deleted() , ;
TAG "FecAlta" KEY partAdded FOR !deleted() ;
OF oCdx
[/code:2xdohdrf]lo que mantiene la legibilidad. Eso se puede hacer, mira como está definido el comando 'SET RELATION'Un saludo,Carlos. |
clase para indexar | Hola, porque me genera este erro?[code:3vb2dh2w]
Aplicacao:
===========
Caminho(Path): C:\LIXO\cdxmeter\EJEMPLO.exe (32 bits)
Tamanho: 1,468,928 bytes
Hora Inicial: 0 hours 0 mins 4 secs
Ocorrencia de Erro: 10/08/08, 09:32:23
Descricao do Erro: Error BASE/1005 Message not found: TBUTTONBMP:_CPOSTEXT
Chamada da Pilha:
=================
Chamada De: TBUTTONBMP:ERROR(175)
Chamada De: (b)HBOBJECT:HBOBJECT(105)
Chamada De: TBUTTONBMP:MSGNOTFOUND(0)
Chamada De: TBUTTONBMP:_CPOSTEXT(167)
Chamada De: CDXMETER:COMPUESTO(432)
Chamada De: CDXMETER:ACTIVATE(251)
Chamada De: EJEMPLO2(96)
Chamada De: (b)INICIO(14)
Chamada De: TMENU:COMMAND(407)
Chamada De: TWINDOW:COMMAND(932)
Chamada De: TWINDOW:HANDLEEVENT(0)
Chamada De: _FWH(3128)
Chamada De: WINRUN(0)
Chamada De: TWINDOW:ACTIVATE(881)
Chamada De: INICIO(24)
[/code:3vb2dh2w]Estoy usando FIVEWIN 2.7 FOR XHARBOUR.Saludos. |
clase para indexar | la version de FWH que tienes no soporta la posicion del texto en los botones, ya tengo la solucion a tu problema, estoy añadiendo los cambios que recomendo Carlos y ya publico la nueva version |
clase para indexar | [quote="mcfox":2oic5zbh]la version de FWH que tienes no soporta la posicion del texto en los botones, ya tengo la solucion a tu problema, estoy añadiendo los cambios que recomendo Carlos y ya publico la nueva version[/quote:2oic5zbh]Gracias, mcfox.En la espera.Saludos. |
clase para indexar | Ya esta disponible la clase nuevamente con los cambios suguerios por CARLOS MORA, disculpen la demora... <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> Gracias Carlos por las sugerencias, espero cumpla las espectativas de las personas, es una clase sencilla pero hace lo suyoel link de descargas...<!-- m --><a class="postlink" href="http://www.box.net/shared/asbfjyh6ic">http://www.box.net/shared/asbfjyh6ic</a><!-- m --> |
clase tPRINTER (No realizar EJECT del Papel) | Colegas
Reciban un cordial saludo y solicito su gran experiencia
Estoy imprimiendo un lista en impresora de ticket compartida (No local) y necesito que no realice la ejecución del papel (EJECT) agradezco su respuestas. |
clase tPRINTER (No realizar EJECT del Papel) | Holá, en este caso, debes usar la clase TDOSPRN.PRG, ejemplo:
[code=fw:10hw7rls]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USB com TDOSPRN.PRG<br /><br />Enla cabecera de mi rutina de impresión hice esto:<br /><br /><span style="color: #000000;">cPorta</span> := PrnGetPort<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />cPrinter := PrinterPortToName<span style="color: #000000;">(</span> cPorta <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">if</span> empty<span style="color: #000000;">(</span>cPrinter<span style="color: #000000;">)</span><br /><br /> cPrinter := PrinterPortToName<span style="color: #000000;">(</span> <span style="color: #ff0000;">"USB002"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> empty<span style="color: #000000;">(</span>cPrinter<span style="color: #000000;">)</span><br /><br /> cPrinter := PrinterPortToName<span style="color: #000000;">(</span> <span style="color: #ff0000;">"USB001"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">endif</span><br /> <br /><br />Despues empiezo la impresión, preo creando un archivo:<br /><br /><br /><span style="color: #000000;">oPrin</span> := TDosPrn<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"minuta.txt"</span><span style="color: #000000;">)</span><br />oPrin:<span style="color: #000000;">StartPage</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />...<br />...<br /> <br /><br />Y en el fin de la rutina hago esto:<br /><br /><br />...<br />...<br />oPrin:<span style="color: #0000ff;">EndPage</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oPrin:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br />PrintFileRaw<span style="color: #000000;">(</span> cPrinter, TrueName<span style="color: #000000;">(</span><span style="color: #ff0000;">"MINUTA.TXT"</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"Impressão de Vendas"</span> <span style="color: #000000;">)</span><br /> </div>[/code:10hw7rls]
Salu2 |
clase tSalPDF | Hola a todos,Antes de meterle mano a esto, necesito saber si alguien ya hizo esto, de convertir la clase tSalXLS a tSalPDF, utilizando la tPDF de xHarbour.... para no tener que "descubir la formula del agua calentada!"Si ya alguien lo hizo, bienvenido y agradeceria una copia.... sino, comienzo a meterle mano y los que quieran que se suban en el bus!! Claro que para compartirla luego en el foro.Planteo tomar la RepExcel y agregarle solo la vieja tPDF, creando la nueva tSalPDF.... y alguna otra cosilla que alguien haya incluido !Abrazos, y espero sus opiniones. |
clase tSalPDF | Hola Julio:Estuve analizando la clase TPdf en el sentido que mencionas y en principio me entusiasmé al conseguir algunos resultados (claro, a prueba y error por no contar con algún manual) pero mi entusiasmo se diluyó cuando me encontré que TPdf no acepta gráficos emf. Busqué alguna utilería que convirtiera emf a jpg y encontré varias opciones pero de paga, lo que no sería razonable ya que existen utilerías de paga que por un precio similar convierten directamente los archivos emf a pdf. Así es que dejé pendiente mi trabajo esperando gente de xHarbour siga desarrollando la clase para que pueda procesar metafiles.Saludos.Manuel Mercado |
clase tSalPDF | Hola gente,respecto de la librería que hay en harbour para pdfs, no es mas que un wrapper a la librería pdflib, que es opensource. Es una librería muy estable y probada, hay muchos productos basados en ella. Lo que sí dudo es que en algún momento soporte emf de forma directa, ya que es un formato propietario de Microsoft. Otra cosa importante es el costo de la licencia: si bien es gratuita para proyectos open source, para proyectos comerciales la licencia hay que pagarla:<!-- m --><a class="postlink" href="http://www.pdflib.com/products/pdflib-family/pdflib-lite/pdflib-lite-licensing/">http://www.pdflib.com/products/pdflib-f ... licensing/</a><!-- m -->Como alternativa les sugiero que prueben pdfcreator. Es una impresora de PDFs que tiene una interface COM que les permite controlar la conversión. La usamos durante un tiempo y nos fue bastante bien, aunque requiere la instalación de la impresora adicional.En el trabajo usamos con mucho éxito image2pdf.dll, y la verdad la licencia se pagó sola, va muy bien y si pueden hacer el esfuerzo de comprarla vale la pena.Un saludo,Carlos. |
clase tSalPDF | Gracias Manuel,Queria simplemente traducir los metodos que aparecen en TSalXLS a TSalPDF, pero lo que menciona Carlos es de interes...Carlos:Dejame ver si entiendo lo que dices... ¿La clase tPDF que aparece en las contribuciones de xHarbour NECESITA la libreria PDFLib para funcionar?Si es asi, se me cayeron las ganas de seguir con esto !Abrazos, |
clase tdosprn con previsual | Hola otra vez yo.
Necesito imprimir en matriz de punto, pero con la opcion de previsualizacion; alguna vez estuvo en mis manos esta clase pero no la encuentro.
Alguien me la puede enviar.
DESDE COLOMBIA
LEANDRO ALFONSO |
clase tdosprn con previsual | leandro, dame tu correo electronico y te mando la clase con un ejemplo, a no ser de que sea posible através de este foro, si sabes me indicas como hacerlo
saludos |
clase tdosprn con previsual | no se si es mucha molestia, pero me la podrias mandar tambien???
mi correo es <!-- e --><a href="mailto:gerardofarfan@yahoo.com">gerardofarfan@yahoo.com</a><!-- e -->
de antemano gracias |
clase tdosprn con previsual | Hola mi correo es
<!-- e --><a href="mailto:leandroalfonso111@hotmail.com">leandroalfonso111@hotmail.com</a><!-- e -->
MUCHAS GRACIAS
LEANDRO ALFONSO |
clase tdosprn con previsual | Me podrias enviar un ejemplo a mi tabien
Gracias
<!-- e --><a href="mailto:databaselab2002@yahoo.com.ar">databaselab2002@yahoo.com.ar</a><!-- e --> |
clase tdosprn con previsual | [quote="lafug":3fve9t7d]leandro, dame tu correo electronico y te mando la clase con un ejemplo, a no ser de que sea posible através de este foro, si sabes me indicas como hacerlo
saludos[/quote:3fve9t7d]
Podrias compartirla?
<!-- e --><a href="mailto:wmormar@yahoo.com.mx">wmormar@yahoo.com.mx</a><!-- e -->
Gracias de antemano
William Morales |
clase tdosprn con previsual | Porfa, comparte si??
Gracias
<!-- e --><a href="mailto:ekasoftware@infonegocio.net.pe">ekasoftware@infonegocio.net.pe</a><!-- e --> |
clase tdosprn con previsual | Saludos a tod@s.
Lo ideal sería que en este foro hubiera algún lugar donde ir dejando lo que cada usuario ha desarrollado y funciona para actuales/futuros fivener@os que pudieran precisarla.
Así, si algún día te pudiera hacer falta, podríamos bajarla. De la forma actual que se envía a correo personal de cada uno, habría que recorrerse todo el foro de noticias y luego perdirsela a quién la tuviera, lo cual perdería funcionalidad.
Es mi opinión personal.
Saludos de nuevo |
clase tdosprn con previsual | SEÑOR LAFUG
PODRIAS REGALARME LA UTILIDAD QUE TE PERMITE MANEJAR EL PREVIEW CON TDOSPRN ?.
MI CORREO ES :
<!-- e --><a href="mailto:armandini7@hotmail.com">armandini7@hotmail.com</a><!-- e -->
Mil gracias |
clase tdosprn con previsual | Amigo intente mandarte la clase pero me reboto el correo de hotmail, si tienes otro correo electronico con mas capacidad te la envio. |
clase tdosprn con previsual | Te agradecere si te fuera posible compartir esta clase, me seria de mucha utilidad
mi correo es <!-- e --><a href="mailto:lubin.am@speedy.com.pe">lubin.am@speedy.com.pe</a><!-- e -->
Lubin
[quote="lafug":3te8xe2t]leandro, dame tu correo electronico y te mando la clase con un ejemplo, a no ser de que sea posible através de este foro, si sabes me indicas como hacerlo
saludos[/quote:3te8xe2t] |
clase tdosprn con previsual | Me sumo a la lista de kienes deseamos la clase, jeje |
clase tdosprn con previsual | Me sumo a los que quieren esa clase, yo estoy usando una TdosPrn pero no tiene previsualizacion.
Si me la pueden enviar a <!-- e --><a href="mailto:leonorgonz@yahoo.com.ar">leonorgonz@yahoo.com.ar</a><!-- e --> se los agradecería. |
clase tdosprn con previsual | amigo tambien uso tdosprn, y si puedes comparte el preview
<!-- e --><a href="mailto:luiscortesm_67@hotmail.com">luiscortesm_67@hotmail.com</a><!-- e -->
Gracias |
clase tdosprn con previsual | Leandro,
Por favor ponla en <!-- w --><a class="postlink" href="http://www.hyperupload.com">www.hyperupload.com</a><!-- w --> y publica aqui la dirección de descarga. Gracias. |
clase tdosprn con previsual | aqui esta publica para que la descarguen...
<!-- m --><a class="postlink" href="http://hyperupload.com/download/01b9dff370/88290-TDOSPRN.ZIP.html">http://hyperupload.com/download/01b9dff ... N.ZIP.html</a><!-- m -->
espero les sirva |
clase tdosprn con previsual | gracias <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
clase tdosprn con previsual | gracias <!-- e --><a href="mailto:alex_patino74@hotmail.com">alex_patino74@hotmail.com</a><!-- e --> |
clase tdosprn con previsual | De nada...
Espero les sirva... |
clase tdosprn con previsual | >
Lo ideal sería que en este foro hubiera algún lugar donde ir dejando lo que cada usuario ha desarrollado y funciona para actuales/futuros fivener@os que pudieran precisarla.
>
Así lo estamos haciendo en la sección Utilities/Utilidades de este foro. |
clase tdosprn con previsual | Estimado Luis
podrias enviarme tambien a mi esta clase, por favor
Mi correo es:
<!-- e --><a href="mailto:wchavezn@hotmail.com">wchavezn@hotmail.com</a><!-- e -->
gracias
William Chavez Noriega |
clase tdosprn con previsual | Amigo en la parte superior de esta pagina esta el vinculo para que la descargues......
Espera unos segundos en pagina de hiperdownload para la descarga.... |
clase tdosprn con previsual | Gracias Maestro, voy a estudiarlo un poco y ponerlo en practica
William Chavez |
clase tdosprn con previsual | a mi tanbien me seria de utilidad, gracias
<!-- e --><a href="mailto:alex_patino74@hotmail.com">alex_patino74@hotmail.com</a><!-- e --> |
clase texcels | Hola
La clase TExcels se puede usar con harbour, al compilarla me salen bastantes errores de compilacion
Atentamente
Jose Ignacio Jimenez Alarcon |
clase texcels | Hola
La clase TExcels se puede usar con harbour, al compilarla me salen bastantes errores de compilacion
Atentamente
Jose Ignacio Jimenez Alarcon |
clase texcels | [quote="josei":2ekqfnut]Hola
La clase TExcels se puede usar con harbour, al compilarla me salen bastantes errores de compilacion
Atentamente
Jose Ignacio Jimenez Alarcon[/quote:2ekqfnut]
Que clase de errores?
Como la estás compilando? |
clase texcels | Hola
Pues la orden de compilacion es
harbour %1 /n /i..\include;c:\harbour25\include /p %2 %3 > clip.log
y los errores son de sintaxis...exactamente el TRY...CATH
texcels.prg(254) Error E0030 Syntax error: "parse error at '<eol>'"
texcels.prg(258) Error E0030 Syntax error: "parse error at '<eol>'"
texcels.prg(259) Error E0030 Syntax error: "parse error at '<eol>'"
texcels.prg(263) Error E0030 Syntax error: "parse error at '<eol>'"
texcels.prg(266) Error E0030 Syntax error: "parse error at '<eol>'"
texcels.prg(267) Error E0030 Syntax error: "parse error at '<eol>'"
texcels.prg(1106) Error E0030 Syntax error: "parse error at '<eol>'"
texcels.prg(1109) Error E0030 Syntax error: "parse error at '<eol>'"
texcels.prg(1111) Error E0030 Syntax error: "parse error at '<eol>'"
Atentamente
Jose Ignacio Jimenez Alarcon |
clase texcels | José :
Esas son extenciones de xHarbour, para que no tengas problema agrega __HARBOUR__ en la compilación de la clase, de esa forma el compilador ignorara esos procesos y tomará las instrucciones para usar la clase Ole de Harbour. |
clase texcels | Hola
Gracias por las respuestas...pero...donde y como se pone _HARBOUR_ en la linea de compilacion?
Atentamente
Jose ignacio Jimenez Alarcon |
clase texcels | Si estas usando xMate
%C_BIN_INSTALL%\Bcc32.Exe -DHB_API_MACROS -M -c -[b:3b4ynoxm]D__HARBOUR__[/b:3b4ynoxm] -O2 -e -tWM -DHB_COMPAT_C53
-I%HB_INC_INSTALL%;%C_INC_INSTALL% -n%HOME%\Obj %C%[/b]
Si usas un .mak busca la declaración de flag para Bcc32, si usas xHarbour.com lo agregas en el apartado para flag de la segunda opción. |
clase texcels | Hola
Lamento el tiempo que ha pasado,pero el trabajo es asi... gracias por las respuestas, pero el problema es que el error de sintaxis lo da en la compilacion de prg a obj que no se utliza Bcc32 sino harbour...hay alguna forma de sustituir esas expresiones por otras que hagan lo mismo en harbour...
Atentamente
Jose Ignacio Jimenez Alarcon |
clase texcels | Entonces quita del método new las llamadas TRY, CATCH y solo deja la función TOLeAuto() |
clase texcels | El método debe estar de esta forma
[code:2ufnyw0n]
METHOD NEW() CLASS TExcelScript
::lExcel := .T.
#IFDEF __XHARBOUR__
TRY
::oExcel := GetActiveObject( "Excel.Application" )
CATCH
TRY
::oExcel := CreateObject( "Excel.Application" )
CATCH
Alert( "No está Excel Instalado en está Pc." )
::lExcel := .F.
END
END
#ELSE
::oExcel := TOleAuto():New( Excel.Application )
IF ::oExcel:hObj == 0
Alert( "No está Excel Instalado en está Pc." )
::lExcel := .F.
ENDIF
#ENDIF
::oClip:=TClipBoard():New()
::oClip:Clear()
::aExcelCols := {}
RETURN( Self )
[/code:2ufnyw0n] |
clase tftp | Hola a todos después de bastante tiempo sin intervenir en el foro lo hago (no podía ser de otra forma) para preguntar.
Para ver los atributos de un archivo en el servidor FTP hago lo siguiente:
.....
aFiles:=oFtp:Directory(cFolder+cFile)
.....
y luego
cTam:= aFiles[1,2]
cFecha:= aFiles[1,3]
cHora:= aFiles[1,4]
Las dos ultimas me dan error de fuera de rango y revisando la clase veo que no están implementadas, estaría muy agradecido si alguien me puede orientar para solucionar el problema.
Gracias anticipadas <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
clase tftp | Yo vengo usando esta clase desde hace tiempo, y no me ha dado error fuera de rango. La version mas antigua que tengo guardada es la 0809 y si tiene esa información implementada en el metodo Directory(linea 99 y 105). |
clase tftp | Gracias por contestar, parece entonces que el problema es que mi FWH es la versión 2.8 allá por el verano de 2007.
Si me podeis dar una pista que me permita corregir el código.....
Gracias <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
clase tpdf | Hice un programa utilizando la clase y la verdad me gusto, y una vez que le tome la mano y con la ayuda que hace un tiempo hizo the full con el asunto de las filas pude realizar un informe de cuentas corrientes en pdf. Lo que no logro hacer es que me alinie las columnas de los importes y no le encontre la vuelta si alguien la utiliza me podría ayudar. Queda muy bien salvo el detalle comentado
Les envío el código que utilizé por si a alguien le interesa.
[code=fw:1rrcmafb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> creapdfcc<span style="color: #000000;">(</span>aCcli,nclia,lprove,cNapea,cMail<span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> dresult := DEHASTA<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><span style="color: #00C800;">local</span> cImpdos <br /><span style="color: #00C800;">local</span> oprn<br /><span style="color: #00C800;">local</span> nsaldo := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> nvalor := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> z := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> cPath := <span style="color: #ff0000;">"E:<span style="color: #000000;">\f</span>ivehme<span style="color: #000000;">\"</span> + alltrim(cNapea) +"</span>.pdf<span style="color: #ff0000;">"<br /> local oPdf<br /> local ntotal := 0<br /> n := 2.9<br /><br /><br /> opdf := tpdf():new(cPath)<br /> TITULO(oPdf)<br /><br />for z = 1 to len(aCCli)<br /> if aCCli[z,1] <= dresult[1]<br /> nsaldo := aCcli[z,5]<br /> nvalor := z +1<br /> else<br /> exit<br /> endif <br />next<br />titulo1(oPdf ,cnapea,dresult)<br /> if !empty(nsaldo)<br /> oPdf:Pdfatsay(("</span>Saldo al: <span style="color: #ff0000;">" + dtoc(dresult[1])),cm2dpi(n+=.4 ),cmAncho(3.4))<br /> oPdf:Pdfatsay(transform(nsaldo,'@E 9,999,999.99'),cm2dpi(n),cmAncho(19))<br /> endif <br /><br />iif(empty(nvalor), nvalor := 1, nvalor)<br /> for z = nvalor to len(aCCli)<br /> oPdf:Pdfatsay(transform(aCcli[z,1],"</span>@d<span style="color: #ff0000;">"),cm2dpi(n+.4),cmAncho(1)) <br /> oPdf:Pdfatsay(substr(oemtoansi(aCcli[z,2]),1,22) ,cm2dpi(n+.4),cmAncho( 3.4)) <br /> <br /> if !empty(aCcli[z,3])<br /> oPdf:Pdfatsay(transform(aCcli[z,3],"</span>@e <span style="color: #000000;">999</span>,<span style="color: #000000;">999.99</span><span style="color: #ff0000;">") ,cm2dpi(n+=.4 ),cmAncho(9 ),.T. ) <br /> else<br /> oPdf:Pdfatsay( transform(aCcli[z,4],"</span>@e <span style="color: #000000;">999</span>,<span style="color: #000000;">999.99</span><span style="color: #ff0000;">"),cm2dpi(n+=.4 ),cmAncho(14 ),.T. ) <br /> endif<br /> oPdf:Pdfatsay(transform(aCcli[z,5],'@E 9,999,999.99'),cm2dpi(n ),cmAncho(19),.T. ) <br /> // oPdf:Pdfatsay(StrZero1(aCcli[z,5],12),cm2dpi(n ),cmAncho(19),.T. ) no funciona así<br /> <br /> if n >= 25.4 .or. z = len(aCcli) .or. aCcli[z,1] > dresult[2]<br /> oPdf:Pdfatsay(replicate("</span>_<span style="color: #ff0000;">",115),cm2dpi( n+=.4 ),10,.T.) <br /> oPdf:Pdfatsay(("</span>Estado de cta. cte. al <span style="color: #ff0000;">" + transform(aCcli[z,1],"</span>@d<span style="color: #ff0000;">")),cm2dpi( n+=.4 ),cmAncho(3.4),.T.) <br /> oPdf:Pdfatsay(transform(aCcli[z,5],'@E 9,999,999.99'),cm2dpi(n ),cmAncho(19))<br /> oPdf:Pdfatsay(replicate("</span>_<span style="color: #ff0000;">",115),cm2dpi( n+=.4 ),10,.T.) <br /> if aCcli[z,1] > dresult[2]<br /> exit<br /> endif<br /> IF z != len(aCcli)<br /> opdf:Pdfclosepage()<br /> opdf:Pdfnewpage("</span>A4<span style="color: #ff0000;">","</span>P<span style="color: #ff0000;">")<br /> n := 2.2<br /> titulo1(oPdf, cNapea,dresult)<br /> oPdf:Pdfatsay(("</span>Estado de cta. cte. al <span style="color: #ff0000;">" + transform(aCcli[z,1],"</span>@d<span style="color: #ff0000;">")),cm2dpi( n+=.4 ),cmAncho(3.4),.T. ) <br /> oPdf:Pdfatsay(transform(aCcli[z,5],'@E 9,999,999.99'),cm2dpi(n ),cmAncho(19),.t.)<br /> endif<br /> endif*/<br /> next <br /><br /><br /> opdf:Pdfclosepage()<br /> opdf:pdfclose()<br /> msginfo("</span>Archivo creado con éxito<span style="color: #ff0000;">","</span>Aviso del sistema<span style="color: #ff0000;">")<br /><br /> if !empty(cmail)<br /> correo(cMail,,("</span>Enviamos resumen de cuenta desde <span style="color: #ff0000;">" + transform(dresult[1],"</span>@d<span style="color: #ff0000;">") + "</span> hasta <span style="color: #ff0000;">" + transform(dresult[1],"</span>@d<span style="color: #ff0000;">") ),"</span>Resumen de cuenta<span style="color: #ff0000;">", alltrim(cPath ) )<br />endif<br />return .t.<br />/*******************************************************************************/<br />STATIC FUNCTION titulo(oPdf)<br /> opdf:Pdfnewpage("</span>A4<span style="color: #ff0000;">","</span>P<span style="color: #ff0000;">")<br /><br />opdf:Pdfimage("</span>e:\tpdf\logoc1.jpg<span style="color: #ff0000;">", cm2dpi(2.5), 0,85,66) <br />oPdf:Pdfsetfont( "</span>TIMES<span style="color: #ff0000;">", BOLD, 10)<br />opdf:Pdfatsay("</span>QUÍMICA MEGA SA<span style="color: #ff0000;">",cm2dpi( .7 ),100,.T.)<br />oPdf:Pdfsetfont( "</span>TIMES<span style="color: #ff0000;">",NORMAL, 10)<br />oPdf:Pdfatsay("</span>Matanza <span style="color: #000000;">1456</span>/<span style="color: #000000;">58</span><span style="color: #ff0000;">",cm2dpi( 1.2 ),100,.T.)<br />oPdf:Pdfatsay("</span>Avellaneda-Pcia Bs As<span style="color: #ff0000;">",cm2dpi( 1.6 ),100,.T.)<br />oPdf:Pdfatsay("</span>T.E.: <span style="color: #000000;">4289</span><span style="color: #000000;">-2700</span><span style="color: #000000;">(</span>Rotativas<span style="color: #000000;">)</span><span style="color: #ff0000;">",cm2dpi( 2.0 ),100,.T.)<br />oPdf:Pdfatsay(replicate("</span>_<span style="color: #ff0000;">",115),cm2dpi( 2.5 ),10,.T.)<br />return nil<br />/*******************************************************************************/<br />static function titulo1(oPdf, cNapea,dresult)<br />local ctitu := "</span>RESUMEN DE CUENTA CORRIENTE<span style="color: #ff0000;">"<br />local cDesde := "</span>Desde el: <span style="color: #ff0000;">" + dtoc(dresult[1])<br />local cHasta := "</span>Hasta el: <span style="color: #ff0000;">" + dtoc(dresult[2])<br /><br />oPdf:Pdfatsay(ctitu,cm2dpi(n+=.1 ),210)<br />oPdf:Pdfatsay(cNapea ,cm2dpi(n +=.4),10 )<br />oPdf:Pdfatsay(cDesde ,cm2dpi(n +=.4), 10)<br />oPdf:Pdfatsay(cHasta ,cm2dpi(n +=.4),10 )<br />oPdf:Pdfatsay(replicate("</span>_<span style="color: #ff0000;">",115),cm2dpi(n ),10)<br />return nil<br /><br />/*******************************************************************************/<br /></span></div>[/code:1rrcmafb] |
clase tpdf | Mu gustaria hacer una prueba, tu tienes la clase completa para hacer el ejemplo. |
clase tpdf | Ruben pdflib.lib esta en la versión de xharbour la puedes usar. Acá te envío el link que en su momento publicó Manuel Mercado
[url:5o386uge]http://www.box.net/shared/qfbeha7cb7[/url:5o386uge], aca está la clase yo lo que hice fue bajarla y compilarla. Pero como te dijhe usando la librería que está en las lib de xharbour y usando los ch que bajes del link que te envíe la podes usar, sin compilarla.
Esta buena para esos informes en los que tenés que enviar resumenes de cta. Te los hace instantaneamente. Yo lo utilizó para generar el estado de cta de los clientes y automáticamente los envía por mail. El único problema que no pude resolver es en las columnas numéricas que me las encolumne del lado derecho, por defecto lo hace centrada, y no le encontré la vuelta. Sería interesante resolver eso y quedaría un pdf limpito. Si me mandas tu mail te envío como queda el archivo.
Espero te sea útil y puedas resolver la alineación de las columnas
Gracias |
clase tpdf | Buenos días surGom, observo en el código que luego de generar el pdf lo envías por mail.
[color=#FF0040:2x5mmmj8]if !empty(cmail)
correo(cMail,,("Enviamos resumen de cuenta desde " + transform(dresult[1],"@d") + " hasta " + transform(dresult[1],"@d") ),"Resumen de cuenta", alltrim(cPath ) )
endif[/color:2x5mmmj8]
Mi consulta es como lo haces, porque llevo algún tiempo lidiando con ese inconveniente. Verás, genero el pdf a través de PDFCreator pero a la hora de enviarlo como adjunto el correo llega truncado, por lo que al abrirlo dice archivo corrupto, he probado varias sugerencias todas sin éxito.
Desde ya muchas gracias. |
clase tpdf | Así queda el ejemplo que envíe, lo único feo es la aileación
[img:f2fl3wvn]http://desmond.imageshack.us/Himg19/scaled.php?server=19&filename=inmobalnutrersa.jpg&res=medium[/img:f2fl3wvn]
y otra hoja
[img:f2fl3wvn]http://desmond.imageshack.us/Himg87/scaled.php?server=87&filename=inmobalnutrersa2.jpg&res=medium[/img:f2fl3wvn] |
clase tpdf | León este enlace lo envío Karinha <!-- m --><a class="postlink" href="http://www.fivewin.com.br/exibedicas.asp?id=1063">http://www.fivewin.com.br/exibedicas.asp?id=1063</a><!-- m -->, y es lo que utilizo para enviar los mail. Envío las facturas electrónicas generadas y los listados solicitados. También utilizé el blat (hasta la ayuda de Karinha) y los archivos llegan lo mas bien.
Te aclaro que para la factura electrónica uso el pdfwriter ya que quiero que vean la factura generada y los obligo a guardar el documento manualmente, y luego la envían por mail en lotes.
En el caso de los otros pdf al crearlo por código es rapidísimo y al poner
correo(cMail,,("Enviamos resumen de cuenta desde " + transform(dresult[1],"@d") + " hasta " + transform(dresult[1],"@d") ),"Resumen de cuenta", alltrim(cPath ) )
Es instantáneo
Muestra un diálogo similar al redactar correo del outlook, dónde podes agregar comentarios y enviarlo
Espero te sirva de ayuda. |
clase tpdf | Muchisimas gracias, había probado CDOSYS y me sucedía lo mismo, vi que en la función no utiliza el parámetro de timeout, así que probé lo mismo y santo remedio!
Nuevamente muchas gracias! |
clase tpdf | Disculpen que vuelva sobre el tema, pero no logro hacer la alineación de las columnas numéricas, lo que vi es que si edito el pdf con el notepad, las columnas estan correctas :
[code=fw:343cw1xi]<div class="fw" id="{CB}" style="font-family: monospace;">BT <span style="color: #000000;">27.42</span> <span style="color: #000000;">700.27</span> Td <span style="color: #000000;">(</span><span style="color: #000000;">19</span>/<span style="color: #000000;">01</span>/<span style="color: #000000;">2011</span><span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">93.23</span> <span style="color: #000000;">700.27</span> Td <span style="color: #000000;">(</span>Factura <span style="color: #000000;">1</span><span style="color: #000000;">-00083526</span><span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">246.78</span> <span style="color: #000000;">700.27</span> Td <span style="color: #000000;">(</span> <span style="color: #000000;">22.599</span>,<span style="color: #000000;">56</span><span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">520.98</span> <span style="color: #000000;">700.27</span> Td <span style="color: #000000;">(</span> <span style="color: #000000;">118.854</span>,<span style="color: #000000;">02</span><span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">27.42</span> <span style="color: #000000;">688.93</span> Td <span style="color: #000000;">(</span><span style="color: #000000;">09</span>/<span style="color: #000000;">02</span>/<span style="color: #000000;">2011</span><span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">93.23</span> <span style="color: #000000;">688.93</span> Td <span style="color: #000000;">(</span>Recibo <span style="color: #000000;">69684</span> <span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">383.88</span> <span style="color: #000000;">688.93</span> Td <span style="color: #000000;">(</span> <span style="color: #000000;">93.570</span>,<span style="color: #000000;">77</span><span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">520.98</span> <span style="color: #000000;">688.93</span> Td <span style="color: #000000;">(</span> <span style="color: #000000;">25.283</span>,<span style="color: #000000;">25</span><span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">27.42</span> <span style="color: #000000;">677.59</span> Td <span style="color: #000000;">(</span><span style="color: #000000;">09</span>/<span style="color: #000000;">02</span>/<span style="color: #000000;">2011</span><span style="color: #000000;">)</span> Tj ET<br />BT <span style="color: #000000;">93.23</span> <span style="color: #000000;">677.59</span> Td <span style="color: #000000;">(</span>Recibo <span style="color: #000000;">69999</span> <span style="color: #000000;">)</span> Tj ET</div>[/code:343cw1xi]
Si utilizó strzero se ubican correctamente pero es horrible la imagen. No encuentro en dónde de los códigos fuentes está la formula para que lo pueda alinear de alguna forma.Modifiqué strzero para que me reemplace por blancos los espacios pero igual los centra. Hay alguna forma de engañar para que me respete los blancos y quede expresado como mas arriba
Gracias |
clase tpdf | Bueno lo resolvi gracias a Claudio H que esta suscripto en xharbour spanish portuguese, usando el tipo de letra Courier que es de ancho fijo el listado queda perfecto.
Como puedo saber que fuentes son de ancho fijo
Luis |
clase tpdf | Luis,
Veo que en tu ejemplo usas la funcion cmAncho. Me imagino que es para calcular el ancho en centimetros, complementaria de la funcion de TheFull para el alto.
¿Podrias publicar aqui esa funcion cmancho? ¿Simplemente ( nCM * 72 / 2.54 ) ?
Muchas gracias |
clase tpdf | Gracias, mui bueno ejemplo.
[code=fw:acgjok96]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> cm2dpi<span style="color: #000000;">(</span> nCM, <span style="color: #0000ff;">page</span>, lHeight <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> nHeight,nDpi := <span style="color: #000000;">72</span><br /> <span style="color: #00C800;">Local</span> nRes <br /><br /> <span style="color: #00C800;">if</span> empty<span style="color: #000000;">(</span> lHeight <span style="color: #000000;">)</span><br /> lHeight := .T.<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> lHeight<br /> nHeight := <span style="color: #000000;">842.0</span><br /> nRes := nHeight - <span style="color: #000000;">(</span> nCM * nDpi / <span style="color: #000000;">2.54</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> nRes := <span style="color: #000000;">(</span> nCM * nDpi / <span style="color: #000000;">2.54</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> nRes<br /> </div>[/code:acgjok96]
Gracias, saludos. |
clase tprinter como destruir el objeto oprn sin que imprima | Saludos cordiales a todos los foreros.
El caso es el siguiente.
Uso la clase tprinter para que el usuario elija la impresora de su preferencia, una vez elegida realizo un analisis de resolución para saver que tipo de impresora eligio, ya que mis formatos de salida se adaptan al tipo de impresora, ya sea laser, inyeccion, matriz o incluso las POS que nos dan tantos dolores de cabeza.
de esa manera determino cual clase va a usar el sistema para generar el reporte
Ejemplo:
do while .t.
if vtippap == 1 // una variable para determinar el tipo de papel configurado por el usuario 1= continuo las POS , 2 = hoja completa
SoportaGra = .f.
aImpresoras := aGetPrinters()
LEXISTEIMP := .F.
FOR X:=1 TO LEN(aImpresoras)
if alltrim(upper(aImpresoras[x])) == alltrim(upper(CMIIMPREDEFAULT))
LEXISTEIMP := .t.
exit
endif
next x
if LEXISTEIMP == .f.
msginfo("La Impresora predeterminada ya no existe"+CRLF+;
CMIIMPREDEFAULT,"Alerta")
return(nil)
endif
cpuerto := iif(substr(vpuerto,1,3)="USB","C:\FILESAL.PRN",vpuerto) // cpuerto es el resultado, vpuerto el la variable de mi sistema para indicar el puerto
LARCHIVO := iif(substr(vpuerto,1,3)="LPT",.F.,.T.) // indico si es archivo o directo al puerto
oPrn := TDosPrn():New( cpuerto,LARCHIVO ) //iniciamos el objeto tdosprn.
oPrn:command( INICIAPRN ) // iniciamos la impresora
oPrn:Command( oPrn:cCompress )
oPrn:nLinea := 1 // Inicializamos nuestro contador de Renglones // una modificacion que le hice a la clase
else
if vSelecImpre = .T.
if vTVistPre = .T.
myPRINT oPrn FROM USER PREVIEW TITLE ctitulo
else
myPRINT oPrn FROM USER TITLE ctitulo
endif
else //Epson lx-300
if vTVistPre = .T.
myPRINT oPrn FROM USER to &Imprimir_en PREVIEW TITLE ctitulo
else
myPRINT oPrn to &Imprimir_en TITLE ctitulo
endif
endif
oPrn:lPrvModal := .t.
vtippap := 2
endif
if vtippap == 1
cModel := alltrim(CMIIMPREDEFAULT)
else
cModel := oPrn:GetModel() // impresora elegida por el usuario
endif
if vtippap == 1
...parametros y variables para tdosprn
else
if oPrn:nLogPixelX() <= 100 // matriz de puntos mini
if alltrim(UPPER(cModel)) != alltrim(UPPER(CMIIMPREDEFAULT)) // impresora 2 = en archivo cmodel es la impresora que seleciono el usuario y CMIIMPREDEFAULT es la que habia eligido para default el usuiario, pensando en que desea mandar el reporte a otra impresora
vtippap := 1 // tipo de papel continuo 2= hoja completa
oPrn:end()
CMIIMPREDEFAULT := cModel // aqui indico la impresora que selecciono el usuario con la clase tprinter y hago un loop para que inicie nuevamente el proceso pero indicando que impresora debe usar el sistema y el tipo de papel en este caso hoja continua.
loop
endif
endif
exit
enddo
la idea es que si el usuario eligio una impresora de matriz de puntos debo eliminar el objeto oprn generado con tprinter para que se inicie ahora con la tdosprinter y al eliminar el objeto con oprn:end() me envia una pagina en blanco a la impresora y despues inicia la impresion con tdosprn, estube checando la clase rpreview para ver como hace para salir sin imprimir pero no he encontrado el hilo, gracias de ante mano a todos los que deseen ayudar, y espero les sirva de algo el ejemplo para las famosas POS |
clase turl de C++ 5.5 | Hola FiveWinners.
Existe una clase equivalente en C++ 5.5 que haga lo mismo que hace la clase TURL de XHarbour ?
Alguien conoce el truco ?
Saludos |
clase turl de C++ 5.5 | Una idea, y si te bajas las fuentes de xHarbour y la buscas allí ?
Saludos |
clase turl de C++ 5.5 | Hola,
Esta clase ya está en Harbour, en contrib. |
clase twbrowse | HOla Amigos: Tengo trabajando la clase twbrowse en un dialog, al abrir otra ventana con dialog y twbrowse en otra area de trabajo veo en la ventana de atras lo mismo que en la ventana nueva al cambiar el area. Como hago para que la ventana de atras siga mostrando los datos del area de trabajo de inicio. Gracias.
Saludos.
Leonor
Rosario - Argentina |
clase twbrowse | Leonor,
La segunda DBF que usas, lo haces con la claúsula NEW ?
USE ... NEW
Si no, estarias cerrando la DBF anterior y reemplazándola por la nueva.
Por favor, regístrate en estos foros. Son sólo unos minutos. Gracias. |
clase twbrowse | Leonor:
Agregale la clausula alias a la definicion de cada browse:
WALIAS:='MOVART'
REDEFINE LISTBOX oBrw fields ID 999 OF oDlg ;
COLOR CLR_BLACK, CLR_WHITE ;
FONT oFont ALIAS (WALIAS) UPDATE
wAlias3:="MOVAR2"
REDEFINE LISTBOX oBrw3 fields ID 998 OF oDlg ;
COLOR CLR_BLACK, CLR_WHITE ;
FONT oFont ALIAS (WALIAS3) UPDATE
Y en las definiciones de las columnas del browse inclui siempre el alias de la base, no pongas solo el nombre del campo o fieldblock(). Si la base es la misma en los dos browses, abrilas en dos alias distintas.
Saludos, |
clase twbrowse | [quote="DanielPuente":dtcvzvt8]Leonor:
Agregale la clausula alias a la definicion de cada browse:
WALIAS:='MOVART'
REDEFINE LISTBOX oBrw fields ID 999 OF oDlg ;
COLOR CLR_BLACK, CLR_WHITE ;
FONT oFont ALIAS (WALIAS) UPDATE
wAlias3:="MOVAR2"
REDEFINE LISTBOX oBrw3 fields ID 998 OF oDlg ;
COLOR CLR_BLACK, CLR_WHITE ;
FONT oFont ALIAS (WALIAS3) UPDATE
Y en las definiciones de las columnas del browse inclui siempre el alias de la base, no pongas solo el nombre del campo o fieldblock(). Si la base es la misma en los dos browses, abrilas en dos alias distintas.
Saludos,[/quote:dtcvzvt8]
Gracias por la ayuda:
Tengo una serie de dudas al respecto, cosas que no me quedan muy claras. Para el armado de la ventana con el listbox yo siempre llamo a una subrutina en la que ya cambie el area de trabajo con un dbselectar, o sea que ingreso a la subrutina con el area que necesito activa, la subrutina hace lo siguiente:
// genero la ventana que va a contener el listbox
oForm := TDialog():New( Top, Left, Bottom, Right, cTitle,,,,,,,,, .T.,, oFont )
// armo un array con todas las columnas que va a contener el listbox, porque pueden ser campos directos de la base o algunos relacionados con otras
CantFields := LEN( aDefFields )
FOR i = 1 TO CantFields
VarDef := ACLONE( aDefFields[i] )
M->Ancho := FormParse( VarDef[1] )
M->Etiqueta := ALLTRIM( OemToAnsi( FormParse( VarDef[2] ) ) )
VarDef[3] := SUBSTR( ALLTRIM( VarDef[3] ), 4 )
AADD( cEtiqueta, M->Etiqueta )
AADD( nAncho, M->Ancho )
M->Bloque:= LEFT( VarDef[3], LEN( ALLTRIM( VarDef[3] ) ) - 1 )
bBloque+=ACaracter( M->Bloque, VALTYPE(&(M->Bloque)))+","
NEXT
// en bBloque dejo por ejemplo campo1, campo2, campo3
bBloque= LEFT( bBloque, LEN( ALLTRIM( bBloque ) ) -1 )
bBloque= "{ " + bBloque + " }"
nProxArra := Alias()
@RowLis,1 LISTBOX ObjBrowse FIELDS "" ALIAS nProxArra SIZE X2Window, Y2Window OF oForm FONT oFontMulti
ObjBrowse:aHeaders = cEtiqueta
ObjBrowse:bLine = { || &(bBloque) }
ACTIVATE DIALOG oForm CENTER ON RIGHT CLICK MenuPopup( oForm,, aMenu ) ON INIT ( InitMulti( oForm ), ObjBrowse:Refresh() )
Esto funciona barbaro, dentro de esa ventana hay una accion que seleccionando una linea del listbox llama nuevamente a esa subrutina y trae datos de otra area de trabajo, sucede que cuando cambio el area automaticamente la ventana de atras pasa a tener los mismos datos que la ventana de adelante. Como hago para que en la ventana de atras quede fijo el alias de la otra area de trabajo. No olvidarse que la subrutina es siempre la misma. Por otro lado nunca use el REDEFINE, para que casos lo tendria que utilizar y como hago para saber el ID de un objeto ya creado, porque por lo que veo todos los redefine de todos los comandos necesitan el ID del objeto.
Ademas tengo otro problema, en algunos casos se me va de sistema con este cartel: ERROR BASE/1513 Operation too complex
En bBloque estoy ingresando lo siguiente:
//primer columna
{ IF(Abonos->CodTer==M->CodTer,">"," "),
//segunda columna
Abonos->CodTer,
//tercer columna
Abonos->CodArt,
//cuarta columna
LEFT(Abonos->Nombre,39),
//quinta columna
STR(Abonos->Cantidad,8,2),
//sexta columna
TRANSFORM(ROUND(Abonos->Precio*(1+IIF(!TipImpu->Discrimina.AND.TipMov->Calc_Iva=="SI ",(Abonos->PorGravado/100)*(TipImpu->PorIva/100+TipImpu->PorIvaPlus/100),0))+(IIF(!TipImpu->Discrimina,Abonos->PrecVta*Abonos->PorInterno/100,0)),_REDONDEO),"@Z "+REPLICATE("9",10-_REDONDEO-1)+"."+REPLICATE("9",_REDONDEO) ),
//septima columna
TRANSFORM(Abonos->DescuenArt,"@Z 99.99"),TRANSFORM(Abonos->DescuenAr2,"@Z 99.99"),TRANSFORM(Abonos->DescuenAr3,"@Z 99.99"),TRANSFORM(ROUND(Abonos->Precio*(1+IIF(!TipImpu->Discrimina.AND.TipMov->Calc_Iva=="SI ",(Abonos->PorGravado/100)*(TipImpu->PorIva/100+TipImpu->PorIvaPlus/100),0))+(IIF(!TipImpu->Discrimina,Abonos->PrecVta*Abonos->PorInterno/100,0)),_REDONDEO)*(1-Abonos->DescuenArt/100)*(1-Abonos->DescuenAr2/100)*(1-Abonos->DescuenAr3/100)*Abonos->Cantidad ,"@Z "+REPLICATE("9",10-_REDONDEO-1)+"."+REPLICATE("9",_REDONDEO)) }
si yo elimino la sexta o septima columna (primero uno y despues vuelvo a colocar esa y elimino la otra) me lo hace bien, pero con las dos columnas juntas no puede, saben si hay algun límite o porque me esta pasando esto.
Desde ya muchas gracias. Saludos a todos
Leonor |
clase twbrowse | Leonor,
Procura que tus preguntas sean más cortas y simples de leer, sino se hace pesada su lectura y no consigues ayuda <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> |
clase twbrowse | [quote="Antonio Linares":27uecflt]Leonor,
Procura que tus preguntas sean más cortas y simples de leer, sino se hace pesada su lectura y no consigues ayuda <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? -->[/quote:27uecflt]
Gracias por el consejo Antonio. Vamos con una sola pregunta: en algunos casos cuando arma el listbox con la clase twbrowse si coloco los campos por separado lo arma bien pero cuando pongo todos los campos juntos sale es siguiente mensaje ERROR BASE/1513 Operation Too Complex. Existe algun límite de caracteres o datos a evaluar. Muchas Gracias.
Saludos. Leonor |
clase twbrowse | Leonor:
Respecto al error en el bloque, si, el operador & tiene un limite. Tendrias que dividir su contenido o llamar a una funcion que haga el trabajo y devuelva un valor. Tampoco es necesario que todas las definiciones de las columnas del browse las tengas en un codigo de bloque, prodrias usar por ejemplo un codigo de bloque para cada columna en un vector:
Local VEC0_FIELD1 := { { || IF(LLOFACT->PENDIENTE=='X',hBmp,"") },;
{ || DTOC(LLOFACT->FECHA) } ,;
{ || LLOFACT->LFACT+" "+LLOFACT->PNFACT+"-"+LLOFACT->SNFACT } ,;
{ || BUS_DES("LLOCLIEN",1,LLOFACT->CLIENTE,"RAZSOC") },;
{ || TRANS(LLOFACT->TOTAL,"@E 999,999.99") } ,;
Local VEC0_ENC1 := { " " ,;
OEMTOANSI("Fecha"),;
OEMTOANSI("Factura"),;
" Cliente",;
"Total" ,;
VEC0_SIZE1 := {20,62,110,240,80,75,75,75,80,90,90,90},;
VEC0_JUSTIF := {2,2,2,0,2,2,2,2,2,2,2},;
wAlias3:="MOVART"
REDEFINE LISTBOX oBrw fields ID 999 OF oDlg ;
COLOR CLR_BLACK, CLR_WHITE ;
FONT oFont ALIAS (WALIAS) UPDATE
oBrw:SetCols( VEC0_FIELD1, VEC0_ENC1, VEC0_SIZE1 )
Respecto a usar redefines con ids tenes que utilizar algun editor de recursos como el resource workshop de borland. Conseguite un manual. Si queres te mando algun ejemplo con el prg explicado o algo asi.
Saludos, |
clase twbrowse | [quote="DanielPuente":2yxn5kpl]Leonor:
Respecto al error en el bloque, si, el operador & tiene un limite. Tendrias que dividir su contenido o llamar a una funcion que haga el trabajo y devuelva un valor. Tampoco es necesario que todas las definiciones de las columnas del browse las tengas en un codigo de bloque, prodrias usar por ejemplo un codigo de bloque para cada columna en un vector:
Local VEC0_FIELD1 := { { || IF(LLOFACT->PENDIENTE=='X',hBmp,"") },;
{ || DTOC(LLOFACT->FECHA) } ,;
{ || LLOFACT->LFACT+" "+LLOFACT->PNFACT+"-"+LLOFACT->SNFACT } ,;
{ || BUS_DES("LLOCLIEN",1,LLOFACT->CLIENTE,"RAZSOC") },;
{ || TRANS(LLOFACT->TOTAL,"@E 999,999.99") } ,;
Local VEC0_ENC1 := { " " ,;
OEMTOANSI("Fecha"),;
OEMTOANSI("Factura"),;
" Cliente",;
"Total" ,;
VEC0_SIZE1 := {20,62,110,240,80,75,75,75,80,90,90,90},;
VEC0_JUSTIF := {2,2,2,0,2,2,2,2,2,2,2},;
wAlias3:="MOVART"
REDEFINE LISTBOX oBrw fields ID 999 OF oDlg ;
COLOR CLR_BLACK, CLR_WHITE ;
FONT oFont ALIAS (WALIAS) UPDATE
oBrw:SetCols( VEC0_FIELD1, VEC0_ENC1, VEC0_SIZE1 )
Respecto a usar redefines con ids tenes que utilizar algun editor de recursos como el resource workshop de borland. Conseguite un manual. Si queres te mando algun ejemplo con el prg explicado o algo asi.
Saludos,[/quote:2yxn5kpl]
Mil Gracias Master sos un genio, problema solucionado.
Saludos. Leonor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.