Clipper On Line • Ver Tópico - Novo estilo e visual.

Novo estilo e visual.

Projeto HwGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

 

Novo estilo e visual.

Mensagempor Itamar M. Lins Jr. » 24 Ago 2016 10:56

Ola!
Usando ADD TOP e STATUS PANEL(em baixo) do dialog, e o head do browse.

#include "hwgui.ch"
Function Test()
Local oDlg, oTopPanel, oBtn1, oBtn2, oBtn3, oBrw
Local oStyleNormal, oStylePressed, oStyleOver
Local aSample := { {"Alex",17,1200}, {"Victor",42,1600}, {"John",31,1000} }

   oStyleNormal := HStyle():New( {16759929,16772062}, 1 )
   oStylePressed := HStyle():New( {16759929}, 1,, 3, 0 )
   oStyleOver := HStyle():New( {16759929}, 1,, 2, 12164479 )

   INIT DIALOG oDlg TITLE "Styled controls" ;
         AT 0, 0 SIZE 380, 260 COLOR 16772062 ;
         FONT HFont():Add( "MS Sans Serif",0,-15 )

   // A TOP PANEL is the same PANEL control, which we used in "Panel and Ownerbuttons"
   // module, but it has predefined ON SIZE codeblock to be at the top of a window
   ADD TOP PANEL oTopPanel TO oDlg HEIGHT 48 BACKCOLOR 16770002

   @ 0,0 OWNERBUTTON oBtn1 OF oTopPanel SIZE 64,48 ;
         TEXT "Date" ;
         ON CLICK {||hwg_WriteStatus(oDlg,1,Dtoc(Date()),.T.)}
   oBtn1:aStyle := { oStyleNormal, oStylePressed, oStyleOver }
       
   @ 64,0 OWNERBUTTON oBtn2 OF oTopPanel SIZE 64,48 ;
         TEXT "Time" ;
         ON CLICK {||hwg_WriteStatus(oDlg,2,Time(),.T.)}
   oBtn2:aStyle := { oStyleNormal, oStylePressed, oStyleOver }

   @ 128,0 OWNERBUTTON oBtn3 OF oTopPanel SIZE 64,48 ;
         TEXT "Version" ;
         ON CLICK {||hwg_WriteStatus(oDlg,3,hwg_Version(),.T.)}
   oBtn3:aStyle := { oStyleNormal, oStylePressed, oStyleOver }

   @ 50,72 BROWSE oBrw ARRAY SIZE 280,140 STYLE WS_BORDER + WS_VSCROLL ;
         ON SIZE ANCHOR_TOPABS + ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS
   oBrw:oStyleHead := HStyle():New( { 0xffffff, 0xbbbbbb }, 1 )
   oBrw:aArray := aSample
   oBrw:AddColumn( HColumn():New( "Name",{|v,o|o:aArray[o:nCurrent,1]},"C",12,0 ) )
   oBrw:AddColumn( HColumn():New( "Age",{|v,o|o:aArray[o:nCurrent,2]},"N",4,0 ) )
   oBrw:AddColumn( HColumn():New( "Number",{|v,o|o:aArray[o:nCurrent,3]},"N",8,0 ) )

   // A STATUS PANEL is a subclass of a PANEL control, which may be used instead of
   // a standard STATUS control
   ADD STATUS PANEL TO oDlg HEIGHT 30 FONT oDlg:oFont ;
      HSTYLE HStyle():New( {16770002,16772062}, 1,, 0.4, 16759929 ) PARTS 120,120,0

   ACTIVATE DIALOG oDlg

Return Nil


Saudações,
Itamar M. Lins Jr.
Anexos
hwgui_219_tutor.png
Avatar de usuário

Itamar M. Lins Jr.
Colaborador

Colaborador
 
Mensagens: 6959
Data de registro: 30 Mai 2007 11:31
Cidade/Estado: Ilheus Bahia
Curtiu: 313 vezes
Mens.Curtidas: 508 vezes

Novo estilo e visual.

Mensagempor Itamar M. Lins Jr. » 24 Ago 2016 10:58

Changelog.
/*
* $Id: Changelog 2567 2016-08-24 10:27:19Z alkresin $
*/

/* Use this format for the entry headers:
   YYYY-MM-DD HH:MM UTC[-|+]hhmm Your Full Name <your_email@address>
   For example:
   2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/

2016-08-24 13:27 UTC+0300 Alexander Kresin <alex@belacy.ru>
  * source/gtk/htree.prg
    ! Small fix

2016-08-24 11:24 UTC+0300 Alexander Kresin <alex@belacy.ru>
  * source/gtk/hpanel.prg
  * source/winapi/hpanel.prg
    * :aItems variable and :DrawItems() method has been added to make it more easy
      to draw items on a panel control:
         Aadd( oPanel:aItems, { cId, {|hDC,aCoors|SomeDrawFunc(hDC,aCoors,...)} )
  * source/gtk/draw.c
  * source/gtk/hcombo.prg
    * The drawable areas in gtk ( such as PANEL with SS_OWNERDRAW style ) doesn't
      allow buttons (including check- and radiobuttons), clicable part of a combobox
      to display. Now this is fixed for comboboxes by redrawing this part on a
      drawable panel.

2016-08-23 16:18 UTC+0300 Alexander Kresin <alex@belacy.ru>
  * source/gtk/hcheck.prg
  * source/gtk/hradio.prg
  * source/winapi/hcheck.prg
  * source/winapi/hradio.prg
    * Changed list of parameters, passed to ON CLICK codeblock
      of checkbutton and radiobutton - for unification.
      Now the first is the control object itself.

2016-08-23 14:18 UTC+0300 Alexander Kresin <alex@belacy.ru>
  * source/gtk/hdialog.prg
    * COLOR clause of INIT DIALOG command works now
  * source/gtk/hpanel.prg
    * SS_OWNERDRAW style is set automatically if COLOR clause is defined
  * source/winapi/hcontrol.prg
    * :bClick of HButton now receives the only parameter 'oButton' - as
      in gtk version and as ownerbutton

2016-08-22 16:08 UTC+0300 Alexander Kresin <alex@belacy.ru>
  * utils/tutorial/tutor_eng.xml
    * New sample module added: "Styled controls", which demonstrate using of
      recently added TOP PANEL, STATUS PANEL, styles for ownerbuttons and
      browse headers

2016-08-22 14:34 UTC+0300 Alexander Kresin <alex@belacy.ru>
  * source/gtk/hbrowse.prg
  * source/winapi/hbrowse.prg
    ! Small fix in DrawHeader()
  * utils/designer/resource/widgets.xml
    * "Modal" property replaced by "NoModal"
  * utils/dbc/dbchw.prg
  * utils/dbc/modistru.prg
    * Browse headers uses gradient style now.
Avatar de usuário

Itamar M. Lins Jr.
Colaborador

Colaborador
 
Mensagens: 6959
Data de registro: 30 Mai 2007 11:31
Cidade/Estado: Ilheus Bahia
Curtiu: 313 vezes
Mens.Curtidas: 508 vezes

Novo estilo e visual.

Mensagempor Itamar M. Lins Jr. » 24 Ago 2016 14:22

...
Está ficando com o visual do windows 8, 10, quadradão, o gradiente dá um efeito legal.

Saudações,
Itamar M. Lins Jr.
Avatar de usuário

Itamar M. Lins Jr.
Colaborador

Colaborador
 
Mensagens: 6959
Data de registro: 30 Mai 2007 11:31
Cidade/Estado: Ilheus Bahia
Curtiu: 313 vezes
Mens.Curtidas: 508 vezes




Retornar para HwGui

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 7 visitantes


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
cron
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro