Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #12896
| From | "Urs Eggmann" <Urs.Eggmann@shinternet.ch> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: calendar controll |
| Date | 2020-03-03 23:01 +0100 |
| Message-ID | <hc83hoFg791U1@mid.individual.net> (permalink) |
| References | <49aaabb2-544a-4709-8705-94784696e717@googlegroups.com> <ee761b22-cb83-4290-bf44-c123087a53b6@googlegroups.com> |
Hi Aurora,
The colors of the day-numbers is set in the method DrawDays(...)
There I inserted two pieces ocode, that changes the color to red.
regards
Urs
New method:
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
* 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
SELF:dFirst := ConDate(Year(dDatum),Month(dDatum),1 )
dDate := SELF:dFirst - 1 // Startdate für das Array aDays
// Letzter Tag des Monats
SELF:dLast := SELF:LastDayofMonth(dDatum)
dDateForWeekCalc := SELF:dFirst // Datum zur Berechnung der Woche.
// Anzahl Tage im Monat
nDays := SELF:dLast - SELF:dFirst+1
// In welcher Kolonne (== Wochentag) startet die Tabelle?
nColBegin := nCol := DoWGer(SELF:dFirst ) // Montag als erster Tag der Woche
(VO hat den Sonntag....)
// Die Reihe ist immer die erste
nRow := 1
FOR i := 1 TO nDays
// Rechteck für die Woche des Monats
// Wird mehrfach gerechnet, wäre noch zu verbessern
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)) // Set text color to blue
// Draw the number of week
DrawText(hDC,String2Psz(Str( WeekFeser( dDateForWeekCalc ) ,2,0) )
,2,@rect,DT_CENTER+DT_VCENTER+DT_SINGLELINE)
SetTextColor(hDC, RGB(0,0,0)) // Set text color back to black
// Set the rect for the text
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
***************************** Begin Insert FOR coloring May First with red
IF i == 1 .AND. Month(dDatum) == 5
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** End Insert FOR coloring May First with red
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 Samstag ist....
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
***************************** Begin Insert FOR coloring May First with red
IF i == 1 .AND. Month(dDatum) == 5
SetTextColor(hDC, RGB(250,0,0))
ENDIF
***************************** End Insert FOR coloring May First with red
DrawText(hDC,String2Psz(Str(i,2,0) ),2,@rect,DT_CENTER+DT_VCENTER+DT_SINGLELINE)
SetTextColor(hDC, RGB(0,0,0))
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))
nCol := 0 // Reset nCol
nRow ++
dDateForWeekCalc += 7
ENDIF
nCol ++ //
NEXT i
IF Between(Today() , SELF:dFirst , SELF:dLast)
SELF:FrameCell(Today(),hDC )
ENDIF
RETURN NIL
<aurorabaccio@gmail.com> schrieb im Newsbeitrag
news:ee761b22-cb83-4290-bf44-c123087a53b6@googlegroups.com...
> Il giorno domenica 16 febbraio 2020 11:09:46 UTC+1, aurora...@gmail.com ha
> scritto:
>> sorry my english
>> is there any way to have bigger fonts in calendarcontroll?
>> Thanks
>> aurora baccio
>
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
calendar controll aurorabaccio@gmail.com - 2020-02-16 02:09 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-16 21:30 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-02-17 07:27 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-17 23:31 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-02-18 06:04 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-18 16:34 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-02-18 08:19 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-19 21:28 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-02-19 22:46 -0800
Re: calendar controll aurorabaccio@gmail.com - 2020-02-19 23:02 -0800
Re: calendar controll aurorabaccio@gmail.com - 2020-02-20 04:59 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-22 22:07 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-02-20 05:30 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-22 22:06 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-02-23 05:06 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-24 14:35 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-02-27 05:12 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-27 20:46 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-02-29 06:54 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-02-29 16:45 +0100
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-01 20:41 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-03-02 05:50 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-02 19:19 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-03-03 05:42 -0800
Re: calendar controll aurorabaccio@gmail.com - 2020-03-03 05:52 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-03 23:20 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-03-03 07:33 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-03 23:01 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-03-04 07:22 -0800
Re: calendar controll aurorabaccio@gmail.com - 2020-03-06 05:32 -0800
Re: calendar controll aurorabaccio@gmail.com - 2020-03-06 05:48 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-06 22:14 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-03-06 05:54 -0800
Re: calendar controll aurorabaccio@gmail.com - 2020-03-06 23:44 -0800
Re: calendar controll aurorabaccio@gmail.com - 2020-03-07 06:04 -0800
Re: calendar controll "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2020-03-07 15:54 +0100
Re: calendar controll aurorabaccio@gmail.com - 2020-03-07 07:37 -0800
csiph-web