/usr/include/wx-3.0/wx/timectrl.h is in wx3.0-headers 3.0.2-1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/timectrl.h
// Purpose: Declaration of wxTimePickerCtrl class.
// Author: Vadim Zeitlin
// Created: 2011-09-22
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIMECTRL_H_
#define _WX_TIMECTRL_H_
#include "wx/defs.h"
#if wxUSE_TIMEPICKCTRL
#include "wx/datetimectrl.h"
#define wxTimePickerCtrlNameStr wxS("timectrl")
// No special styles are currently defined for this control but still define a
// symbolic constant for the default style for consistency.
enum
{
wxTP_DEFAULT = 0
};
// ----------------------------------------------------------------------------
// wxTimePickerCtrl: Allow the user to enter the time.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxTimePickerCtrlBase : public wxDateTimePickerCtrl
{
public:
/*
The derived classes should implement ctor and Create() method with the
following signature:
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr);
*/
/*
We also inherit Set/GetValue() methods from the base class which define
our public API. Notice that the date portion of the date passed as
input or received as output is or should be ignored, only the time part
of wxDateTime objects is really significant here. Use Set/GetTime()
below for possibly simpler interface.
*/
// Set the given time.
bool SetTime(int hour, int min, int sec)
{
// Notice that we should use a date on which DST doesn't change to
// avoid any problems with time discontinuity so use a fixed date (on
// which nobody changes DST) instead of e.g. today.
wxDateTime dt(1, wxDateTime::Jan, 2012, hour, min, sec);
if ( !dt.IsValid() )
{
// No need to assert here, wxDateTime already does it for us.
return false;
}
SetValue(dt);
return true;
}
// Get the current time components. All pointers must be non-NULL.
bool GetTime(int* hour, int* min, int* sec) const
{
wxCHECK_MSG( hour && min && sec, false,
wxS("Time component pointers must be non-NULL") );
const wxDateTime::Tm tm = GetValue().GetTm();
*hour = tm.hour;
*min = tm.min;
*sec = tm.sec;
return true;
}
};
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/timectrl.h"
#define wxHAS_NATIVE_TIMEPICKERCTRL
#elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__)
#include "wx/osx/timectrl.h"
#define wxHAS_NATIVE_TIMEPICKERCTRL
#else
#include "wx/generic/timectrl.h"
class WXDLLIMPEXP_ADV wxTimePickerCtrl : public wxTimePickerCtrlGeneric
{
public:
wxTimePickerCtrl() { }
wxTimePickerCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr)
: wxTimePickerCtrlGeneric(parent, id, date, pos, size, style, validator, name)
{
}
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTimePickerCtrl);
};
#endif
#endif // wxUSE_TIMEPICKCTRL
#endif // _WX_TIMECTRL_H_
|