Hi All
When I put a TCalendar control on a window it defaults to one month but when I place it on a dialog it defaults to four months. How can I set it to one month on a dialog. I have only found ::GetVisibleMonths() not ::SetVisibleMonths().
Can anyone help?
David
TCalendar
Re: TCalendar
Also I ask this features last week but I not had messages and helps!!!
Re: TCalendar
There is still another Solution ( doesn't use TCalendar )
Samples : Calendar.prg
I started with a embedded xBrowse-solution :
Best Regards
Uwe
Samples : Calendar.prg
I started with a embedded xBrowse-solution :
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
Re: TCalendar
Hello,
try this
But in order to this sample works, you need to have the last added feature to the GET class, "lKeepFocus" if you don't have the last FWH, you can modify it, following this message http://forums.fivetechsupport.com/viewt ... 22&t=24697 and if you implement the ON INIT feature, then the code is simplest and clear
http://forums.fivetechsupport.com/viewt ... 6&start=15
try this
Code: Select all
#include "fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, g, d := DATE()
DEFINE DIALOG oDlg FROM 10,10 To 20,20
@ 1,1 GET g VAR d ACTION calendar(self)
g:lKeepFocus := .F.
ACTIVATE DIALOG oDlg
RETURN NIL
FUNCTION calendar( oGet )
//------------------------------------------------------------------------------
LOCAL oWnd, oCal, aRect, w, h, x, y, cps
//LOCAL fecha := IF( isFecha(oGet:cText()), CTOD( oGet:cText() ), DATE() )
LOCAL fecha := DATE()
LOCAL dHoy := fecha, lOk := .F., lLostFocus := .F., n := 0
IF isAppthemed()
w := 224; h := 159
ELSE
w := 174; h := 150
ENDIF
aRect := getWndRect( oGet:hWnd )
y := aRect[1] + oGet:nHeight
x := aRect[2]
DEFINE WINDOW oWnd OF oGet:oWnd FROM y, x TO y + h, x + w PIXEL STYLE nOR( WS_CHILD, WS_POPUP, WS_VISIBLE )
@ 0, 0 CALENDAR oCal VAR dHoy OF oWnd PIXEL size h,w DBLCLICK ( lOk := .T., oWnd:end() ) //87,75
oWnd:oClient := oCal
oCal:bKeyDown := {|nkey| IF( nKey = 13 .OR. nKey = 32, ( lOk := .T., oWnd:end() ), ) }
oWnd:bKeyDown := {|nkey| IF( GetKeyState( VK_ESCAPE ), ( lLostFocus := .T., oWnd:end() ), ) }
oCal:bLostFocus := {|| oWnd:END() }
ACTIVATE WINDOW oWnd;
ON INIT ( oWnd:move(aRect[1] + oGet:nHeight ,aRect[2] ),;
oCal:setFocus() ) ;
VALID IF( ! lLostFocus .AND. lOk .AND. ! GetKeyState( VK_ESCAPE ), ;
( oGet:cText := dHoy, oGet:refresh(), oGet:setfocus(), .T. ),;
( oGet:setFocus(), .T. ) )
RETURN NIL
Code: Select all
FUNCTION MAIN()
LOCAL oDlg, g, d := DATE()
DEFINE DIALOG oDlg FROM 10,10 To 20,20
@ 1,1 GET g VAR d ACTION calendar(self) ON INIT ::lKeepFocus := .F.
ACTIVATE DIALOG oDlg
RETURN NIL
-
- Posts: 454
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
Re: TCalendar
REDEFINE GET DATE1 ID 102 OF odlg;
ACTION cal( DATE1, self )
FUNCTION cal( date1, oGet )
LOCAL odlg, oCal, aRect
LOCAL lOk := .f.
aRect := getWndRect( oGet:hWnd )
DEFINE DIALOG odlg FROM 0,0 TO 145,265 PIXEL STYLE nor( WS_POPUP,WS_VISIBLE,WS_BORDER)
//150, 174
@-10,-10 CALENDAR oCal VAR date1 OF odlg PIXEL DAYSTATE SIZE 150,89 DBLCLICK (lok:=.t.,odlg:end())
// 155,160
//87,75
oCal:bKeyDown := {|nkey| IF( nKey = 13 .OR. nKey = 32, (lok:=.t.,odlg:end()), ) }
odlg:oClient := oCal
ACTIVATE DIALOG odlg ON INIT (ocal:show(),odlg:move(aRect[1] + oGet:nHeight ,aRect[2])) ;
VALID IF( lOk .AND. ! GetKeyState( VK_ESCAPE ), (oGet:cText := date1, oGet:refresh(), .T. ), .t. )
RETURN NIL
ACTION cal( DATE1, self )
FUNCTION cal( date1, oGet )
LOCAL odlg, oCal, aRect
LOCAL lOk := .f.
aRect := getWndRect( oGet:hWnd )
DEFINE DIALOG odlg FROM 0,0 TO 145,265 PIXEL STYLE nor( WS_POPUP,WS_VISIBLE,WS_BORDER)
//150, 174
@-10,-10 CALENDAR oCal VAR date1 OF odlg PIXEL DAYSTATE SIZE 150,89 DBLCLICK (lok:=.t.,odlg:end())
// 155,160
//87,75
oCal:bKeyDown := {|nkey| IF( nKey = 13 .OR. nKey = 32, (lok:=.t.,odlg:end()), ) }
odlg:oClient := oCal
ACTIVATE DIALOG odlg ON INIT (ocal:show(),odlg:move(aRect[1] + oGet:nHeight ,aRect[2])) ;
VALID IF( lOk .AND. ! GetKeyState( VK_ESCAPE ), (oGet:cText := date1, oGet:refresh(), .T. ), .t. )
RETURN NIL
- Uwe.Diemer
- Posts: 81
- Joined: Mon Aug 09, 2010 11:00 am
Re: TCalendar
Thanks for this usefull post and the detailed Informations about the Crash
try another username with more than 4 Letters "Eoeo""Fasi" perhaps 5 Letters like "IDI.T"
try another username with more than 4 Letters "Eoeo""Fasi" perhaps 5 Letters like "IDI.T"
Re: TCalendar
Uwe.Diemer wrote:Thanks for this usefull post and the detailed Informations about the Crash
try another username with more than 4 Letters "Eoeo""Fasi" perhaps 5 Letters like "IDI.T"
Uwe,
For me this help is important, the test crash on Win Seven then....
I not understood Antonio give YOU the authorization to offend allways my personal freedom!!!
I am on the gap for a long time while there are people as YOU who make smart and have just started to use Fivewin !!!!
eoeo is the name of my website www.eoeo.it
- David Williams
- Posts: 82
- Joined: Fri Mar 03, 2006 6:26 pm
- Location: Ireland
Re: TCalendar
Thank you all for your suggestions. I opted for Shuming's code and I have now developed the calendar for my application.
OT. Has anyone developed a Golf Tee Booking System or has there been an update on Daniel García Gil's Outlook Appointments?
Many thanks
David
OT. Has anyone developed a Golf Tee Booking System or has there been an update on Daniel García Gil's Outlook Appointments?
Many thanks
David