Page 3 of 7

Re: Outlook Calendar (prototype)

PostPosted: Sat Jan 29, 2011 9:54 am
by Maurizio
Daniel and Crespo

a very good job , I have tested it and this my first improvement .

Maurizio
http://www.nipeservice.com


Image

Re: Outlook Calendar (prototype)

PostPosted: Sat Jan 29, 2011 10:24 am
by MdaSolution
can you explain us how you insert a new record and create box color into ?
Do you use mouse move or not ?

Re: Outlook Calendar (prototype)

PostPosted: Sat Jan 29, 2011 7:56 pm
by James Bott
Maurizio,

Please describe the changes you made.

Regards,
James

Re: Outlook Calendar (prototype)

PostPosted: Mon Jan 31, 2011 8:09 am
by Maurizio
Hello James

In the method ::oCalex:LoadDates you cann specify the color

nColorText and aGrad

::oCalex:LoadDates( ( ::cAlias )->START,;
( ::cAlias )->END, ;
( ::cAlias )->DSTART, ;
( ::cAlias )->DEND, ;
( ::cAlias )->TEXT, ;
( ::cAlias )->SUBJECT ,;
nColorText,;
{ { 1.00,aGrad,16777215 },{ 0.00,16777215,aGrad } };
)


You cann use this for call a Dialog

::oCalex:bLDblClick := {|nRow, nCol, nKeyFlags | ::Dialog(nRow, nCol, nKeyFlags)}

in the Dialog you have the value

::oCalex:oCalInfo:nStart
::oCalex:oCalInfo:nEnd
::oCalex:oCalInfo:dStart
::oCalex:oCalInfo:dEnd


Regards Maurizio

Re: Outlook Calendar (prototype)

PostPosted: Mon Jan 31, 2011 9:08 am
by MdaSolution
Sorry,
but I add a method Dialog_InS(nRow, nCol, nKeyFlags) to SampleCalex

and I insert this row at buildcalex method line 162
::oCalex:bLDblClick := {|nRow, nCol, nKeyFlags |::Dialog_InS(nRow, nCol, nKeyFlags)}
before of ::oPanelCalex:oClient = ::oCalex

on Dialog_Ins method I insert only these lines :

METHOD Dialog_InS(nRow, nCol, nKeyFlags) CLASS SampleCalex
?"w"
msginfo(::oCalex:oCalInfo:nStart)
msginfo(::oCalex:oCalInfo:nEnd )
msginfo(dtoc(::oCalex:oCalInfo:dStart))
msginfo(::oCalex:oCalInfo:dEnd)


RETURN nil

when I click o n a cell it make this error

Error description: Error BASE/1004 Class: 'NIL' has no exported method: NSTART


where is the error ?

Re: Outlook Calendar (prototype)

PostPosted: Mon Jan 31, 2011 9:15 am
by MdaSolution
I can see only these variables :
oView:dDate
oView:nStartHour
oView:nEndHour

Re: Outlook Calendar (prototype)

PostPosted: Mon Jan 31, 2011 9:31 am
by MdaSolution
NOT RUN !!!
MAKE ERROR!!


METHOD Dialog_InS(nRow, nCol, nKeyFlags) CLASS SampleCalex

Local oFrmIns
Local cIniFecha
Local cFinFecha
Local cIniTime
Local cFinTime

Local oGet[4]

cIniFecha := ::oCalex:oCalInfo:dStart
cFinFecha := ::oCalex:oCalInfo:dEnd
cIniTime := ::oCalex:oCalInfo:nStart
cFinTime := ::oCalex:oCalInfo:nEnd


DEFINE DIALOG oFrmIns

@ 5, 3 SAY "&Date:" SIZE 25, 7 PIXEL OF oFrmIns COLOR 0, 14215660
@ 4, 42 GET oGet[1] VAR cIniFecha SIZE 30, 10 PIXEL OF oFrmIns


ACTIVATE DIALOG oFrmIns

RETURN nil

Re: Outlook Calendar (prototype)

PostPosted: Tue Feb 01, 2011 9:06 am
by MdaSolution
Daniel or Reinaldo,
Can You tell us How Make it Please ?

Re: Outlook Calendar (prototype)

PostPosted: Fri Feb 04, 2011 8:54 am
by Andrés González
Mdasolution, you code works perfectly. I add just the code and no problems, it just show all the data when we dobleclick in an appointment.

Someone knows how to start the calendar in Monday or what I have to modify for it ?

Thanks.

Re: Outlook Calendar (prototype)

PostPosted: Fri Feb 04, 2011 11:06 am
by Maurizio
Hello

Modify METHOD PaintHeader

dFirstDateWeek += 1

Regards Maurizio
www.nipeservice.com

Re: Outlook Calendar (prototype)

PostPosted: Fri Feb 04, 2011 11:50 am
by Andrés González
Thanks Maurizio working perfectly.

Re: Outlook Calendar (prototype)

PostPosted: Sat Feb 05, 2011 11:05 am
by Silvio
run ok for me thanks Mda and Maurizio

how I can have the subject field ?

this for modfy a record

and to insert a new record do you found a solution ?

Re: Outlook Calendar (prototype)

PostPosted: Sat Feb 05, 2011 11:14 am
by Silvio
Maurizio,
I made on
METHOD GetFirstDateWeek() CLASS TCalEx

if ::Classname() != "TDAYVIEW" .or. ::Classname() != "TMonthView"
dFirstDateWeek += 1
endif


it run only for TDAYVIEW but not for tmonthview

Re: Outlook Calendar (prototype)

PostPosted: Sat Feb 05, 2011 11:28 am
by Silvio
HOW i CAN MAKE TO SHOW ON TDAYVIEW

FROM 00:00 TO 24:00 ?

AND THE SAME FOR THE WEEK

THANKS

Re: Outlook Calendar (prototype)

PostPosted: Sat Feb 05, 2011 12:10 pm
by Silvio
For all :

New two methods to insert to CLASS TCalEx

METHOD RButtonDown( nRow, nCol, nKeyFlags )

it create a simply menu popup with these operation

call a function to insert or modifiy a record
Set a date
Go to a date
set Interval

as you can see on this picture

Image

Write YOur impressions!!


Code: Select all  Expand view


  METHOD RButtonDown( nRow, nCol, nKeyFlags )  CLASS TCalEx

     Local oMenu
     Local oThis  := self

     if ::Classname() != "TDAYVIEW" .or. ::Classname() != "TWEEKVIEW"

 if ::bRClicked != nil
   return Eval( ::bRClicked, nRow, nCol, nKeyFlags, Self )
endif


MENU oMenu POPUP
MENUITEM "New appointment" ACTION msginfo("New Record")
MENUITEM "Today"           ACTION (::SetDate( date() )   ,::oDayView:refresh())
MENUITEM "Go to date "     ACTION (::GotoDate(nRow, nCol) ,::oDayView:refresh())

MENUITEM "Interval"
MENU
   MENUITEM "5 minutes"   ACTION (::oDayView:SetInterval( 5 )  ,::oDayView:refresh())
   MENUITEM "10 minutes"  ACTION (::oDayView:SetInterval( 10 ) ,::oDayView:refresh())
   MENUITEM "15 minutes"  ACTION (::oDayView:SetInterval( 15 ) ,::oDayView:refresh())
   MENUITEM "20 minutes"  ACTION (::oDayView:SetInterval( 20 ) ,::oDayView:refresh())
   MENUITEM "30 minutes"  ACTION (::oDayView:SetInterval( 30 ) ,::oDayView:refresh())
   MENUITEM "60 minutes"  ACTION (::oDayView:SetInterval( 60 ) ,::oDayView:refresh())
   ENDMENU
ENDMENU
ACTIVATE POPUP oMenu OF oThis AT nRow, nCol
ENDIF

return nil

#include "dtpicker.ch"

 METHOD GotoDate()   CLASS TCalEx     //add by silvio
   LOCAL oDlg, oGet, lChg:=.F. ,oBut[2]
   LOCAL dDate:=Date()
   DEFINE DIALOG oDlg SIZE 210,80  TITLE "Go to a date"
   @ 0.8,2  DTPICKER  oGet VAR dDate  OF oDlg  SIZE 80,10;
                    ON CHANGE oGet:Refresh()
     @ 0.2, 2 SAY "Select a new date"   OF oDlg  SIZE 80,7
     @  28,    2 BUTTON oBut[1]   Prompt "&Confirm"   SIZE  30,  10 PIXEL OF oDlg ACTION (lChg:=.T.,oDlg:End())
     @  28,  35 BUTTON oBut[2]   Prompt "Ca&ncel"   SIZE  30,  10 PIXEL OF oDlg ACTION (lChg:=.F.,oDlg:End()) CANCEL
   ACTIVATE DIALOG oDlg CENTER
   IF lChg
      ::SetDate(dDate)
   ENDIF
   RETURN (NIL)