Página 1 de 1

Usando o componente Panel para simular "StatusBar"

Enviado: 24 Dez 2018 18:19
por asimoes
Ainda uso a hwgui 2.17, tava querendo colocar cor de texto e fundo na status bar ( ADD STATUS ) não estava conseguindo mesmo olhando a MiniGui que faz isso, não consegui reproduzir na hwgui, então fiz uma função usando panel para simular a "statusbar"

Sei que na versão atual da hwgui tem esse recurso estilizado, mas não tenho nenhum projeto pra iniciar no momento com a nova hwgui.
Vou me virando na 2.17 como posso.

Ex.:

Usando o componente Panel para simular "StatusBar"

Enviado: 24 Dez 2018 18:24
por Fernando queiroz
eu uso assim

ADD STATUS PANEL TO oMENUPRINC HEIGHT 30 HSTYLE HStyle():New( {16770002,16772062}, 1,, 0.4, 16759929 ) PARTS 1450


hwg_WriteStatus( oMENUPRINC,1,"Data Movimento: "+dtoc(M->DAT_HOJE)+" Operador: "+RTRIM(M->OPERADOR)+" - Nivel: "+STRZERO(M->NIV_ACESSO,1,0)+" Computador: "+rtrim(hwg_GetComputerName())+" Usuario: "+hlusuario( ) )
telasgc.jpg

Usando o componente Panel para simular "StatusBar"

Enviado: 24 Dez 2018 18:51
por Fernando queiroz
Testei carregando as telas em formato .XML e o resultado foi interessante, vem com todos os recursos

achei show mexer na tela sem precisar compilar novamente, e o poder de embutir o designer no próprio aplicativo é muito interessante

MENUITEM 'Teste Form XML' ID 32034 ACTION HFormTmpl():Read( "FORM\testetela.xml" ):Show()
telasgc.jpg


:)) :)) :)) :-O :-O

Usando o componente Panel para simular "StatusBar"

Enviado: 24 Dez 2018 20:50
por asimoes
Não é uma brastemp mas quem quiser usar e melhorar fique a vontade

Pode substituir BACKTRANSPARENT por TRANSPARENT era um conflito de #defines com a gtwvg ou gtwvt nem lembro mais

Código: Selecionar todos


PUBLIC N_BLUE       := 16711680
PUBLIC N_DARKBLUE   := 10027008
PUBLIC N_WHITE      := 16777215
PUBLIC N_CYAN       := 16776960
PUBLIC N_BLACK      :=        0
PUBLIC N_RED        :=      255
PUBLIC N_GREEN      :=    32768
PUBLIC N_GRAY       :=  8421504
PUBLIC N_YELLOW     :=    65535
PUBLIC N_CLEANBLUE  := 16771276

oIcon := HIcon():AddFile('P:\GERAL\HARBOUR\SOBRE.ICO', 16, 16)

  INIT DIALOG oDlg ;
               TITLE "TESTE COM COMBO" ;
               AT    0, 0 ;
               SIZE  886,317 ;
               FONT  HFont():Add( 'Tahoma', 0, -13, 400 ) ;
               STYLE WS_POPUP + WS_CAPTION + WS_SYSMENU + DS_CENTER ;
               CLIPPER ;
               ON INIT {|| InitStatusPanel("", hwg_RGB( 0, 0, 255 ), N_CLEANBLUE, oIcon, WS_OVERLAPPED, 24, 3 ) }
               .
               .
               .

FUNCTION InitStatusPanel( cCaption, nColorText, nBackPanel, oIcon, nStyle, nHeight, nParts )
LOCAL nColIni := 3, iPart

   MEMVAR cPanel
   
   cPanel := ""
   
   Hb_Default(@cCaption,    "" )
   Hb_Default(@nColorText,  hwg_RGB( 0, 0, 0 ) )
   Hb_Default(@nBackPanel,  hwg_RGB( 255, 255, 255 ) )
   Hb_Default(@nStyle,      WS_OVERLAPPED )
   Hb_Default(@nHeight,     24 )
   Hb_Default(@nParts,      1 )

   @ 000, ThisForm:nHeight - nHeight PANEL oPanelStatus ;
          OF ThisForm ; 
          SIZE ThisForm:nWidth, nHeight ;
          STYLE nStyle  ;
          BACKCOLOR nBackPanel
 
   If Hb_IsObJect( oIcon )
      nColH := Int( (nHeight - 16) / 2 ) 
      @ nColIni, nColH ICON     IconInfo  ;
                       SHOW     oIcon ;
                       OF       oPanelStatus ;
                       SIZE     16,16 ;
                       TOOLTIP "TESTE"
      nColIni += 25
   Endif
   
   nColH := Int( (nHeight - 24) / 2 ) + 2

   nWidth := ThisForm:nWidth / nParts
   
   For iPart:=1 TO nParts
      cPanel := "oSayPanel" + StrZero(iPart,2)
      
      @ nColIni,nColH SAY  &cPanel.    CAPTION cCaption ;
                           OF          oPanelStatus ;
                           SIZE        ThisForm:nWidth, 24 ;
                           COLOR       nColorText ;
                           BACKTRANSPARENT ;
                           TOOLTIP "TESTE"
      nColIni += nWidth + 5
   Next
               
RETURN oPanelStatus

FUNCTION WriteStatusPanel( cText, nPart )
MEMVAR cPanel
   
   cPanel := ""
   
   Hb_Default(@cText, "")
   Hb_Default(@nPart, 1)
   
   cPanel := "oSayPanel" + StrZero(nPart,2)
   
   ThisForm:oPanelStatus:&cPanel.:SetText( cText )

RETURN Nil   

Usando o componente Panel para simular "StatusBar"

Enviado: 24 Dez 2018 21:20
por asimoes
Dividido em 4 partes do tamanho da janela
2018-12-24 21_19_17-h-Combo.png

Usando o componente Panel para simular "StatusBar"

Enviado: 27 Dez 2018 10:05
por asimoes
Barra com efeito gradient
2018-12-27 10_03_32-h-Combo.png