LibreOffice Module vcl (master)
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
include
vcl
toolkit
include/vcl/toolkit/calendar.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
5
* This Source Code Form is subject to the terms of the Mozilla Public
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
7
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
11
* Licensed to the Apache Software Foundation (ASF) under one or more
12
* contributor license agreements. See the NOTICE file distributed
13
* with this work for additional information regarding copyright
14
* ownership. The ASF licenses this file to you under the Apache
15
* License, Version 2.0 (the "License"); you may not use this file
16
* except in compliance with the License. You may obtain a copy of
17
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
*/
19
20
#pragma once
21
22
#if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
23
#error "don't use this in new code"
24
#endif
25
26
#include <config_options.h>
27
#include <
vcl/dllapi.h
>
28
29
#include <
vcl/toolkit/field.hxx
>
30
#include <
vcl/weld.hxx
>
31
32
class
FloatingWindow
;
33
struct
ImplCFieldFloatWin
;
34
35
/*************************************************************************
36
37
Description
38
============
39
40
class CalendarField
41
42
This class is a DateField with which one can select a date via a DropDownButton
43
and the CalendarControl.
44
45
--------------------------------------------------------------------------
46
47
WinBits
48
49
See DateField
50
51
The preferences for the CalendarControl can be set via SetCalendarStyle().
52
53
--------------------------------------------------------------------------
54
55
With EnableToday()/EnableNone() we can enable a TodayButton and a NoneButton.
56
57
--------------------------------------------------------------------------
58
59
Because we only take over the start date into the field, we should query
60
with GetCalendar() in the SelectHandler and with GetSelectDateCount()/GetSelectDate()
61
the selected range. We then can e.g. take over that value to another field.
62
63
--------------------------------------------------------------------------
64
65
If a derived Calendar should be used, we can override the CreateCalendar()
66
method in CalendarField and create an own calendar there ourselves.
67
68
*************************************************************************/
69
70
71
class
VCL_DLLPUBLIC
CalendarField
final :
public
DateField
72
{
73
private
:
74
VclPtr<ImplCFieldFloatWin>
mpFloatWin
;
75
weld::Button
*
mpTodayBtn
;
76
weld::Button
*
mpNoneBtn
;
77
bool
mbToday
;
78
bool
mbNone
;
79
80
DECL_DLLPRIVATE_LINK
( ImplSelectHdl,
weld::Calendar
&,
void
);
81
DECL_DLLPRIVATE_LINK
( ImplClickHdl,
weld::Button
&,
void
);
82
DECL_DLLPRIVATE_LINK
( ImplPopupModeEndHdl,
FloatingWindow
*,
void
);
83
84
public
:
85
CalendarField
(
vcl::Window
* pParent,
WinBits
nWinStyle );
86
virtual
~
CalendarField
()
override
;
87
virtual
void
dispose
()
override
;
88
89
virtual
bool
ShowDropDown
(
bool
bShow )
override
;
90
91
void
EnableToday
() { mbToday =
true
; }
92
void
EnableNone
() { mbNone =
true
; }
93
94
private
:
95
virtual
void
StateChanged
(
StateChangedType
nStateChange )
override
;
96
};
97
98
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
VclPtr< ImplCFieldFloatWin >
VCL_DLLPUBLIC
#define VCL_DLLPUBLIC
Definition:
dllapi.h:29
field.hxx
ImplCFieldFloatWin
Definition:
calendar.cxx:1549
CalendarField::EnableNone
void EnableNone()
Definition:
include/vcl/toolkit/calendar.hxx:92
StateChangedType
StateChangedType
Definition:
window.hxx:317
WinBits
sal_Int64 WinBits
weld::Button
Definition:
weld.hxx:1333
SpinField::ShowDropDown
virtual bool ShowDropDown(bool bShow)
Definition:
spinfld.cxx:885
DateField::dispose
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition:
field2.cxx:1977
CalendarField
Definition:
include/vcl/toolkit/calendar.hxx:71
vcl::Window
Definition:
window.hxx:481
CalendarField::EnableToday
void EnableToday()
Definition:
include/vcl/toolkit/calendar.hxx:91
CalendarField::mbToday
bool mbToday
Definition:
include/vcl/toolkit/calendar.hxx:77
DateField
Definition:
field.hxx:470
dllapi.h
CalendarField::mpNoneBtn
weld::Button * mpNoneBtn
Definition:
include/vcl/toolkit/calendar.hxx:76
CalendarField::mpFloatWin
VclPtr< ImplCFieldFloatWin > mpFloatWin
Definition:
include/vcl/toolkit/calendar.hxx:74
SpinField::DECL_DLLPRIVATE_LINK
DECL_DLLPRIVATE_LINK(ImplTimeout, Timer *, void)
CalendarField::mpTodayBtn
weld::Button * mpTodayBtn
Definition:
include/vcl/toolkit/calendar.hxx:75
weld.hxx
weld::Calendar
Definition:
weld.hxx:1724
CalendarField::mbNone
bool mbNone
Definition:
include/vcl/toolkit/calendar.hxx:78
SpinField::StateChanged
virtual void StateChanged(StateChangedType nType) override
Definition:
spinfld.cxx:751
FloatingWindow
Definition:
floatwin.hxx:53
Generated on Sat Feb 27 2021 02:49:39 for LibreOffice Module vcl (master) by
1.8.10