FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Pickdate part 2 – a control class in development
Posts: 408
Joined: Sun Aug 13, 2006 05:38 AM
Pickdate part 2 – a control class in development
Posted: Sun Aug 03, 2008 07:05 PM

Congratulations Otto, and the all people that help to obtain this great job

Saludos

Quique
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Pickdate part 2 – a control class in development
Posted: Mon Aug 04, 2008 03: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Pickdate part 2 – a control class in development
Posted: Mon Aug 04, 2008 04: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.
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Pickdate part 2 – a control class in development
Posted: Mon Aug 04, 2008 04: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

Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Pickdate part 2 – a control class in development
Posted: Mon Aug 04, 2008 06:04 PM

Uwe,

Thanks for information.

Otto,

Thanks!!

Regards,

Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Pickdate part 2 – a control class in development
Posted: Mon Aug 04, 2008 07: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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Pickdate part 2 – a control class in development
Posted: Mon Aug 04, 2008 09: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Pickdate part 2 – a control class in development
Posted: 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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Pickdate part 2 – a control class in development
Posted: Tue Aug 05, 2008 06: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Pickdate part 2 – a control class in development
Posted: Tue Aug 05, 2008 08: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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Pickdate part 2 – a control class in development
Posted: Tue Aug 05, 2008 08:47 AM

Antonio,

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

clears the whole screen.

How can I protect the buttons from cleaning?

Thanks in advance
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Pickdate part 2 – a control class in development
Posted: Tue Aug 05, 2008 09:28 AM
Otto,

Add these lines in method new:
   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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Pickdate part 2 – a control class in development
Posted: 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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Pickdate part 2 – a control class in development
Posted: 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Pickdate part 2 – a control class in development
Posted: 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