diff options
-rw-r--r-- | svtools/source/control/calendar.cxx | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index b435f906a5f3..02d2617a971c 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include <rtl/strbuf.hxx> #include <vcl/svapp.hxx> #include <vcl/help.hxx> @@ -39,7 +38,6 @@ #include <svtools/calendar.hxx> #include <boost/scoped_ptr.hpp> - #define DAY_OFFX 4 #define DAY_OFFY 2 #define MONTH_BORDERX 4 @@ -62,8 +60,6 @@ using namespace ::com::sun::star; - - static void ImplCalendarSelectDate( IntDateSet* pTable, const Date& rDate, bool bSelect ) { if ( bSelect ) @@ -72,8 +68,6 @@ static void ImplCalendarSelectDate( IntDateSet* pTable, const Date& rDate, bool pTable->erase( rDate.GetDate() ); } - - static void ImplCalendarSelectDateRange( IntDateSet* pTable, const Date& rStartDate, const Date& rEndDate, @@ -112,8 +106,6 @@ static void ImplCalendarSelectDateRange( IntDateSet* pTable, } } - - static void ImplCalendarUnSelectDateRange( IntDateSet* pTable, IntDateSet* pOldTable, const Date& rStartDate, @@ -150,15 +142,11 @@ static void ImplCalendarUnSelectDateRange( IntDateSet* pTable, } } - - inline void ImplCalendarClearSelectDate( IntDateSet* pTable ) { pTable->clear(); } - - void Calendar::ImplInit( WinBits nWinStyle ) { mpSelectTable = new IntDateSet; @@ -225,8 +213,6 @@ void Calendar::ImplInit( WinBits nWinStyle ) ImplInitSettings(); } - - void Calendar::ImplInitSettings() { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -236,8 +222,6 @@ void Calendar::ImplInitSettings() SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) ); } - - Calendar::Calendar( vcl::Window* pParent, WinBits nWinStyle ) : Control( pParent, nWinStyle & (WB_TABSTOP | WB_GROUP | WB_BORDER | WB_3DLOOK | WB_RANGESELECT | WB_MULTISELECT) ), maCalendarWrapper( Application::GetAppLocaleDataWrapper().getComponentContext() ), @@ -253,8 +237,6 @@ Calendar::Calendar( vcl::Window* pParent, WinBits nWinStyle ) : ImplInit( nWinStyle ); } - - Calendar::~Calendar() { disposeOnce(); @@ -272,8 +254,6 @@ void Calendar::dispose() Control::dispose(); } - - DayOfWeek Calendar::ImplGetWeekStart() const { // Map i18n::Weekdays to Date DayOfWeek @@ -309,8 +289,6 @@ DayOfWeek Calendar::ImplGetWeekStart() const return eDay; } - - void Calendar::ImplGetWeekFont( vcl::Font& rFont ) const { // weeknumber is displayed in WEEKNUMBER_HEIGHT%-Fontheight @@ -321,8 +299,6 @@ void Calendar::ImplGetWeekFont( vcl::Font& rFont ) const rFont.SetWeight( WEIGHT_NORMAL ); } - - void Calendar::ImplFormat() { if ( !mbFormat ) @@ -500,8 +476,6 @@ void Calendar::ImplFormat() mbFormat = false; } - - sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const { if ( mbFormat ) @@ -629,8 +603,6 @@ sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const return 0; } - - static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect, bool bPrev ) { @@ -675,8 +647,6 @@ static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect, } } - - void Calendar::ImplDrawSpin( bool bDrawPrev, bool bDrawNext ) { if ( !bDrawPrev && !bDrawNext ) @@ -704,8 +674,6 @@ void Calendar::ImplDrawSpin( bool bDrawPrev, bool bDrawNext ) } } - - void Calendar::ImplDrawDate( long nX, long nY, sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear, DayOfWeek eDayOfWeek, @@ -796,8 +764,6 @@ void Calendar::ImplDrawDate( long nX, long nY, ImplInvertDropPos(); } - - void Calendar::ImplDraw( bool bPaint ) { ImplFormat(); @@ -1038,8 +1004,6 @@ void Calendar::ImplDraw( bool bPaint ) ImplDrawSpin(); } - - void Calendar::ImplUpdateDate( const Date& rDate ) { if ( IsReallyVisible() && IsUpdateMode() ) @@ -1055,8 +1019,6 @@ void Calendar::ImplUpdateDate( const Date& rDate ) } } - - void Calendar::ImplUpdateSelection( IntDateSet* pOld ) { IntDateSet* pNew = mpSelectTable; @@ -1082,8 +1044,6 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld ) } } - - void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest, bool bMove, bool bExpand, bool bExtended ) { @@ -1194,8 +1154,6 @@ void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest, } } - - void Calendar::ImplUpdate( bool bCalcNew ) { if ( IsReallyVisible() && IsUpdateMode() ) @@ -1220,8 +1178,6 @@ void Calendar::ImplUpdate( bool bCalcNew ) mbFormat = true; } - - void Calendar::ImplInvertDropPos() { Rectangle aRect = GetDateRect( maDropDate );//this is one Pixel to width and one to heigh @@ -1230,8 +1186,6 @@ void Calendar::ImplInvertDropPos() Invert( aRect ); } - - void Calendar::ImplScroll( bool bPrev ) { Date aNewFirstMonth = GetFirstMonth(); @@ -1247,8 +1201,6 @@ void Calendar::ImplScroll( bool bPrev ) mbDirect = false; } - - void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) { EndSelection(); @@ -1312,8 +1264,6 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) } } - - void Calendar::ImplTracking( const Point& rPos, bool bRepeat ) { Date aTempDate = maCurDate; @@ -1335,8 +1285,6 @@ void Calendar::ImplTracking( const Point& rPos, bool bRepeat ) ImplMouseSelect( aTempDate, nHitTest, true, false, false ); } - - void Calendar::ImplEndTracking( bool bCancel ) { bool bSelection = mbSelection; @@ -1402,8 +1350,6 @@ void Calendar::ImplEndTracking( bool bCancel ) } } - - IMPL_LINK_NOARG_TYPED( Calendar, ScrollHdl, Timer*, void ) { bool bPrevIn = (mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0; @@ -1416,8 +1362,6 @@ IMPL_LINK_NOARG_TYPED( Calendar, ScrollHdl, Timer*, void ) } } - - void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeft() && !mbMenuDown ) @@ -1479,8 +1423,6 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) Control::MouseButtonDown( rMEvt ); } - - void Calendar::MouseButtonUp( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeft() && mbSelection ) @@ -1489,8 +1431,6 @@ void Calendar::MouseButtonUp( const MouseEvent& rMEvt ) Control::MouseButtonUp( rMEvt ); } - - void Calendar::MouseMove( const MouseEvent& rMEvt ) { if ( mbSelection && rMEvt.GetButtons() ) @@ -1499,8 +1439,6 @@ void Calendar::MouseMove( const MouseEvent& rMEvt ) Control::MouseMove( rMEvt ); } - - void Calendar::Tracking( const TrackingEvent& rTEvt ) { Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel(); @@ -1511,8 +1449,6 @@ void Calendar::Tracking( const TrackingEvent& rTEvt ) ImplTracking( aMousePos, rTEvt.IsTrackingRepeat() ); } - - void Calendar::KeyInput( const KeyEvent& rKEvt ) { Date aNewDate = maCurDate; @@ -1628,39 +1564,29 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) } } - - void Calendar::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) { ImplDraw( true ); } - - void Calendar::GetFocus() { ImplUpdateDate( maCurDate ); Control::GetFocus(); } - - void Calendar::LoseFocus() { HideFocus(); Control::LoseFocus(); } - - void Calendar::Resize() { ImplUpdate( true ); Control::Resize(); } - - void Calendar::RequestHelp( const HelpEvent& rHEvt ) { if ( rHEvt.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON) ) @@ -1708,8 +1634,6 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt ) Control::RequestHelp( rHEvt ); } - - void Calendar::Command( const CommandEvent& rCEvt ) { if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) @@ -1755,8 +1679,6 @@ void Calendar::Command( const CommandEvent& rCEvt ) Control::Command( rCEvt ); } - - void Calendar::StateChanged( StateChangedType nType ) { Control::StateChanged( nType ); @@ -1765,8 +1687,6 @@ void Calendar::StateChanged( StateChangedType nType ) ImplFormat(); } - - void Calendar::DataChanged( const DataChangedEvent& rDCEvt ) { Control::DataChanged( rDCEvt ); @@ -1781,43 +1701,31 @@ void Calendar::DataChanged( const DataChangedEvent& rDCEvt ) } } - - void Calendar::SelectionChanging() { maSelectionChangingHdl.Call( this ); } - - void Calendar::DateRangeChanged() { maDateRangeChangedHdl.Call( this ); } - - void Calendar::RequestDateInfo() { maRequestDateInfoHdl.Call( this ); } - - void Calendar::DoubleClick() { maDoubleClickHdl.Call( this ); } - - void Calendar::Select() { maSelectHdl.Call( this ); } - - void Calendar::SelectDate( const Date& rDate, bool bSelect ) { if ( !rDate.IsValidAndGregorian() ) @@ -1834,8 +1742,6 @@ void Calendar::SelectDate( const Date& rDate, bool bSelect ) ImplUpdateSelection( pOldSel.get() ); } - - void Calendar::SetNoSelection() { boost::scoped_ptr<IntDateSet> pOldSel; @@ -1849,15 +1755,11 @@ void Calendar::SetNoSelection() ImplUpdateSelection( pOldSel.get() ); } - - bool Calendar::IsDateSelected( const Date& rDate ) const { return mpSelectTable->find( rDate.GetDate() ) != mpSelectTable->end(); } - - Date Calendar::GetFirstSelectedDate() const { if ( !mpSelectTable->empty() ) @@ -1869,8 +1771,6 @@ Date Calendar::GetFirstSelectedDate() const } } - - void Calendar::SetCurDate( const Date& rNewDate ) { if ( !rNewDate.IsValidAndGregorian() ) @@ -1927,8 +1827,6 @@ void Calendar::SetCurDate( const Date& rNewDate ) } } - - void Calendar::SetFirstDate( const Date& rNewFirstDate ) { if ( maFirstDate != rNewFirstDate ) @@ -1939,8 +1837,6 @@ void Calendar::SetFirstDate( const Date& rNewFirstDate ) } } - - Date Calendar::GetFirstMonth() const { if ( maFirstDate.GetDay() > 1 ) @@ -1954,8 +1850,6 @@ Date Calendar::GetFirstMonth() const return maFirstDate; } - - Date Calendar::GetLastMonth() const { Date aDate = GetFirstMonth(); @@ -1966,8 +1860,6 @@ Date Calendar::GetLastMonth() const return aDate; } - - sal_uInt16 Calendar::GetMonthCount() const { if ( mbFormat ) @@ -1976,8 +1868,6 @@ sal_uInt16 Calendar::GetMonthCount() const return (sal_uInt16)(mnMonthPerLine*mnLines); } - - bool Calendar::GetDate( const Point& rPos, Date& rDate ) const { Date aDate = maCurDate; @@ -1991,8 +1881,6 @@ bool Calendar::GetDate( const Point& rPos, Date& rDate ) const return false; } - - Rectangle Calendar::GetDateRect( const Date& rDate ) const { Rectangle aRect; @@ -2093,8 +1981,6 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const return aRect; } - - void Calendar::StartSelection() { if ( mpOldSelectTable ) @@ -2105,8 +1991,6 @@ void Calendar::StartSelection() mbSelection = true; } - - void Calendar::EndSelection() { if ( mbDrag || mbSpinDown || mbSelection ) @@ -2123,8 +2007,6 @@ void Calendar::EndSelection() } } - - Size Calendar::CalcWindowSizePixel( long nCalcMonthPerLine, long nCalcLines ) const { @@ -2174,8 +2056,6 @@ Size Calendar::CalcWindowSizePixel( long nCalcMonthPerLine, return aSize; } - - #define CALFIELD_EXTRA_BUTTON_WIDTH 14 #define CALFIELD_EXTRA_BUTTON_HEIGHT 8 #define CALFIELD_SEP_X 6 @@ -2183,8 +2063,6 @@ Size Calendar::CalcWindowSizePixel( long nCalcMonthPerLine, #define CALFIELD_BORDER_YTOP 4 #define CALFIELD_BORDER_Y 5 - - class ImplCFieldFloatWin : public FloatingWindow { private: @@ -2208,8 +2086,6 @@ public: virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE; }; - - ImplCFieldFloatWin::ImplCFieldFloatWin( vcl::Window* pParent ) : FloatingWindow( pParent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW ) { @@ -2219,8 +2095,6 @@ ImplCFieldFloatWin::ImplCFieldFloatWin( vcl::Window* pParent ) : mpFixedLine = NULL; } - - ImplCFieldFloatWin::~ImplCFieldFloatWin() { disposeOnce(); @@ -2235,8 +2109,6 @@ void ImplCFieldFloatWin::dispose() FloatingWindow::dispose(); } - - PushButton* ImplCFieldFloatWin::EnableTodayBtn( bool bEnable ) { if ( bEnable ) @@ -2263,8 +2135,6 @@ PushButton* ImplCFieldFloatWin::EnableTodayBtn( bool bEnable ) return mpTodayBtn; } - - PushButton* ImplCFieldFloatWin::EnableNoneBtn( bool bEnable ) { if ( bEnable ) @@ -2291,8 +2161,6 @@ PushButton* ImplCFieldFloatWin::EnableNoneBtn( bool bEnable ) return mpNoneBtn; } - - void ImplCFieldFloatWin::ArrangeButtons() { long nBtnHeight = 0; @@ -2353,8 +2221,6 @@ void ImplCFieldFloatWin::ArrangeButtons() } } - - bool ImplCFieldFloatWin::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) @@ -2394,8 +2260,6 @@ void CalendarField::dispose() DateField::dispose(); } - - IMPL_LINK( CalendarField, ImplSelectHdl, Calendar*, pCalendar ) { if ( !pCalendar->IsTravelSelect() ) @@ -2415,8 +2279,6 @@ IMPL_LINK( CalendarField, ImplSelectHdl, Calendar*, pCalendar ) return 0; } - - IMPL_LINK( CalendarField, ImplClickHdl, PushButton*, pBtn ) { mpFloatWin->EndPopupMode(); @@ -2447,8 +2309,6 @@ IMPL_LINK( CalendarField, ImplClickHdl, PushButton*, pBtn ) return 0; } - - IMPL_LINK_NOARG(CalendarField, ImplPopupModeEndHdl) { EndDropDown(); @@ -2457,15 +2317,11 @@ IMPL_LINK_NOARG(CalendarField, ImplPopupModeEndHdl) return 0; } - - void CalendarField::Select() { maSelectHdl.Call( this ); } - - bool CalendarField::ShowDropDown( bool bShow ) { if ( bShow ) @@ -2514,15 +2370,11 @@ bool CalendarField::ShowDropDown( bool bShow ) return true; } - - VclPtr<Calendar> CalendarField::CreateCalendar( vcl::Window* pParent ) { return VclPtr<Calendar>::Create( pParent, mnCalendarStyle | WB_TABSTOP ); } - - Calendar* CalendarField::GetCalendar() { if ( !mpFloatWin ) @@ -2537,8 +2389,6 @@ Calendar* CalendarField::GetCalendar() return mpCalendar; } - - void CalendarField::StateChanged( StateChangedType nStateChange ) { DateField::StateChanged( nStateChange ); |