Tim,
Here you have a screenshot:
browse control
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
... and mousesupport
Regards,
Otto
#include "FiveWin.ch"
static oWnd
static nHeight
static nWidth
static aDate := {}
function Main()
DEFINE WINDOW oWnd TITLE "Calendar"
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
oWnd:bLClicked := { |y,x,flags |f_info(x,y) }
ACTIVATE WINDOW oWnd ;
ON PAINT PaintGrid( hDC )
return nil
function PaintGrid( hDC )
local n, m
local n1
local cDay, dDate
nHeight := ( oWnd:nHeight - 20 ) / 7
nWidth := ( oWnd:nWidth - 10 ) / 7
for n = 0 to 6
MoveTo( hDC, 0, 20 + n * nHeight )
LineTo( hDC, oWnd:nWidth, 20 + n * nHeight )
next
for n = 1 to 6
MoveTo( hDC, n * nWidth, 0 )
LineTo( hDC, n * nWidth, oWnd:nHeight )
next
for n = 0 to 6
cDay = { "Monday", "Tuesday", "Wednesday", "Thursday",;
"Friday", "Saturday", "Sunday" }[ n + 1 ]
oWnd:Say( 3, 5 + ( n * nWidth ) + ( nWidth / 2 ) - ( GetTextWidth( hDC, cDay ) / 2 ),;
cDay,,,, .T., .T. )
next
dDate = Date() - Day( Date() ) + 1
for n = 0 to 5 //rows
for m = 1 to 7 //cols
oWnd:Say( 25 + n * nHeight, ( m * nWidth ) - 25,;
AllTrim( Str( Day( dDate ) ) ),;
If( Day( Date() ) == Day( dDate ), CLR_HRED, If( Month( Date() ) == Month( dDate ), CLR_YELLOW, CLR_HGREEN ) ),;
,, .T., .T. )
n1:=n+1
aDate[n1,m] := dDate
dDate++
next m
next n
return nil
func f_info(x,y)
local n,m
m:=INT(x/nWidth)+1
n:=INT((y-20)/ nHeight)+1
msginfo(dtoc(aDate[n,m]))
return nil
Regards,
Otto
#include "FiveWin.ch"
static oWnd
static nHeight
static nWidth
static aDate := {}
function Main()
DEFINE WINDOW oWnd TITLE "Calendar"
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
aadd(aDate,{date(),date(),date(),date(),date(),date(),date()})
oWnd:bLClicked := { |y,x,flags |f_info(x,y) }
ACTIVATE WINDOW oWnd ;
ON PAINT PaintGrid( hDC )
return nil
function PaintGrid( hDC )
local n, m
local n1
local cDay, dDate
nHeight := ( oWnd:nHeight - 20 ) / 7
nWidth := ( oWnd:nWidth - 10 ) / 7
for n = 0 to 6
MoveTo( hDC, 0, 20 + n * nHeight )
LineTo( hDC, oWnd:nWidth, 20 + n * nHeight )
next
for n = 1 to 6
MoveTo( hDC, n * nWidth, 0 )
LineTo( hDC, n * nWidth, oWnd:nHeight )
next
for n = 0 to 6
cDay = { "Monday", "Tuesday", "Wednesday", "Thursday",;
"Friday", "Saturday", "Sunday" }[ n + 1 ]
oWnd:Say( 3, 5 + ( n * nWidth ) + ( nWidth / 2 ) - ( GetTextWidth( hDC, cDay ) / 2 ),;
cDay,,,, .T., .T. )
next
dDate = Date() - Day( Date() ) + 1
for n = 0 to 5 //rows
for m = 1 to 7 //cols
oWnd:Say( 25 + n * nHeight, ( m * nWidth ) - 25,;
AllTrim( Str( Day( dDate ) ) ),;
If( Day( Date() ) == Day( dDate ), CLR_HRED, If( Month( Date() ) == Month( dDate ), CLR_YELLOW, CLR_HGREEN ) ),;
,, .T., .T. )
n1:=n+1
aDate[n1,m] := dDate
dDate++
next m
next n
return nil
func f_info(x,y)
local n,m
m:=INT(x/nWidth)+1
n:=INT((y-20)/ nHeight)+1
msginfo(dtoc(aDate[n,m]))
return nil
Background
I was getting a white background ... added a color and it shows up.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Dutch,
It looks really nice
I am sure many users will appreciate if you want to share its source code. You may use www.rapidshare.com or similar to upload it, thanks
It looks really nice
I am sure many users will appreciate if you want to share its source code. You may use www.rapidshare.com or similar to upload it, thanks
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: