mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
WIP: Multi-User View. Move calxml UI files to UI tree
This commit is contained in:
parent
4fa50cdcb6
commit
e1f6dee9d4
@ -52,7 +52,7 @@ nsresult nsCalendarModel::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIModelIID)) {
|
||||
*aInstancePtr = (void*) (this);
|
||||
*aInstancePtr = (void*)(nsIModel*) (this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -11,5 +11,5 @@ GDEPTH = ../../../..
|
||||
DEPTH = ../../../..
|
||||
|
||||
DIRS_EXPORT = inc
|
||||
DIRS_LIBS = src res
|
||||
DIRS_LIBS = src
|
||||
|
||||
|
@ -610,9 +610,10 @@ nsresult nsCalendarContainer::LoadURL(const nsString& aURLSpec,
|
||||
* Begin a calendar for the logged in user...
|
||||
*/
|
||||
|
||||
NSCalendar * pCalendar = new NSCalendar(0);
|
||||
|
||||
NSCalendar * pCalendar;
|
||||
|
||||
pLayer->GetCal(pCalendar);
|
||||
|
||||
switch(theURL.GetProtocol())
|
||||
{
|
||||
case nsCurlParser::eFILE:
|
||||
@ -628,7 +629,6 @@ nsresult nsCalendarContainer::LoadURL(const nsString& aURLSpec,
|
||||
NS_ASSERTION(0 != pLayer,"null pLayer");
|
||||
pLayer->SetShell(shell);
|
||||
pLayer->FetchEventsByRange(&d,&d1,&EventList);
|
||||
pLayer->SetCal(pCalendar);
|
||||
pCalendar->addEventList(&EventList);
|
||||
}
|
||||
break;
|
||||
@ -638,7 +638,7 @@ nsresult nsCalendarContainer::LoadURL(const nsString& aURLSpec,
|
||||
/* need to report that this is an unhandled curl type */
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nsICalendarModel * calmodel = nsnull;
|
||||
nsIModel * model = nsnull;
|
||||
@ -655,55 +655,41 @@ nsresult nsCalendarContainer::LoadURL(const nsString& aURLSpec,
|
||||
|
||||
calmodel->SetCalendarUser(caluser);
|
||||
|
||||
calmodel->QueryInterface(kIModelIID, (void**)&model);
|
||||
res = calmodel->QueryInterface(kIModelIID, (void**)&model);
|
||||
|
||||
if (NS_OK != res)
|
||||
return res;
|
||||
|
||||
//mRootCanvas->SetModel(model);
|
||||
/*
|
||||
* find a multi canvas and add one here and then set it's model ... yeehaaa
|
||||
*/
|
||||
|
||||
// XXX: This should probably be done via searching for class type. We also probably
|
||||
// Want the XML for the menubar command to specify specifically the target
|
||||
// canvas for these types of operations.
|
||||
nsString mcstring("MultiCalendarEventWeekView");
|
||||
/*
|
||||
* Send an NewModelCommand to all canvas's....
|
||||
*
|
||||
* This event basically specifies that a new model
|
||||
* needs to be viewed somewhere. Currently, only
|
||||
* the multi canvas handles this
|
||||
*/
|
||||
|
||||
nsCalMultiDayViewCanvas * mc = (nsCalMultiDayViewCanvas *) mRootCanvas->CanvasFromName(mcstring);
|
||||
static NS_DEFINE_IID(kXPFCCommandIID, NS_IXPFC_COMMAND_IID);
|
||||
|
||||
if (nsnull != mc)
|
||||
{
|
||||
nsCalNewModelCommand * command = nsnull;
|
||||
|
||||
/*
|
||||
* Send an NewModelCommand to all canvas's....
|
||||
*
|
||||
* This event basically specifies that a new model
|
||||
* needs to be viewed somewhere. Currently, only
|
||||
* the multi canvas handles this
|
||||
*/
|
||||
res = nsRepository::CreateInstance(kCCalNewModelCommandCID,
|
||||
nsnull,
|
||||
kXPFCCommandIID,
|
||||
(void **)&command);
|
||||
if (NS_OK != res)
|
||||
return res;
|
||||
|
||||
static NS_DEFINE_IID(kXPFCCommandIID, NS_IXPFC_COMMAND_IID);
|
||||
command->Init();
|
||||
|
||||
nsCalNewModelCommand * command = nsnull;
|
||||
command->mModel = model;
|
||||
|
||||
res = nsRepository::CreateInstance(kCCalNewModelCommandCID,
|
||||
nsnull,
|
||||
kXPFCCommandIID,
|
||||
(void **)&command);
|
||||
if (NS_OK != res)
|
||||
return res;
|
||||
|
||||
command->Init();
|
||||
|
||||
command->mModel = model;
|
||||
|
||||
mRootCanvas->BroadcastCommand(*command);
|
||||
|
||||
NS_RELEASE(command);
|
||||
|
||||
}
|
||||
mRootCanvas->BroadcastCommand(*command);
|
||||
|
||||
NS_RELEASE(command);
|
||||
NS_RELEASE(model);
|
||||
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "nsCalTimebarComponentCanvas.h"
|
||||
#include "nsCalTimebarCanvas.h"
|
||||
#include "nsDateTime.h"
|
||||
#include "nsBoxLayout.h"
|
||||
|
||||
class nsCalMultiDayViewCanvas : public nsCalMultiViewCanvas
|
||||
{
|
||||
@ -46,6 +47,9 @@ public:
|
||||
// nsIXPFCCommandReceiver methods
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand);
|
||||
|
||||
private:
|
||||
NS_IMETHOD SetMultiDayLayout(nsLayoutAlignment aLayoutAlignment);
|
||||
|
||||
protected:
|
||||
~nsCalMultiDayViewCanvas();
|
||||
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "nsCalMultiViewCanvas.h"
|
||||
#include "nsCalTimebarCanvas.h"
|
||||
#include "nsDateTime.h"
|
||||
#include "nsIModel.h"
|
||||
#include "nsBoxLayout.h"
|
||||
|
||||
class nsCalMultiUserViewCanvas : public nsCalMultiViewCanvas
|
||||
{
|
||||
@ -35,9 +37,17 @@ public:
|
||||
NS_IMETHOD SetParameter(nsString& aKey, nsString& aValue) ;
|
||||
NS_IMETHOD SetTimeContext(nsICalTimeContext * aContext);
|
||||
|
||||
// nsIXPFCCommandReceiver methods
|
||||
NS_IMETHOD_(nsEventStatus) Action(nsIXPFCCommand * aCommand);
|
||||
|
||||
protected:
|
||||
~nsCalMultiUserViewCanvas();
|
||||
|
||||
private:
|
||||
NS_IMETHOD AddMultiDayView(nsIModel * aModel);
|
||||
NS_IMETHOD SetMultiUserLayout(nsLayoutAlignment aLayoutAlignment);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /* nsCalMultiUserViewCanvas_h___ */
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsICalendarUser.h"
|
||||
#include "nsICalendarModel.h"
|
||||
#include "nsBoxLayout.h"
|
||||
|
||||
#include "datetime.h"
|
||||
#include "ptrarray.h"
|
||||
@ -132,7 +133,7 @@ nsresult nsCalDayViewCanvas::PaintInterval(nsIRenderingContext& aRenderingContex
|
||||
|
||||
aMinorInterval = 4; // XXX: this is a hack, we should specify this in the XML -sman
|
||||
|
||||
if (GetTimeContext()->GetHorizontal() == PR_TRUE)
|
||||
if (((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment() == eLayoutAlignment_horizontal)
|
||||
{
|
||||
rect.x = aStart;
|
||||
rect.width = aSpace;
|
||||
@ -275,7 +276,7 @@ nsEventStatus nsCalDayViewCanvas :: PaintForeground(nsIRenderingContext& aRender
|
||||
|
||||
aRenderingContext.SetColor(mComponentColor);
|
||||
|
||||
if (GetTimeContext()->GetHorizontal() == PR_FALSE)
|
||||
if (((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment() == eLayoutAlignment_vertical)
|
||||
{
|
||||
/*
|
||||
* XXX: Subtract off the modulus of the area. This should not be so hardcoded!
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "nsCalNewModelCommand.h"
|
||||
|
||||
#include "nscalstrings.h"
|
||||
#include "nsxpfcstrings.h"
|
||||
|
||||
|
||||
#define DEFAULT_NUMBER_VIEWABLE_DAYS 5
|
||||
@ -234,6 +235,11 @@ nsIXPFCCanvas * nsCalMultiDayViewCanvas :: AddDayViewCanvas()
|
||||
|
||||
canvas->SetMinimumSize(nsSize(100,100));
|
||||
|
||||
if (eLayoutAlignment_horizontal == la)
|
||||
((nsBoxLayout *)(canvas->GetLayout()))->SetLayoutAlignment(eLayoutAlignment_vertical);
|
||||
else
|
||||
((nsBoxLayout *)(canvas->GetLayout()))->SetLayoutAlignment(eLayoutAlignment_horizontal);
|
||||
|
||||
/*
|
||||
* Add the status View Canvas
|
||||
*/
|
||||
@ -465,11 +471,31 @@ nsresult nsCalMultiDayViewCanvas :: SetParameter(nsString& aKey, nsString& aValu
|
||||
|
||||
SetNumberViewableDays((PRUint32)aValue.ToInteger(&i));
|
||||
|
||||
} else if (aKey.EqualsIgnoreCase(XPFC_STRING_LAYOUT)) {
|
||||
|
||||
// XXX: Layout should implement this interface.
|
||||
// Then, put functionality in the core layout class
|
||||
// to identify the type of layout object needed.
|
||||
|
||||
if (aValue.EqualsIgnoreCase(XPFC_STRING_XBOX)) {
|
||||
((nsBoxLayout *)GetLayout())->SetLayoutAlignment(eLayoutAlignment_horizontal);
|
||||
} else if (aValue.EqualsIgnoreCase(XPFC_STRING_YBOX)) {
|
||||
((nsBoxLayout *)GetLayout())->SetLayoutAlignment(eLayoutAlignment_vertical);
|
||||
}
|
||||
|
||||
SetMultiDayLayout(((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment());
|
||||
|
||||
}
|
||||
|
||||
|
||||
return (nsCalMultiViewCanvas::SetParameter(aKey, aValue));
|
||||
}
|
||||
|
||||
nsresult nsCalMultiDayViewCanvas :: SetMultiDayLayout(nsLayoutAlignment aLayoutAlignment)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call SetContext on all child canvas that support the
|
||||
* nsCalTimebarCanvas interface. This routine is recursive.
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "nsCalNewModelCommand.h"
|
||||
#include "nscalstrings.h"
|
||||
#include "nsxpfcstrings.h"
|
||||
#include "nsCalNewModelCommand.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
@ -88,14 +89,19 @@ nsresult nsCalMultiUserViewCanvas :: Init()
|
||||
/*
|
||||
* create a multiday as a child of us
|
||||
*/
|
||||
nsCalMultiViewCanvas::Init();
|
||||
|
||||
return (AddMultiDayView(nsnull));
|
||||
|
||||
}
|
||||
|
||||
nsresult nsCalMultiUserViewCanvas :: AddMultiDayView(nsIModel * aModel)
|
||||
{
|
||||
static NS_DEFINE_IID(kCalMultiDayViewCanvasCID, NS_CAL_MULTIDAYVIEWCANVAS_CID);
|
||||
static NS_DEFINE_IID(kIXPFCCanvasIID, NS_IXPFC_CANVAS_IID);
|
||||
|
||||
nsCalMultiDayViewCanvas * multi;
|
||||
|
||||
nsresult rv = nsCalMultiViewCanvas::Init();
|
||||
|
||||
|
||||
nsresult res = nsRepository::CreateInstance(kCalMultiDayViewCanvasCID,
|
||||
nsnull,
|
||||
kIXPFCCanvasIID,
|
||||
@ -110,20 +116,25 @@ nsresult nsCalMultiUserViewCanvas :: Init()
|
||||
|
||||
multi->SetShowTimeScale(PR_TRUE);
|
||||
|
||||
nsLayoutAlignment la = ((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment();
|
||||
((nsBoxLayout *)(multi->GetLayout()))->SetLayoutAlignment(la);
|
||||
multi->SetTimeContext(GetTimeContext());
|
||||
|
||||
SetMultiUserLayout(((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment());
|
||||
|
||||
multi->SetNumberViewableDays(1); // XXX
|
||||
|
||||
if (nsnull != aModel)
|
||||
{
|
||||
multi->SetModel(aModel);
|
||||
}
|
||||
|
||||
Layout();
|
||||
|
||||
}
|
||||
|
||||
|
||||
return (rv);
|
||||
return (res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
nsresult nsCalMultiUserViewCanvas :: SetParameter(nsString& aKey, nsString& aValue)
|
||||
{
|
||||
PRInt32 error = 0;
|
||||
@ -145,64 +156,103 @@ nsresult nsCalMultiUserViewCanvas :: SetParameter(nsString& aKey, nsString& aVal
|
||||
// If someone changes our layout, pass it on to any MultiDay canvas
|
||||
// that are our children.
|
||||
|
||||
nsresult res ;
|
||||
nsIIterator * iterator ;
|
||||
nsIXPFCCanvas * canvas ;
|
||||
SetMultiUserLayout(((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment());
|
||||
|
||||
res = CreateIterator(&iterator);
|
||||
|
||||
nsLayoutAlignment la = ((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment();
|
||||
|
||||
if (NS_OK == res)
|
||||
{
|
||||
|
||||
iterator->Init();
|
||||
|
||||
while(!(iterator->IsDone()))
|
||||
{
|
||||
canvas = (nsIXPFCCanvas *) iterator->CurrentItem();
|
||||
|
||||
((nsBoxLayout *)(canvas->GetLayout()))->SetLayoutAlignment(la);
|
||||
|
||||
/*
|
||||
* Now, iterate thru its children and set the layout alignment
|
||||
*/
|
||||
|
||||
{
|
||||
nsIIterator * iterator2 ;
|
||||
|
||||
res = canvas->CreateIterator(&iterator2);
|
||||
|
||||
if (NS_OK == res)
|
||||
{
|
||||
|
||||
iterator2->Init();
|
||||
|
||||
|
||||
while(!(iterator2->IsDone()))
|
||||
{
|
||||
canvas = (nsIXPFCCanvas *) iterator2->CurrentItem();
|
||||
((nsBoxLayout *)(canvas->GetLayout()))->SetLayoutAlignment(la);
|
||||
iterator2->Next();
|
||||
}
|
||||
|
||||
NS_RELEASE(iterator2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
iterator->Next();
|
||||
}
|
||||
|
||||
NS_RELEASE(iterator);
|
||||
}
|
||||
}
|
||||
|
||||
return (nsXPFCCanvas :: SetParameter(aKey, aValue));
|
||||
}
|
||||
|
||||
nsresult nsCalMultiUserViewCanvas :: SetMultiUserLayout(nsLayoutAlignment aLayoutAlignment)
|
||||
{
|
||||
nsresult res ;
|
||||
nsIIterator * iterator ;
|
||||
nsIXPFCCanvas * canvas ;
|
||||
|
||||
res = CreateIterator(&iterator);
|
||||
|
||||
nsLayoutAlignment la = aLayoutAlignment;
|
||||
|
||||
if (NS_OK == res)
|
||||
{
|
||||
|
||||
iterator->Init();
|
||||
|
||||
while(!(iterator->IsDone()))
|
||||
{
|
||||
canvas = (nsIXPFCCanvas *) iterator->CurrentItem();
|
||||
|
||||
((nsBoxLayout *)(canvas->GetLayout()))->SetLayoutAlignment(la);
|
||||
|
||||
/*
|
||||
* Now, iterate thru its children and set the layout alignment
|
||||
*/
|
||||
|
||||
{
|
||||
nsIIterator * iterator2 ;
|
||||
|
||||
res = canvas->CreateIterator(&iterator2);
|
||||
|
||||
if (NS_OK == res)
|
||||
{
|
||||
|
||||
iterator2->Init();
|
||||
|
||||
|
||||
while(!(iterator2->IsDone()))
|
||||
{
|
||||
canvas = (nsIXPFCCanvas *) iterator2->CurrentItem();
|
||||
((nsBoxLayout *)(canvas->GetLayout()))->SetLayoutAlignment(la);
|
||||
iterator2->Next();
|
||||
}
|
||||
|
||||
NS_RELEASE(iterator2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
iterator->Next();
|
||||
}
|
||||
|
||||
NS_RELEASE(iterator);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsCalMultiUserViewCanvas :: SetTimeContext(nsICalTimeContext * aContext)
|
||||
{
|
||||
aContext->SetHorizontal(PR_TRUE); //XXX
|
||||
//aContext->SetHorizontal(PR_TRUE);
|
||||
return (nsCalMultiViewCanvas :: SetTimeContext(aContext));
|
||||
}
|
||||
|
||||
|
||||
nsEventStatus nsCalMultiUserViewCanvas::Action(nsIXPFCCommand * aCommand)
|
||||
{
|
||||
nsresult res;
|
||||
|
||||
nsCalNewModelCommand * newmodel_command = nsnull;
|
||||
static NS_DEFINE_IID(kCalNewModelCommandCID, NS_CAL_NEWMODEL_COMMAND_CID);
|
||||
|
||||
res = aCommand->QueryInterface(kCalNewModelCommandCID,(void**)&newmodel_command);
|
||||
|
||||
if (NS_OK == res)
|
||||
{
|
||||
|
||||
/*
|
||||
* A NewModel Command will Add a new MultiDayView in this MultiUser
|
||||
* canvas, which *clones* the attributes of the other MultiDay views
|
||||
*
|
||||
* For now, let's just limp along by adding it to the list...
|
||||
*/
|
||||
|
||||
AddMultiDayView(newmodel_command->mModel);
|
||||
|
||||
NS_RELEASE(newmodel_command);
|
||||
|
||||
return (nsEventStatus_eConsumeNoDefault);
|
||||
}
|
||||
|
||||
return (nsCalMultiViewCanvas::Action(aCommand));
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nsCalTimebarCanvas.h"
|
||||
#include "nsCalUICIID.h"
|
||||
#include "nsXPFCToolkit.h"
|
||||
#include "nsBoxLayout.h"
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kCalTimebarCanvasCID, NS_CAL_TIMEBARCANVAS_CID);
|
||||
@ -170,7 +171,8 @@ nsEventStatus nsCalTimebarCanvas :: PaintBackground(nsIRenderingContext& aRender
|
||||
|
||||
PRUint32 space_per_interval, start;
|
||||
|
||||
if (GetTimeContext()->GetHorizontal() == PR_TRUE) {
|
||||
if (((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment() == eLayoutAlignment_horizontal)
|
||||
{
|
||||
space_per_interval = ((rect.width-(2*LOCAL_INSET)) - ((rect.width-(2*LOCAL_INSET)) % major_intervals)) / major_intervals;
|
||||
start = rect.x+LOCAL_INSET;
|
||||
} else {
|
||||
@ -208,7 +210,7 @@ nsresult nsCalTimebarCanvas::PaintInterval(nsIRenderingContext& aRenderingContex
|
||||
|
||||
aRenderingContext.SetColor(GetForegroundColor());
|
||||
|
||||
if (GetTimeContext()->GetHorizontal() == PR_TRUE) {
|
||||
if (((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment() == eLayoutAlignment_horizontal) {
|
||||
rect.x = aStart;
|
||||
rect.width = aSpace;
|
||||
aRenderingContext.DrawLine(rect.x, rect.y+LOCAL_INSET, rect.x, rect.y+rect.height-LOCAL_INSET);
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "nsCRT.h"
|
||||
#include "nsIRenderingContext.h"
|
||||
#include "nsIFontMetrics.h"
|
||||
#include "nsBoxLayout.h"
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kCalTimebarScaleCID, NS_CAL_TIMEBARSCALE_CID);
|
||||
@ -113,7 +114,7 @@ nsresult nsCalTimebarScale::PaintInterval(nsIRenderingContext& aRenderingContext
|
||||
|
||||
aMinorInterval = 4; // XXX: this is a hack, we should specify this in the XML -sman
|
||||
|
||||
if (GetTimeContext()->GetHorizontal() == PR_TRUE)
|
||||
if (((nsBoxLayout *)(GetLayout()))->GetLayoutAlignment() == eLayoutAlignment_horizontal)
|
||||
{
|
||||
rect.x = aStart;
|
||||
rect.width = aSpace;
|
||||
|
@ -94,9 +94,6 @@ public:
|
||||
PRUint32 aSecond
|
||||
);
|
||||
|
||||
NS_IMETHOD_(PRBool) GetHorizontal();
|
||||
NS_IMETHOD SetHorizontal(PRBool aHorizontal);
|
||||
|
||||
NS_IMETHOD SetPeriodFormat(nsCalPeriodFormat aPeriodFormat);
|
||||
NS_IMETHOD_(nsCalPeriodFormat) GetPeriodFormat();
|
||||
NS_IMETHOD_(PRUint32) GetVisibleTimeDifference() ;
|
||||
@ -153,7 +150,6 @@ private:
|
||||
nsIDateTime * mMajorIncrement;
|
||||
nsIDateTime * mMinorIncrement;
|
||||
nsCalPeriodFormat mPeriodFormat;
|
||||
PRBool mHorizontal;
|
||||
nsIDateTime * mDate;
|
||||
|
||||
};
|
||||
|
@ -87,10 +87,6 @@ public:
|
||||
PRUint32 aSecond
|
||||
) = 0;
|
||||
|
||||
NS_IMETHOD_(PRBool) GetHorizontal() = 0;
|
||||
NS_IMETHOD SetHorizontal(PRBool aHorizontal) = 0;
|
||||
|
||||
|
||||
NS_IMETHOD_(nsIDateTime *) GetDTStart() = 0;
|
||||
NS_IMETHOD_(nsIDateTime *) GetDTEnd() = 0;
|
||||
NS_IMETHOD_(nsIDateTime *) GetDTFirstVisible() = 0;
|
||||
|
@ -52,7 +52,6 @@ nsCalTimeContext :: nsCalTimeContext()
|
||||
mLastVisibleTime = nsnull;
|
||||
mMajorIncrement = nsnull;
|
||||
mMinorIncrement = nsnull;
|
||||
mHorizontal = PR_FALSE;
|
||||
mPeriodFormat = nsCalPeriodFormat_kHour;
|
||||
mDate = nsnull;
|
||||
|
||||
@ -126,9 +125,6 @@ nsresult nsCalTimeContext::Copy(nsICalTimeContext * aContext)
|
||||
mMajorIncrement = aContext->GetDTMajorIncrement()->Copy();
|
||||
mMinorIncrement = aContext->GetDTMinorIncrement()->Copy();
|
||||
mDate = aContext->GetDate()->Copy();
|
||||
mHorizontal = aContext->GetHorizontal();
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -143,17 +139,6 @@ nsresult nsCalTimeContext::Init()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool nsCalTimeContext::GetHorizontal()
|
||||
{
|
||||
return mHorizontal;
|
||||
}
|
||||
|
||||
nsresult nsCalTimeContext::SetHorizontal(PRBool aHorizontal)
|
||||
{
|
||||
mHorizontal = aHorizontal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIDateTime * nsCalTimeContext::GetDate()
|
||||
{
|
||||
return (mDate);
|
||||
@ -228,8 +213,6 @@ nsresult nsCalTimeContext::SetDefaultDateTime()
|
||||
SetMajorIncrement(0,0,0,1,0,0);
|
||||
SetMinorIncrement(0,0,0,0,15,0);
|
||||
|
||||
mHorizontal = PR_FALSE;
|
||||
|
||||
mPeriodFormat = nsCalPeriodFormat_kHour;
|
||||
|
||||
return res;
|
||||
|
@ -28,7 +28,7 @@
|
||||
<!-- This is the Timebar Scale Rule -->
|
||||
<panel name="ScaleViewRule" layout="ybox">
|
||||
<tcc foregroundcolor="#0000FF" name="PrevHour" orientation="north" control="MultiCalendarEventWeekView" usectxrule="hour-1" weightminor="0" weightmajor="0"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1" layout="ybox"/>
|
||||
<tcc foregroundcolor="#0000FF" name="NextHour" orientation="south" control="MultiCalendarEventWeekView" usectxrule="hour+1" weightminor="0" weightmajor="0"/>
|
||||
</panel>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<!-- This is the Timebar Scale Rule -->
|
||||
<panel name="ScaleViewRule">
|
||||
<tcc foregroundcolor="#0000FF" name="PrevHour" orientation="north" control="MultiCalendarEventWeekView" usectxrule="hour-1" weightminor="0" weightmajor="0"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1" layout="ybox"/>
|
||||
<tcc foregroundcolor="#0000FF" name="NextHour" orientation="south" control="MultiCalendarEventWeekView" usectxrule="hour+1" weightminor="0" weightmajor="0"/>
|
||||
</panel>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<!-- This is the Timebar Scale Rule -->
|
||||
<panel name="ScaleViewRule">
|
||||
<tcc foregroundcolor="#0000FF" name="PrevHour" orientation="north" control="MultiCalendarEventWeekView" usectxrule="hour-1" weightminor="0" weightmajor="0"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1" layout="ybox"/>
|
||||
<tcc foregroundcolor="#0000FF" name="NextHour" orientation="south" control="MultiCalendarEventWeekView" usectxrule="hour+1" weightminor="0" weightmajor="0"/>
|
||||
</panel>
|
||||
|
||||
@ -24,8 +24,8 @@
|
||||
|
||||
<!-- This is the MultiDayView and Command Bar -->
|
||||
<panel name="MultiDayViewRule">
|
||||
<multidayviewcanvas name="MultiCalendarEventWeekView" control="MiniCalendar" repeatable="DayContext" minrepeat="1" maxrepeat="1" count="1">
|
||||
<commandcanvas name="CommandCanvas" weightmajor="0" weightminor="0">
|
||||
<multidayviewcanvas name="MultiCalendarEventWeekView" control="MiniCalendar" repeatable="DayContext" minrepeat="1" maxrepeat="1" count="1" layout="xbox"/>
|
||||
<commandcanvas name="CommandCanvas" weightmajor="0" weightminor="0"/>
|
||||
</panel>
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
<!-- This is the Timebar Scale Rule -->
|
||||
<panel name="ScaleViewRule">
|
||||
<tcc foregroundcolor="#0000FF" name="PrevHour" orientation="north" control="MultiCalendarEventWeekView" usectxrule="hour-1" weightminor="0" weightmajor="0"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1" layout="ybox"/>
|
||||
<tcc foregroundcolor="#0000FF" name="NextHour" orientation="south" control="MultiCalendarEventWeekView" usectxrule="hour+1" weightminor="0" weightmajor="0"/>
|
||||
</panel>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<!-- This is the Timebar Scale Rule -->
|
||||
<panel name="ScaleViewRule">
|
||||
<tcc foregroundcolor="#0000FF" name="PrevHour" orientation="north" control="MultiCalendarEventWeekView" usectxrule="hour-1" weightminor="0" weightmajor="0"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1" layout="ybox"/>
|
||||
<tcc foregroundcolor="#0000FF" name="NextHour" orientation="south" control="MultiCalendarEventWeekView" usectxrule="hour+1" weightminor="0" weightmajor="0"/>
|
||||
</panel>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<!-- This is the Timebar Scale Rule -->
|
||||
<panel name="ScaleViewRule">
|
||||
<tcc foregroundcolor="#0000FF" name="PrevHour" orientation="north" control="MultiCalendarEventWeekView" usectxrule="hour-1" weightminor="0" weightmajor="0"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1" layout="ybox"/>
|
||||
<tcc foregroundcolor="#0000FF" name="NextHour" orientation="south" control="MultiCalendarEventWeekView" usectxrule="hour+1" weightminor="0" weightmajor="0"/>
|
||||
</panel>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<!-- This is the Timebar Scale Rule -->
|
||||
<panel name="ScaleViewRule">
|
||||
<tcc foregroundcolor="#0000FF" name="PrevHour" orientation="north" control="MultiCalendarEventWeekView" usectxrule="hour-1" weightminor="0" weightmajor="0"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1" layout="ybox"/>
|
||||
<tcc foregroundcolor="#0000FF" name="NextHour" orientation="south" control="MultiCalendarEventWeekView" usectxrule="hour+1" weightminor="0" weightmajor="0"/>
|
||||
</panel>
|
||||
|
@ -32,7 +32,7 @@
|
||||
<!-- This is the Timebar Scale Rule -->
|
||||
<panel name="ScaleViewRule">
|
||||
<tcc foregroundcolor="#0000FF" name="PrevHour" orientation="north" control="MultiCalendarEventWeekView" usectxrule="hour-1" weightminor="0" weightmajor="0"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1"/>
|
||||
<timebarscale name="TimebarScale" weightminor="0" weightmajor="1" layout="ybox"/>
|
||||
<tcc foregroundcolor="#0000FF" name="NextHour" orientation="south" control="MultiCalendarEventWeekView" usectxrule="hour+1" weightminor="0" weightmajor="0"/>
|
||||
</panel>
|
||||
|
@ -7,6 +7,7 @@
|
||||
# The copyright notice(s) in this Source Code does not indicate actual or
|
||||
# intended publication of this Source Code.
|
||||
#
|
||||
|
||||
GDEPTH = ../../../../..
|
||||
|
||||
MODULE = trex
|
@ -4,7 +4,7 @@
|
||||
|
||||
<!-- This is the MultiDayView and Command Bar -->
|
||||
<panel name="MultiDayViewRule">
|
||||
<multiuserviewcanvas layout="xbox" name="MultiCalendarEventWeekView" control="MiniCalendar" repeatable="DayContext">
|
||||
<multiuserviewcanvas layout="ybox" name="MultiCalendarEventWeekView" control="MiniCalendar" repeatable="DayContext">
|
||||
</panel>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#
|
||||
GDEPTH = ../../../..
|
||||
|
||||
DIRS_LIBS = demo images
|
||||
DIRS_LIBS = demo images calui
|
||||
|
||||
MODULE = trex
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
<application name="Trex 0.1" layout="ybox">
|
||||
<canvas src="resource://res/ui/menubar.ui" name="menubar"/>
|
||||
<canvas src="resource://res/ui/toolbar.ui" name="toolbar"/>
|
||||
<canvas src="resource://res/ui/julian_day.cal" name="content" layout="ybox"/>
|
||||
<canvas src="resource://res/ui/test.cal" name="content" layout="ybox"/>
|
||||
</application>
|
||||
|
||||
</UI>
|
||||
|
@ -2349,13 +2349,17 @@ nsresult nsXPFCCanvas :: BroadcastCommand(nsIXPFCCommand& aCommand)
|
||||
nsresult res ;
|
||||
nsIIterator * iterator ;
|
||||
nsIXPFCCanvas * canvas;
|
||||
nsEventStatus status ;
|
||||
|
||||
/*
|
||||
* Call this container's Action Method. We should change the action
|
||||
* method to return something about ignoring and consuming commands
|
||||
*/
|
||||
|
||||
Action(&aCommand);
|
||||
status = Action(&aCommand);
|
||||
|
||||
if (nsEventStatus_eConsumeNoDefault == status)
|
||||
return NS_OK;
|
||||
|
||||
/*
|
||||
* Iterate through the children and pass it on
|
||||
|
Loading…
x
Reference in New Issue
Block a user