Possibilidades Interessantes

Projeto HwGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Possibilidades Interessantes

Mensagem por asimoes »

Um janela Dialog com uma chamada para Youtube
Screen Shot 03-31-17 at 11.42 PM.PNG
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Possibilidades Interessantes

Mensagem por JoséQuintas »

Fica interessante.
E dá pra fazer com qualquer LIB, até mesmo GTWVG.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
sygecom
Administrador
Administrador
Mensagens: 7131
Registrado em: 21 Jul 2006 10:12
Localização: Alvorada-RS
Contato:

Possibilidades Interessantes

Mensagem por sygecom »

Asimoes,
Você está usando activex da Hwgui? Está usando em uma dialog comum, ou em uma MAIN MDI ?
Leonardo Machado
xHarbour.org + Hwgui + PostgreSql
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Possibilidades Interessantes

Mensagem por JoséQuintas »

Só pra refrescar a memória... rs

https://pctoledo.org/forum/viewto ... ex#p107313
Na prática é um recurso do Windows.
Ao criar uma janela e atribuir a classe atlaxwin, ela permite activex.
E ao colocar o nome de um arquivo, o Windows abre o que estiver associado à extensão do arquivo.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Possibilidades Interessantes

Mensagem por asimoes »

Estou usando uma dialog usando activex classe HHtml()
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Possibilidades Interessantes

Mensagem por asimoes »

Caixa de Mensagem para utilizações diversas.

Função adaptada da MiniGUi

Código: Selecionar todos

nOpcao := ::MsgOptions( "Selecione um botão para impressão", "Atenção", oIcon, "P:\GERAL\HARBOUR\PRINTER.bmp", {"&Tela", "&Impressora", "&Abandonar"}, 3, 60)
Screen Shot 04-15-17 at 06.14 PM.PNG

Código: Selecionar todos

METHOD MsgOptions( cText, cTitle, oIcon, cImage, aOptions, nDefaultOption, nSeconds ) CLASS ClPrincipal
LOCAL nItem, nBtnWidth:=0, aBtn:=Array( Len( aOptions ) ), aImgInfo
LOCAL nBtnPosX:=10, nBtnPosY:=85
LOCAL oSay1, nWidth, nHeight, nStyle
   
   MEMVAR cOption
   
   cOption:="_"

   DEFAULT cText           TO "Selecione uma opção"
   DEFAULT cTitle          TO "Opções Disponíveis"
   DEFAULT oIcon           TO "Opcao.ico"
   DEFAULT cImage          TO ""
   DEFAULT nDefaultOption  TO 1
   DEFAULT nSeconds        TO 0

    WITH Object oBmp1 := HBitmap():AddFile( cImage,,, nWidth, nHeight )
      nWidth  := :nWidth
      nHeigth := :nHeight
   END
  
   _Font_Options := HFont():Add( "Tahoma", 0, -13, 550 ) //HFont():Add( "Tahoma", 9 )
   
   FOR EACH nItem IN aOptions
      aOptions[nItem:__EnumIndex] := AllTrim( aOptions[nItem:__EnumIndex] )
      nBtnWidth := Max( GetTextWidth(, aOptions[nItem:__EnumIndex], _Font_Options:handle), nBtnWidth )
   NEXT
      
   nBtnWidth += 5

   nStyle  := WS_POPUP + WS_VISIBLE + WS_CAPTION + DS_CENTER + WS_SYSMENU 
   
   oObjeto := ClPrincipal():New()
   

   INIT DIALOG _Options ;
        TITLE      cTitle ;
        AT         0, 0  ;
        SIZE       ( Len( aOptions ) * ( 10 + nBtnWidth ) ) + 10, 155 ;
        ICON       oIcon ;
        FONT       _Font_Options ;
        CLIPPER ;
        STYLE      nStyle 
        IF hb_FileExists( cImage ) 
           @ 10, 20 BITMAP Bitmap SHOW cImage STRETCH 0 SIZE nWidth, nHeight 
           @ 50, 30 SAY oLabel ;
                    CAPTION cText ;
                    FONT _Font_Options ;
                    SIZE _Options:nWidth - 55, 80 ;
                    COLOR hwg_RGB( 0, 0, 255 ) ;
                    STYLE ES_LEFT
        ELSE
           @ 10, 30  SAY oLabel ;
                     CAPTION cText ;
                     FONT _Font_Options ;
                     SIZE  _Options:nWidth - 55, 30 ;
                     STYLE SS_LEFT 
      ENDIF
                 
      FOR EACH nItem IN aOptions
         aBtn[nItem:__EnumIndex]:="_Btn_" + hb_NtoS( nItem:__EnumIndex )
         cOption_ := aBtn[nItem:__EnumIndex]
         @ nBtnPosX, _Options:nHeight - 35 BUTTONEX &cOption_. ;
                                           CAPTION  aOptions[nItem:__EnumIndex]  ;
                                           FONT _Font_Options ;
                                           ON CLICK { || cOption := oObjeto:PegaOpcao( &cOption_.:Name, @cOption ), ;
                                                         hwg_EndDialog(_Options:handle) } ;
                                           SIZE     nBtnWidth, 25 
         nBtnPosX += nBtnWidth + 10
      NEXT

      _Options:nInitFocus := &( aBtn[nDefaultOption] )
      
      IF nSeconds > 0
         ::Liga_Timer( _Options , .T., nSeconds * 1000, { || cOption := aOptions[nDefaultOption], hwg_EndDialog(_Options:handle) }, "oTimerOptions" )
      ENDIF
      
      
   
   ACTIVATE DIALOG _Options
  
RETURN aScan( aOptions, AllTrim( cOption ) )

METHOD PegaOpcao( cCaption, cOpcao ) CLASS ClPrincipal
   cVar := cCaption + ":Caption"
   cOpcao := &cVar.
RETURN cOpcao

METHOD Liga_Timer( oJanela, lLiga, nTime, bBlock, oTimer ) CLASS ClPrincipal
   IF lLiga
      SET TIMER &oTimer. of oJanela VALUE nTime ACTION bBlock
   ELSE
      oJanela:&oTimer.:End()   
   ENDIF
RETURN Nil

#pragma BEGINDUMP

#include <windows.h>
#include "hbapi.h"
#include <olectl.h>
#include <time.h>

HB_FUNC( GETTEXTWIDTH ) // returns the width of a string in pixels
{
   HDC   hDC        = ( HDC ) hb_parnl( 1 );
   HWND  hWnd       = ( HWND ) NULL;
   BOOL  bDestroyDC = FALSE;
   HFONT hFont      = ( HFONT ) hb_parnl( 3 );
   HFONT hOldFont   = ( HFONT ) NULL;
   SIZE  sz;

   if( ! hDC )
   {
      bDestroyDC = TRUE;
      hWnd       = GetActiveWindow();
      hDC        = GetDC( hWnd );
   }

   if( hFont )
      hOldFont = ( HFONT ) SelectObject( hDC, hFont );

   GetTextExtentPoint32( hDC, hb_parc( 2 ), hb_parclen( 2 ), &sz );

   if( hFont )
      SelectObject( hDC, hOldFont );

   if( bDestroyDC )
      ReleaseDC( hWnd, hDC );

   hb_retnl( sz.cx );
}
#pragma ENDDUMP
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Possibilidades Interessantes

Mensagem por JoséQuintas »

Só lembrando:

Com a allgui mostrei que dá pra misturar gtwvg, hwgui, e qualquer das hmgs...

Então, qualquer coisa daria pra usá-los diretamente.

:))
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder