Commit 0bb2e5ab authored by Alexandre Julliard's avatar Alexandre Julliard

Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbeyj@wpi.edu>

Implemented current day circling. Fixed many bugs in the month calender control including control spacing and alignment. Fixed defines monthcal.h. Optimized control drawing and removed many extranious redraws. Improved control behavior. Fixed inconsistent formatting in both .c and .h files.
parent 87bff28c
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
#include "windef.h" #include "windef.h"
#include "wingdi.h" #include "wingdi.h"
#define MC_SEL_LBUTUP 0 /* Left button released */
#define MC_SEL_LBUTDOWN 1 /* Left button pressed in calendar */ #define MC_SEL_LBUTUP 1 /* Left button released */
#define MC_PREVPRESSED 1 /* Prev month button pressed */ #define MC_SEL_LBUTDOWN 2 /* Left button pressed in calendar */
#define MC_NEXTPRESSED 2 /* Next month button pressed */ #define MC_PREVPRESSED 4 /* Prev month button pressed */
#define MC_NEXTMONTHDELAY 500 /* when continuously pressing `next */ #define MC_NEXTPRESSED 8 /* Next month button pressed */
#define MC_NEXTMONTHDELAY 350 /* when continuously pressing `next */
/* month', wait 500 ms before going */ /* month', wait 500 ms before going */
/* to the next month */ /* to the next month */
#define MC_NEXTMONTHTIMER 1 /* Timer ID's */ #define MC_NEXTMONTHTIMER 1 /* Timer ID's */
...@@ -24,47 +25,51 @@ ...@@ -24,47 +25,51 @@
typedef struct tagMONTHCAL_INFO typedef struct tagMONTHCAL_INFO
{ {
COLORREF bk; COLORREF bk;
COLORREF txt; COLORREF txt;
COLORREF titlebk; COLORREF titlebk;
COLORREF titletxt; COLORREF titletxt;
COLORREF monthbk; COLORREF monthbk;
COLORREF trailingtxt; COLORREF trailingtxt;
HFONT hFont; HFONT hFont;
HFONT hBoldFont; HFONT hBoldFont;
int textHeight; int textHeight;
int textWidth; int textWidth;
int firstDayplace; /* place of the first day of the current month */ int height_increment;
int delta; /* scroll rate; # of months that the */ int width_increment;
/* control moves when user clicks a scroll button */ int left_offset;
int visible; /* # of months visible */ int top_offset;
int firstDay; /* Start month calendar with firstDay's day */ int firstDayplace; /* place of the first day of the current month */
int monthRange; int delta; /* scroll rate; # of months that the */
MONTHDAYSTATE *monthdayState; /* control moves when user clicks a scroll button */
SYSTEMTIME todaysDate; int visible; /* # of months visible */
DWORD currentMonth; int firstDay; /* Start month calendar with firstDay's day */
DWORD currentYear; int monthRange;
int status; /* See MC_SEL flags */ MONTHDAYSTATE *monthdayState;
int curSelDay; /* current selected day */ SYSTEMTIME todaysDate;
int firstSelDay; /* first selected day */ DWORD currentMonth;
int maxSelCount; DWORD currentYear;
SYSTEMTIME minSel; int status; /* See MC_SEL flags */
SYSTEMTIME maxSel; int curSelDay; /* current selected day */
DWORD rangeValid; int firstSelDay; /* first selected day */
SYSTEMTIME minDate; int maxSelCount;
SYSTEMTIME maxDate; SYSTEMTIME minSel;
SYSTEMTIME maxSel;
DWORD rangeValid;
SYSTEMTIME minDate;
SYSTEMTIME maxDate;
RECT rcClient; /* rect for whole client area */ RECT rcClient; /* rect for whole client area */
RECT title; /* rect for the header above the calendar */ RECT title; /* rect for the header above the calendar */
RECT titlebtnnext; /* the `next month' button in the header */ RECT titlebtnnext; /* the `next month' button in the header */
RECT titlebtnprev; /* the `prev month' button in the header */ RECT titlebtnprev; /* the `prev month' button in the header */
RECT titlemonth; /* the `month name' txt in the header */ RECT titlemonth; /* the `month name' txt in the header */
RECT titleyear; /* the `year number' txt in the header */ RECT titleyear; /* the `year number' txt in the header */
RECT prevmonth; /* day numbers of the previous month */ RECT prevmonth; /* day numbers of the previous month */
RECT nextmonth; /* day numbers of the next month */ RECT nextmonth; /* day numbers of the next month */
RECT days; /* week numbers at left side */ RECT days; /* week numbers at left side */
RECT weeknums; /* week numbers at left side */ RECT weeknums; /* week numbers at left side */
RECT today; /* `today: xx/xx/xx' text rect */ RECT today; /* `today: xx/xx/xx' text rect */
} MONTHCAL_INFO, *LPMONTHCAL_INFO; } MONTHCAL_INFO, *LPMONTHCAL_INFO;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment