FWH's Calendar class

FWH's Calendar class

Postby hua » Wed Oct 23, 2013 7:46 am

Guys,
Using the following code:
Code: Select all  Expand view
#include "fivewin.ch"
#include "calendar.ch"

#define DS_3DLOOK           0x0004
#define DS_MODALFRAME       0x80
#define WS_POPUP            0x80000000
#define WS_CHILD            0x40000000
#define WS_MINIMIZE         0x20000000
#define WS_VISIBLE          0x10000000

function pickdate()
  local oDlg, oCal, dDate

  set century on
  set date british
  set epoch to 1980

  dDate := date()
  define dialog oDlg TITLE "Test Calendar" from 0,0 to 300, 300 pixel  ;
    style nOr(DS_MODALFRAME, DS_3DLOOK, WS_POPUP, WS_VISIBLE)

  @ 0,0 CALENDAR oCal VAR dDate OF oDlg PIXEL  ;
              DBLCLICK (msginfo( oCal:GetDate() ), oDlg:end() )        ;
              ON CHANGE msginfo( oCal:GetDate() )

  activate dialog oDlg

return nil
 


I got this (4 months)
Image

But testcal2.prg in samples shows only 1 month which is what I wanted. What's wrong with my code?

p.s. Any documentation on this control? The wiki has an entry but there's no description on its usage. Only syntax is shown.

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: FWH's Calendar class

Postby Antonio Linares » Wed Oct 23, 2013 4:55 pm

Please try it this way:

Code: Select all  Expand view
#include "fivewin.ch"
#include "calendar.ch"

#define DS_3DLOOK           0x0004
#define DS_MODALFRAME       0x80
#define WS_POPUP            0x80000000
#define WS_CHILD            0x40000000
#define WS_MINIMIZE         0x20000000
#define WS_VISIBLE          0x10000000

function pickdate()
  local oDlg, oCal, dDate

  set century on
  set date british
  set epoch to 1980

  dDate := date()
  define dialog oDlg TITLE "Test Calendar" from 0,0 to 300, 300 pixel  ;
    style nOr(DS_MODALFRAME, DS_3DLOOK, WS_POPUP, WS_VISIBLE)

  @ 0,0 CALENDAR oCal VAR dDate OF oDlg PIXEL SIZE 100, 100 ;
              DBLCLICK (msginfo( oCal:GetDate() ), oDlg:end() )        ;
              ON CHANGE msginfo( oCal:GetDate() )

  activate dialog oDlg CENTERED

return nil
 
regards, saludos

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

Re: FWH's Calendar class

Postby hua » Thu Oct 24, 2013 2:16 am

That worked! Thanks Antonio!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: FWH's Calendar class

Postby hua » Thu Oct 24, 2013 9:00 am

Updated the wiki a bit
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: FWH's Calendar class

Postby Antonio Linares » Thu Oct 24, 2013 12:42 pm

Hua,

many thanks! :-)
regards, saludos

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

Re: FWH's Calendar class

Postby ukoenig » Fri Oct 25, 2013 6:14 pm

Creating a little calendar-painter, I would like to use TTitle as a calendar-frame.
There is a problem with the background-brush.The calendar itself works fine.
Is it possible, to get the calender-background from ttitle, like from a defined dialog ?
It would be nice, to get it working using TTitle !!!

With the painter it is possible, to test all settings / selections at runtime :
I noticed, the unused area using TTitle gradient, base or transparent is not transparent.
If You like, it can be used as a calendar-border, or You have to use the exact size.
I would like to know, if it is possible, to calculate this related to the used fontsize.
As well I noticed, lDESIGN doesn't seems to work.

Image

Calendar reduced to the needed < exact !!! > size :

Image

Titles can have a extra EXIT-button :

Image

Image

Image

Best Regards
Uwe :?:
Last edited by ukoenig on Mon Oct 28, 2013 3:09 pm, edited 10 times in total.
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

Re: FWH's Calendar class

Postby hua » Mon Oct 28, 2013 8:44 am

Uwe,
Nice! :D
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: FWH's Calendar class

Postby ukoenig » Mon Oct 28, 2013 3:16 pm

I just finished the calendar-painter-section.
Because of many possible settings, without the painter it would be a hard job, to get a final result.
Changing the font-size, the needed calendar-size will change.
I used 2 sliders for selecting a basic-size. Finetuning can be done with the 2 gets width and height.

Image

Calendar with any style and size between < Window / Dialog / Title and Calendar > :

Image

Added Title-frame OPTIONAL ( standalone-calendar ) !!!

Image

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

Re: FWH's Calendar class

Postby ukoenig » Sun Nov 03, 2013 5:24 pm

Up !

viewtopic.php?f=3&t=27574

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

Re: FWH's Calendar class

Postby hua » Mon Nov 04, 2013 2:33 am

Nice one Uwe. Thanks for the heads up!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: FWH's Calendar class

Postby hua » Mon Nov 04, 2013 3:35 am

Antonio,

I might have found a bug. See the screenshot below.

Image
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: FWH's Calendar class

Postby Antonio Linares » Mon Nov 04, 2013 10:42 am

Hua,

I wasn't aware that the year can be edited.

I am going to review it, thanks :-)
regards, saludos

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

Re: FWH's Calendar class

Postby ukoenig » Mon Nov 04, 2013 12:22 pm

Antonio,
found results on left mouseclick on month and year.
( didn't test it before )
It seems to be a bug : the get-value is not refreshed, during using the spinner.
It is not possible, to prearrange a year.
I think my < external GET-solution > added in release 1.2, is not needed.
( Added a Date-reset with a double-leftclick on a free calendar-area )

Image

Image

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

Re: FWH's Calendar class

Postby ukoenig » Wed Nov 06, 2013 12:33 pm

Because the year-selection doesn't work,
I created a working new GET on a selected calendar-position ( doesn't cover something, I want to see ).
A second left-mouseclick opens a YESNO ( if a year-selection is visible ), if You want to reset to old date.
Is it better, to RESET without a YESNO-question, after closing the get ?
Maybe possible, to disable the non working old get ?
Is it also possible, to get the used calendar-title-height ( needed, to define the click-area ) ?
It seems to be 3 times the used fontheight.

Image

SECOND mouseclick ( with a visible year-selection )
I used a logical click-counter, to perform the action.

Image

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 22 guests