buttons 2007 in dialog

Post Reply
marca
Posts: 104
Joined: Mon Aug 13, 2007 5:22 pm
Location: Brazil
Contact:

buttons 2007 in dialog

Post by marca »

I have a possession in this screen that doesn't paint the buttons and nor the bar of the color that I am selecting

As I can solve this problem

I use Dialog and no window


DEFINE BRUSH oBrush FILENAME oPub:oBrushS
DEFINE DIALOG oDlg RESOURCE "SV_CADGER" TITLE "CADASTRO DE CLIENTES" FONT oWnd:oFont BRUSH oBrush

blablabla

ACTIVATE DIALOG oDlg CENTERED ON INIT BuildCli( oDlg,oBrw )

**************************************//***************************************
STATIC FUNCTION BuildCli( oDlg,oBrw )
**************************************//***************************************
LOCAL oBar, oBtn
DEFINE BUTTONBAR 2007 oBar OF oDlg
DEFINE BUTTON oBtn OF oBar RESOURCE 'ICON_NEW' ;
NOBORDER TOOLTIP 'Incluir cliente' ;
ACTION EditCliente(oBrw,.T.,.T.)

oBar:bClrGrad = { | lInvert | If( ! lInvert,;
{ { 0.25, nRGB( 129, 132, 135 ), nRGB( 54, 58, 62 ) } ,;
{ 0.75, nRGB( 20, 40, 60 ), nRGB( 5, 10, 15 ) } },;
{ { 0.25, nRGB( 160, 173, 174 ), nRGB( 67, 112, 133 ) },;
{ 0.75, nRGB( 11, 66, 94 ), nRGB( 74, 134, 187 ) } } ) }
oBar:nClrText = { | lInvert | If( ! lInvert,nRGB( 235, 160, 86 ), nRGB( 20, 20, 20 ) ) }
RETURN
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marcelo,

This example is properly working here:

test.prg

Code: Select all

#include "FiveWin.ch" 

function Main() 

   local oDlg 

   DEFINE DIALOG oDlg TITLE "Test" 

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT BuildBar( oDlg )

return nil 

function Buildbar( oDlg )

   local oBar
   
   DEFINE BUTTONBAR oBar OF oDlg 2007
   
   DEFINE BUTTON OF oBar ACTION MsgInfo( "test" ) PROMPT "test"
   
   oBar:bClrGrad = { | lInvert | If( ! lInvert,; 
                   { { 0.25, nRGB( 129, 132, 135 ), nRGB( 54, 58, 62 ) } ,; 
                   { 0.75, nRGB( 20, 40, 60 ), nRGB( 5, 10, 15 ) } },; 
                   { { 0.25, nRGB( 160, 173, 174 ), nRGB( 67, 112, 133 ) },; 
                   { 0.75, nRGB( 11, 66, 94 ), nRGB( 74, 134, 187 ) } } ) } 
   oBar:nClrText = { | lInvert | If( ! lInvert,nRGB( 235, 160, 86 ), nRGB( 20, 20, 20 ) ) }   
   
return nil 
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Buttonbars

Post by ukoenig »

Hello Marcelo,

One more sample ( MDI ) :

To create nice-looking Gradients for your Buttonbars,
you can download :

http://www.pflegeplus.com/fw_downloads/bargradient3.zip

MDI Window
Gradient in Main-window
Buttonbar in Main-window

Gradient and buttonbar in MDI-child

Code: Select all


#include "FiveWin.ch"

static oWnd

FUNCTION Main()

local oBar, oBtn1

// Hiding the MDI - menue with MENU TMenu():New() 

DEFINE WINDOW oWnd TITLE "Test" MDI MENU TMenu():New() 

DEFINE BUTTONBAR oBar OF oWnd SIZE 80, 80 2007 RIGHT 

oBar:bClrGrad = { | | { { 0.10,16054371, 8388608 }, ; 
                 { 0.10, 8388608,16054371 } } }

oBar:nClrText = 0

// Open the Dialog
// ------------------
DEFINE BUTTON OF oBar ACTION Tools( oWnd ) ;
RESOURCE "magic" PROMPT "Bar-Selection" TOOLTIP "Test"

DEFINE BUTTON OF oBar ACTION Msgalert( "Test" ) ;
RESOURCE "open" PROMPT "Open" TOOLTIP "Test"

DEFINE BUTTON OF oBar ACTION MsgAlert( "Test") ;
RESOURCE "floppy" PROMPT "Save" TOOLTIP "Test"

DEFINE BUTTON OF oBar ACTION MsgAlert( "Test" ) ;
RESOURCE "help" PROMPT "Help" TOOLTIP "Test"

// Space in Buttonbar
// ------------------------
DEFINE BUTTON oBtn1 OF oBar ACTION NIL ;
RESOURCE "calendar" 

oBtn1:Hide()

DEFINE BUTTON OF oBar ACTION oWnd:End() ;
RESOURCE "quit" PROMPT "Exit" TOOLTIP "Close Bar-Gradient"

SET MESSAGE OF oWnd TO "Testing the ButtonBar 2007 Office look" ;
CENTERED CLOCK KEYBOARD 2007

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT gradpaint1( hDC, oWnd ) ;
VALID MsgYesNo( "Do you want to end?" )

RETURN NIL

//-----------------  DIALOG -------------------------------------------//

FUNCTION Tools(oWnd)
local oDlg

DEFINE DIALOG oDlg RESOURCE "Tools" OF oWnd TITLE  "Test" FONT oProgFont

.....
.....
.....


ACTIVATE DIALOG oDlg CENTERED NOWAIT ;
ON PAINT gradpaint2( hDC, oDlg ) ;
ON INIT NEW_DLGBAR(oDlg)

RETURN NIL   

// ------- BAR in Dialog --------------------------

FUNCTION NEW_DLGBAR(oDlg)
LOCAL oBar1

DEFINE BUTTONBAR oBar1 OF oDlg SIZE 80, 80 2007 RIGHT 

DEFINE BUTTON OF oBar1 ACTION MsgInfo( "Attach" ) ;
RESOURCE "attach" PROMPT "Attach" TOOLTIP "Attach"

DEFINE BUTTON OF oBar1 ACTION MsgInfo( "calendar" ) ;
RESOURCE "calendar" PROMPT "Calendar" TOOLTIP "Calendar"

DEFINE BUTTON OF oBar1 ACTION MsgInfo( "Clients" ) ;
RESOURCE "people" PROMPT "Clients"  TOOLTIP "Clients"

RETURN(  NIL )

// ------------ Gradient for MAIN-window-----------------------------------

static func gradpaint1( hDC, oWnd )

local aGrad := { { 0.50, 8388608, 16054371 } }

GradientFill( hDC,  0, 0, oWnd:nHeight, oWnd:nWidth, aGrad, .F. )

RETURN NIL

// ----------- Gradient for DIALOG ( MDI-Child ) ------------------------------------

static func gradpaint2( hDC, oDlg )

local aGrad1 := { { 0.50, 16054371, 8388608 } }

GradientFill( hDC,  0, 0, oDlg:nHeight, oDlg:nWidth, aGrad1, .F. )

RETURN NIL

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
marca
Posts: 104
Joined: Mon Aug 13, 2007 5:22 pm
Location: Brazil
Contact:

Post by marca »

Hello Antonio

With the version "FWHX 8.08" works but with "FWHX 8.07" it doesn't work
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
marca
Posts: 104
Joined: Mon Aug 13, 2007 5:22 pm
Location: Brazil
Contact:

Post by marca »

ukoenig

Thank you for the clue and congratulations for the source
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
Post Reply