MH42 / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 0 forks source link

style appointments in month view #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a new Calendar(settings)
2. calendar.setView(CalendarViews.MONTH)
3. add an appointment with a set css style

What is the expected output? What do you see instead?

actual The appointment rendered in the month view only has a css "appointment"

expected The appointment render the in the month view should have the css style 
the 
appointment specfies

What version of the product are you using? On what operating system?

0.9 branch on osx snow leopard

Please provide any additional information below.

This seems like a one line fix in MonthView.java

MonthView#layOnAppointment(Appointment appointment, int colStart,int colEnd, 
int row, int 
cellPosition) {

...
panel.setStyleName("appointment"); // should change to 
panel.setStyleName(appointment.getStyle());
..
}

Original issue reported on code.google.com by d.tang...@gmail.com on 8 Feb 2010 at 8:22

GoogleCodeExporter commented 9 years ago
I am making *major* changes to how styles are handled in gwt-cal, and I 
released this
to the branch code last week.

In gwt-cal, appointments will no longer use style names (i.e 
gwt-appointment-blue).
The style sheets were getting crazy large, extremely difficult to manage, and
monthView styles didn't work in ie6/7

So now what you need to do is the following:
appointment.setAppointmentStyle(AppointmentStyles.BLUE);

This will cause the monthView appointments to use inline style for the color 
themes -
example <div class='appointment' style='background-color:[blue]; 
border-color:[dark
blue]; color:[white]">

I am not done testing but this seems to work fine with the month view, and is 
pending
integration with the Day View.

Custom styles will still be possible by subclassing your own AppointmentStyle 
...
appointment.setAppointmentStyle(new MyAppointmentStyle());

Original comment by Brad.Ryd...@gmail.com on 8 Feb 2010 at 9:27

GoogleCodeExporter commented 9 years ago
cool. Would it be possible to have AppointmentStyle implement Serializable so 
gwt can serialize it?

Original comment by d.tang...@gmail.com on 8 Feb 2010 at 10:37

GoogleCodeExporter commented 9 years ago

Original comment by Brad.Ryd...@gmail.com on 15 Feb 2010 at 6:02

GoogleCodeExporter commented 9 years ago
I changed how styles are handled yet again. We now use the AppointmentStyle 
enumeration. Example: appointment.setStyle(AppointmentStyle.BLUE);

Since it is an enumeration and does not use any gwt-specific classes it should 
be 
serializable. Let us know if you still experience issues.

Original comment by Brad.Ryd...@gmail.com on 29 Mar 2010 at 2:50