gradient oBar

gradient oBar

Postby hag » Tue Aug 12, 2008 5:31 am

Attempting to try out gradient oBar and get the following message.
Currently using FWH 807
Using code below:
Am i missing something?

Error occurred at: 08/11/08, 22:22:51
Error description: Error BASE/1005 Message not found: TBAR:_BCLRGRAD
Args:
[ 1] = O Object

Stack Calls
===========
Called from: => __ERRRT_SBASE(0)
Called from: => TBAR:ERROR(170)
Called from: source\rtl\tobject.prg => (b)HBOBJECT(105)
Called from: => TBAR:MSGNOTFOUND(0)
Called from: => TBAR:_BCLRGRAD(164)
Called from: .\CASHVER3.PRG => SETWINDOWS(2969)
Called from: .\CASHVER3.PRG => MSCREEN2(698)
Code: Select all  Expand view  RUN
DEFINE BUTTONBAR oBar   SIZE 69.75,38 _3DLOOK OF oWnd1 COLOR CLR CYAN

oBar:bClrGrad = { | lInvert | If( ! lInvert,;
    { { 0.50,16054371, 8388608 },;
       { 0.50, 8388608, 16054371 } },;
    { { 0.50, 8388608, 16054371 },;
       { 0.50, 16054371, 8388608 } } ) }

oBar:nClrText = nRGB( 255, 255, 255 )
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Postby Antonio Linares » Tue Aug 12, 2008 7:27 am

Harvey,

Are you using FWH standard Class TBar ?

Before assigning bClrGrad, please do:

MsgInfo( oBar:ClassName() )

and tell us what name you get, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42110
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Working-sample

Postby ukoenig » Tue Aug 12, 2008 9:22 am

Hello,

maybe i can help you
here is a complete working sample just for a quick answer.
It is the basic-structure of the bar-tools.

Image

Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "xBrowse.ch"
#include "Slider.ch"

static oWnd

FUNCTION Main()

local oBar, oBtn1

SetBalloon( .T. ) // Balloon shape required for tooltips
oProgFont := TFont():New("Arial", ,-14,.F.,.F. , , , ,.F. )

DEFINE WINDOW oWnd TITLE "Gradient-Selection for" MDI MENU TMenu():New()

DEFINE BUTTONBAR oBar OF oWnd SIZE 80, 80 2007 RIGHT

// Copy and Past from the tools
// --------------------------------------

oBar:bClrGrad :=  { | lInvert | If( ! lInvert, ;
{ { 0.50,8388608,16777215 },;
{ 0.50,16777215,8388608 } },;
{ { 0.50,128,16777215 },;
{ 0.50,16777215,128 } } ) }
oBar:nClrText := 16777215

DEFINE BUTTON oBtn1 OF oBar ACTION ( Tools(oWnd,oBar,oBtn1) )  ;
RESOURCE "magic" PROMPT "Bar-Selection" TOOLTIP "Bar-Select"

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 ( MDI ) ------------------------------------//

FUNCTION Tools(oWnd,oBar)

LOCAL oDlg, oBar1, oBtn10


DEFINE DIALOG oDlg RESOURCE "Tools" OF oWnd TITLE  "Gradient-Color-Selection" FONT oProgFont

// ----------- Your fields

// You have to call the BUTTONBAR at INIT

REDEFINE BUTTONBMP oBtn10  ID 10 OF oDlg ;
ACTION ( oDlg:End() ) ;
BITMAP "Quit" PROMPT " Exit" TEXTRIGHT
oBtn10:cToolTip =  { "Close" + CRLF + ;
                                "the Dialog","Gradient-Test", 1, CLR_BLACK, 14089979 }

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

RETURN NIL   

// -----------------------------------------------

static func gradpaint1( hDC, oWnd )

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

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

RETURN NIL

// -----------------------------------------------

static func gradpaint2( hDC, oDlg )

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

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

RETURN NIL

// ------- TEST - BAR  --------------------------

FUNCTION NEW_DLGBAR(oDlg)
LOCAL oBar1

DEFINE BUTTONBAR oBar1 OF oDlg SIZE 80, 80 2007 RIGHT

// Copy and Past from the tools
// --------------------------------------

oBar1:bClrGrad :=  { | lInvert | If( ! lInvert, ;
{ { 0.50,128,16777215 },;
{ 0.50,16777215,128 } },;
{ { 0.50,128,16777215 },;
{ 0.50,16777215,128 } } ) }
oBar1:nClrText := 16777215

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"

DEFINE BUTTON OF oBar1 ACTION oDlg:End() ;
RESOURCE "quit" PROMPT "Exit"  TOOLTIP "Exit"

RETURN(  NIL )


// ------------- The RC-File ------------

#ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif

#define DIALOG_2   2
#define DIALOG_1   1
attach BITMAP "attach.bmp"
calendar BITMAP "calendar.bmp"
people BITMAP "people.bmp"
print  BITMAP "print.bmp"
magic BITMAP "magic.bmp"
exit  BITMAP "exit.bmp"
floppy  BITMAP "floppy.bmp"
open BITMAP "open.bmp"
quit  BITMAP "quit.bmp"
help  BITMAP "help.bmp"
info BITMAP "info.bmp"
colors BITMAP "colors.bmp"
fonts BITMAP "fonts.bmp"
info1 BITMAP "info1.bmp"

Tools DIALOG 4, 53, 409, 303
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "DBF-Structure"
FONT 10, "MS Sans Serif"
{
DEFPUSHBUTTON "Exit", 10, 282, 271, 68, 27
}



If you need the complete working-directory with EXE-file :

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

Bar-Tools Download :

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


Best 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby hag » Tue Aug 12, 2008 1:41 pm

Antonio:

Before assigning bClrGrad, please do:
MsgInfo( oBar:ClassName() )
and tell us what name you get, thanks

Answer >> tbar

Uwe: Thanks for the info. I'll be trying it before end of day. I'll let you know what happens.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Postby Antonio Linares » Tue Aug 12, 2008 2:07 pm

Harvey,

Could you check that you are using FWH 8.07 libraries and not a previous version ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42110
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby hag » Tue Aug 12, 2008 2:49 pm

Antonio:
You asked for dates Dates of Libraries:

fiveh, 7/4/08
fivehc, 6/23/08
fivehcm, 6/23/08
fivehm, 7/04/08
fivehmx, 7/04/08
fivehx, 7/04/08

Downloaded in 7/12/08
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Postby hag » Tue Aug 12, 2008 5:46 pm

Antonio:
Uwe:

I thought I was using FWH 807...No using 806
Installed 807 and working fine.

Thank you both for your help.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Postby Antonio Linares » Tue Aug 12, 2008 5:57 pm

Harvey,

ok, glad to know it is ok now :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42110
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 112 guests