Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #12930

Re: cccalendar

From "Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: cccalendar
Date 2020-03-14 22:21 +0100
Message-ID <hd51tnFj48vU1@mid.individual.net> (permalink)
References <60fa3510-d017-4200-8059-cf690e3ee833@googlegroups.com> <6e977778-931d-4f1a-bc85-037f5a65771b@googlegroups.com>

Show all headers | View raw


Ciao, Aurora,
Ho scritto questo testo in tedesco, come ha suggerito Karl e poi l'ho 
tradotto. prova anche questo.

Per favore inviatemi il dbf con le vacanze al mio indirizzo e-mail. Proverò 
poi qualcosa con il metodo MouseButtonDoubleclick.
Saluti
Urs

"aurora baccio" <aurorabaccio@gmail.com> schrieb im Newsbeitrag 
news:6e977778-931d-4f1a-bc85-037f5a65771b@googlegroups.com...
Il giorno lunedì 9 marzo 2020 18:02:34 UTC+1, aurora baccio ha scritto:
> Good evening,
> I have turned cccalendar into a bookshop and am looking for an agenda.
> I can't get the Easter calculation to work. It gives me the year 2000.
> in the CalendarNuovo_Maschera class I inserted export odccusCalendar and 
> in initi of the same class I launched the Feiertage () method.
> What is missing ?
> Thank you
> auraro baccio

METHOD DrawDays( hDC , dDatum ) CLASS ccCalendar // Metodo con sabato 
colorato

LOCAL nDays, nCol, nRow , nColBegin ,i as int
* LOCAL nIndex AS INT
LOCAL rect is _WINRECT
LOCAL dDateForWeekCalc, dDate as date
local DataDiPasqua := self:dOstern as date
* nBeginn := timeGetTime() // Für Zeitmessungen während der Entwicklung

SetBkMode(hDC, TRANSPARENT) // Sonst stehen die Tage auf kleinen weissen 
Rechteckchen...
SelectObject(hDC , self:oFont_actual:Handle() )

self:aDays := {} // Array mit Tag, Column, Row und Index für die grafischen 
Spielereien
// Erster Tag des Monats Primo giorno del mese
self:dFirst := ConDate(Year(dDatum),Month(dDatum),1 )
dDate := self:dFirst - 1 // Startdate für das Array aDays   Data di inizio 
dell'array aDays

// Letzter Tag des Monats  L'ultimo giorno del mese
self:dLast := self:LastDayofMonth(dDatum)
dDateForWeekCalc := self:dFirst // Datum zur Berechnung der Woche.

// Anzahl Tage im Monat  Numero di giorni al mese
nDays := self:dLast - self:dFirst+1

// In welcher Kolonne (== Wochentag) startet die Tabelle?    In quale 
colonna (== giorno della settimana) inizia la tabella?
nColBegin := nCol := DoWGer(self:dFirst ) // Montag als erster Tag der Woche 
(VO hat den Sonntag....)

// Die Reihe ist immer die erste   La riga è sempre la prima
nRow := 1

FOR i := 1 to nDays
// Rechteck für die Woche des Monats
// Wird mehrfach gerechnet, wäre noch zu verbessern
// Rettangolo per la settimana del mese
// Se ci sono più calcoli, c'è ancora spazio per miglioramenti
rect.left :=0
rect.top := 35 + nRow * self:nHoeheRechteck
rect.right := rect.left+self:nBreiteRechteck
rect.bottom := rect.top +self:nHoeheRechteck - 2 // minus 2, sonst ist das 
Grid weg....
SetTextColor(hDC, RGB(0,0,255))

// Draw the number of week                 Disegna il numero della settimana
DrawText(hDC,String2Psz(Str( WeekFeser( dDateForWeekCalc ) ,2,0) ) 
,2,@rect,DT_CENTER+DT_VCENTER+DT_SINGLELINE)

// Set the rect for the text     Imposta il rettangolo per il testo
rect.left :=nCol * self:nBreiteRechteck
rect.top := 35 + nRow * self:nHoeheRechteck
rect.right := rect.left + self:nBreiteRechteck
rect.bottom := rect.top+self:nHoeheRechteck

// Draw the text     Disegna il testo
SetTextColor(hDC, RGB(0,0,0))
***************************** festa del 1 gennaio
IF i == 1 .and. Month(dDatum) == 1
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 6 gennaio
IF i == 6 .and. Month(dDatum) == 1
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 25 aprile
IF i == 25 .and. Month(dDatum) == 4
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 1 maggio
IF i == 1 .and. Month(dDatum) == 5
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 2 giugno
if i==2 .and.Month(dDatum)==6
SetTextColor(hDC, RGB(250,0,0))
endif
***************************** festa del 15 agosto
IF i == 15 .and. Month(dDatum) == 8
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 1 novembre
IF i == 1 .and. Month(dDatum) == 11
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 8 dicembre
IF i ==8 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 13 dicembre santa lucia patrona da 
siracusa
IF i == 13 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 25 dicembre santo natale
IF i == 25 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 26 dicembre santo stefano
IF i == 26 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 26 dicembre santo stefano
IF i == Day(DataDiPasqua)+1 .and. Month(dDatum) == Month(DataDiPasqua)
SetTextColor(hDC, RGB(250,0,0))
ENDIF
****************************************************************************
DrawText(hDC,String2Psz(Str(i,2,0) ),2,@rect,DT_CENTER+DT_VCENTER+DT_SINGLELINE)

// nIndex := ( nRow - 1) * 7 + nCol
AAdd (self:aDays , { i , nCol , nRow, ( nRow - 1) * 7 + nCol , dDate + i } )
// "Universal-Array für Tage, Spalten, Reihen und Datums des Monats
* ? i , " " , nCol , " " , nRow , " " , ( nRow - 1) * 7 + nCol
// Quando è sabato ... // Wenn es Sonntag ist....
* IF Mod( nCol , 6 ) == 0
IF nCol == 6
SetTextColor(hDC, RGB(0,200,200))
rect.left := nCol * self:nBreiteRechteck
rect.top := 35 + nRow * self:nHoeheRechteck
rect.right := rect.left + self:nBreiteRechteck
rect.bottom := rect.top + self:nHoeheRechteck

*DrawText(hDC,String2Psz(Str(i,2,0) ),2,@rect,DT_CENTER+DT_VCENTER+DT_SINGLELINE)
SetTextColor(hDC, RGB(0,0,0))
***************************** festa del 1 gennaio
IF i == 1 .and. Month(dDatum) == 1
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 6 gennaio
IF i == 6 .and. Month(dDatum) == 1
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 25 aprile
IF i == 25 .and. Month(dDatum) == 4
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 1 maggio
IF i == 1 .and. Month(dDatum) == 5
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 2 giugno
if i==2 .and.Month(dDatum)==6
SetTextColor(hDC, RGB(250,0,0))
endif
***************************** festa del 15 agosto
IF i == 15 .and. Month(dDatum) == 8
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 1 novembre
IF i == 1 .and. Month(dDatum) == 11
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 8 dicembre
IF i ==8  .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 13 dicembre santa lucia patrona da 
siracusa
IF i == 13 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 25 dicembre santo natale
IF i == 25 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 26 dicembre santo stefano
IF i == 26 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
****************************************************************************
DrawText(hDC,String2Psz(Str(i,2,0) ),2,@rect,DT_CENTER+DT_VCENTER+DT_SINGLELINE)

ELSEIF nCol == 7 // Quando è domenica ... // Wenn es Sonntag ist....
SetTextColor(hDC, RGB(255,0,0))
rect.left := nCol * self:nBreiteRechteck
rect.top := 35 + nRow * self:nHoeheRechteck
rect.right := rect.left + self:nBreiteRechteck
rect.bottom := rect.top + self:nHoeheRechteck
DrawText(hDC,String2Psz(Str(i,2,0) ),2,@rect,DT_CENTER+DT_VCENTER+DT_SINGLELINE)
SetTextColor(hDC, RGB(0,0,0))
***************************** festa del 1 gennaio
IF i == 1 .and. Month(dDatum) == 1
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 6 gennaio
IF i == 6 .and. Month(dDatum) == 1
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 25 aprile
IF i == 25 .and. Month(dDatum) == 4
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 1 maggio
IF i == 1 .and. Month(dDatum) == 5
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 2 giugno
if i==2 .and.Month(dDatum)==6
SetTextColor(hDC, RGB(250,0,0))
endif
***************************** festa del 15 agosto
IF i == 15 .and. Month(dDatum) == 8
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 1 novembre
IF i == 1 .and. Month(dDatum) == 11
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 8 dicembre
IF i ==8  .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 13 dicembre santa lucia patrona da 
siracusa
IF i == 13 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 25 dicembre santo natale
IF i == 25 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** festa del 26 dicembre santo stefano
IF i == 26 .and. Month(dDatum) == 12
SetTextColor(hDC, RGB(250,0,0))
ENDIF
****************************************************************************
nCol := 0 // Reset nCol
nRow ++
dDateForWeekCalc += 7
ENDIF
nCol ++ //
NEXT i
IF Between(Today() , self:dFirst , self:dLast)
self:FrameCell(Today(),hDC )
ENDIF

* ShowArray(SELF:aDays)
* nEnde := timeGetTime()
* ? nDauer := nEnde - nBeginn , ' milliSec'

RETURN nil

attached in drawdays method modified according to your instructions. as you 
can see, not only national holidays but also Easter Monday are marked in 
red.
now from the method doubleclick I have to select the agenda that interests 
me to open but first I have to know if the selected day is a working day or 
not.
To do this I have to read an external .dbf to cccalendar (if the 'festive' 
field is marked 'F' then on that day you do not work and a message appears 
to that effect).
I can't create this procedure.
Thank you
aurora baccio 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

cccalendar aurora baccio <aurorabaccio@gmail.com> - 2020-03-09 10:02 -0700
  Re: cccalendar "Glen Townsley" <coogee.2015@gmail.com> - 2020-03-10 04:03 +1000
  Re: cccalendar "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-09 21:51 +0100
  Re: cccalendar aurora baccio <aurorabaccio@gmail.com> - 2020-03-11 06:40 -0700
    Re: cccalendar "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-11 22:28 +0100
  Re: cccalendar aurora baccio <aurorabaccio@gmail.com> - 2020-03-12 00:15 -0700
  Re: cccalendar aurora baccio <aurorabaccio@gmail.com> - 2020-03-12 07:10 -0700
    Re: cccalendar "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-12 20:20 +0100
      Re: cccalendar Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2020-03-12 23:05 +0100
        Re: cccalendar "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-13 20:59 +0100
  Re: cccalendar aurora baccio <aurorabaccio@gmail.com> - 2020-03-14 01:12 -0700
    Re: cccalendar "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-14 22:21 +0100
      Re: cccalendar aurora baccio <aurorabaccio@gmail.com> - 2020-03-15 01:38 -0700
  Re: cccalendar aurora baccio <aurorabaccio@gmail.com> - 2020-03-22 02:15 -0700
    Re: cccalendar "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-22 16:12 +0100

csiph-web