Pickdate part 2 – a control class in development

User avatar
quique
Posts: 408
Joined: Sun Aug 13, 2006 5:38 am
Contact:

Post by quique »

Congratulations Otto, and the all people that help to obtain this great job
Saludos
Quique
User avatar
Kleyber
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Post by Kleyber »

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
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Post by ukoenig »

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
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

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
Kleyber
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Post by Kleyber »

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

Post by Kleyber »

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
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

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
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

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
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Antonio,

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

clears the whole screen.

How can I protect the buttons from cleaning?

Thanks in advance
Otto
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

Add these lines in method new:

Code: Select all

   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
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

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
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Post Reply