Pickdate part 2 – a control class in development

Postby quique » Sun Aug 03, 2008 7:05 pm

Congratulations Otto, and the all people that help to obtain this great job
Saludos
Quique
User avatar
quique
 
Posts: 408
Joined: Sun Aug 13, 2006 5:38 am

Postby Kleyber » Mon Aug 04, 2008 3:01 pm

Does this function work with FWH 8.02? I am trying here but there is no GradientFill() function.

Regards,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Postby ukoenig » Mon Aug 04, 2008 4:29 pm

Hello,

The new Gradient-function comes with FWH-Version 8.07
There is a Gradient-function in older versions.

before Version 8.07, i created a gradient-brush for
bmp's or backgrounds :

aRect := GETCLIENTRECT( oBmp:hWnd )
nGRADIENT := Gradient( hDC, aRect, nVColor, nBColor, .T. ) // .T. Horizontal
or
nGRADIENT := Gradient( hDC, aRect, nVColor, nBColor, .F. ) // .F. Vertical
oBmp:oBrush := TBrush():New( , nGRADIENT )
FillRect( hDC, aRect, oBmp:oBrush:hBrush )

I do not know, if this can transported to Otto's functions,
because i do not know them in detail for the moment.

Best Regards
Uwe
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 Otto » Mon Aug 04, 2008 4:48 pm

Hello Kleyber,
please delete the lines with GradientFill or comment them.

//GradientFill( hDC, 0, 0, ::nHeight, ::nWidth, { { 1, nRGB( 128, 217, 255 ), nRGB( 54, 147, 255 ) } } )

They are not necessary for the pickdate function.
Regards,
Otto
User avatar
Otto
 
Posts: 6146
Joined: Fri Oct 07, 2005 7:07 pm

Postby Kleyber » Mon Aug 04, 2008 6:04 pm

Uwe,

Thanks for information.


Otto,

Thanks!!

Regards,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Postby Kleyber » Mon Aug 04, 2008 7:18 pm

Antonio,

Thanks for response. After commenting those lines, the dialog shows all the days in BLACK (foreground and backgroud). Only the SUNDAYS are with the correct color. How can I solve this?

Regards,

Kleyber
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Postby Silvio » Mon Aug 04, 2008 9:52 pm

Otto ,
in resource test if we ren gradientfill I not see nothing... I see black box
I not have this func
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby nageswaragunupudi » Mon Aug 04, 2008 11:10 pm

GradientFill( hDC, 0, 0, ::nHeight, ::nWidth, { { 1, nRGB( 128, 217, 255 ), nRGB( 54, 147, 255 ) } } )

is functionally equivalent to

Gradient( hDC, { 0, 0, ::nHeight, ::nWidth }, nRGB( 128, 217, 255 ), nRGB( 54, 147, 255 ), .t. )

You may use simple Gradient function if you are using an older version of FWH
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10339
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Otto » Tue Aug 05, 2008 6:48 am

Hello Antonio,

How would you suggest to insert controls to navigate the date?

Should the controls be in the new/redefine method and the paint method changed the way,
that the “clearscreen”: FillRect( hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
would not clear the controls?

Regards,
Otto
User avatar
Otto
 
Posts: 6146
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Tue Aug 05, 2008 8:06 am

Otto,

I would place two buttons, one on each side of the year.

They could be TButton, TBtnBmp or TButtonBmp.

We can create them in the new method once the handle of the control pickdate already exists. For Redefine(), Method Initiate() has to be redefined.
regards, saludos

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

Postby Otto » Tue Aug 05, 2008 8:47 am

Antonio,

local aInfo := ::DispBegin()
::DispEnd( aInfo )

clears the whole screen.

How can I protect the buttons from cleaning?

Thanks in advance
Otto
User avatar
Otto
 
Posts: 6146
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Tue Aug 05, 2008 9:28 am

Otto,

Add these lines in method new:
Code: Select all  Expand view
   if ! Empty( oWnd:hWnd )
      ::Create()
      oWnd:AddControl( Self )
      @ 4.2,  5 BUTTON "<" OF Self SIZE 20, 20 ACTION ::PreviousYear()  // new
      @ 4.2, 20 BUTTON ">" OF Self SIZE 20, 20 ACTION ::NextYear()  // new
   else
      oWnd:DefControl( Self )
   endif

return self

Those buttons don't use double buffer painting, so they will flicker if the PickDate control is resized.
regards, saludos

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

Postby Otto » Tue Aug 05, 2008 10:08 am

Thank you, Antonio.
Do you think there is another solution.
The flickering is not very nice. Also if you move the mouse there is a flickering.

Regards,
Otto
User avatar
Otto
 
Posts: 6146
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Tue Aug 05, 2008 10:32 am

Otto,

Class TBtnBmp does use double buffer painting. Lets try with them...
regards, saludos

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

Postby Antonio Linares » Tue Aug 05, 2008 10:35 am

Otto,

This fix is required for Method MouseMove() as we are repainting the control on each mouse move! We should repaint it only when an initial date has been selected:

if ::lMove .and. nDay > 0 .and. nMonth > 0 // to work with valid dates only
regards, saludos

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 26 guests