Laxkit
0.0.7.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
lax
dateselector.h
1
//
2
//
3
// The Laxkit, a windowing toolkit
4
// Please consult http://laxkit.sourceforge.net about where to send any
5
// correspondence about this software.
6
//
7
// This library is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU Library General Public
9
// License as published by the Free Software Foundation; either
10
// version 2 of the License, or (at your option) any later version.
11
//
12
// This library is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
// Library General Public License for more details.
16
//
17
// You should have received a copy of the GNU Library General Public
18
// License along with this library; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
//
21
// Copyright (C) 2011 by Tom Lechner
22
//
23
#ifndef _LAX_DATESELECTOR_H
24
#define _LAX_DATESELECTOR_H
25
26
#include <lax/anxapp.h>
27
#include <lax/buttondowninfo.h>
28
29
namespace
Laxkit {
30
31
32
33
34
//------------------------------- DateSelector ------------------------------
35
36
#define DATESEL_WITH_TIME (1<<16)
37
#define DATESEL_MONDAY_FIRST (1<<17)
38
39
class
DateSelector
:
public
anXWindow
40
{
41
protected
:
42
struct
tm date;
43
int
firstdayshown, firstmonthshown, firstyearshown;
44
int
headerlines;
45
int
mo_col, mo_row, mo_month, mo_day, mo_year;
46
47
ButtonDownInfo
buttondown;
48
virtual
int
send
();
49
50
public
:
51
DateSelector
(
anXWindow
*parnt,
const
char
*nname,
const
char
*ntitle,
unsigned
long
nstyle,
52
int
nx,
int
ny,
int
nw,
int
nh,
int
brder,
53
anXWindow
*prev,
unsigned
long
owner,
const
char
*mes,
54
int
year,
int
month,
int
day,
int
secinday);
55
virtual
~
DateSelector
();
56
virtual
const
char
*whattype() {
return
"DateSelector"
; }
57
virtual
int
init();
58
virtual
void
Refresh();
59
virtual
int
LBDown(
int
x,
int
y,
unsigned
int
state,
int
count,
const
LaxMouse
*d);
60
virtual
int
LBUp(
int
x,
int
y,
unsigned
int
state,
const
LaxMouse
*d);
61
//virtual int MBDown(int x,int y,unsigned int state,int count, const LaxMouse *d);
62
//virtual int MBUp(int x,int y,unsigned int state, const LaxMouse *d);
63
//virtual int RBDown(int x,int y,unsigned int state,int count, const LaxMouse *d);
64
//virtual int RBUp(int x,int y,unsigned int state, const LaxMouse *d);
65
virtual
int
WheelUp(
int
x,
int
y,
unsigned
int
state,
int
count,
const
LaxMouse
*d);
66
virtual
int
WheelDown(
int
x,
int
y,
unsigned
int
state,
int
count,
const
LaxMouse
*d);
67
virtual
int
MouseMove
(
int
mx,
int
my,
unsigned
int
state,
const
LaxMouse
*d);
68
virtual
int
CharInput
(
unsigned
int
ch,
const
char
*buffer,
int
len,
unsigned
int
state,
const
LaxKeyboard
*d);
69
70
//virtual int SetTimeZone(int zone);
71
virtual
int
SetDate
(
int
year,
int
month,
int
day,
int
displayonly);
72
73
//serializing aids
74
virtual
LaxFiles::Attribute
*
dump_out_atts
(
LaxFiles::Attribute
*att,
int
what,
anObject
*context);
75
virtual
void
dump_in_atts
(
LaxFiles::Attribute
*att,
int
flag,
anObject
*context);
76
};
77
78
}
// namespace Laxkit
79
80
#endif
81
Mon Feb 17 2014 11:52:56, Laxkit