-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfltdjprefs.cpp
137 lines (103 loc) · 3.45 KB
/
fltdjprefs.cpp
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
125
126
127
128
129
130
131
132
133
134
135
136
137
/***************************************************************************
fltdjprefs.cpp
--------------
begin : Mon Nov 4 2002
copyright : (C) Kartik Patel
email : letapk@gmail.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
//Last modified - 4 Jan 2003
#include <FL/Fl.H>
#include <FL/Fl_Slider.H>
#include "fltdj.h"
//font to be used in the editors
int editorfont, editorfontsize;
//flag; 1 if set, otherwise 0
int showappointmentswithnotes = 0;
int searchallmonths = 0;
int searchappointments = 0;
int showfortune = 0;
Fl_Check_Button *searchall;
void pref_cb (Fl_Widget *obj, void *data)
{
Fl_Button *o;
o = (Fl_Button *)obj;
editorfont = (int) fontslider->value();
editorfontsize = (int) fontsizeslider->value();
fonttextbox->labelfont(editorfont);
fonttextbox->labelsize(editorfontsize);
fonttextbox->redraw();
if (o == fortune) {
showfortune = fortune->value();
}
if (o == applybut) {
apply_prefs ();
}
if (o == savebut) {
apply_prefs ();
save_prefs ();
}
}
//end pref_cb
void apply_prefs (void)
{
int i;
noteditor->textfont (editorfont);
todoeditor->textfont (editorfont);
contacteditor->textfont (editorfont);
journalsearchresultlist->textfont (editorfont);
apptsearchresultlist->textfont (editorfont);
noteditor->textsize (editorfontsize);
todoeditor->textsize (editorfontsize);
contacteditor->textsize (editorfontsize);
journalsearchresultlist->textsize (editorfontsize);
apptsearchresultlist->textsize (editorfontsize);
noteditor->redraw();
todoeditor->redraw();
contacteditor->redraw();
journalsearchresultlist->redraw();
apptsearchresultlist->redraw();
for (i = 0; i < 10; i++) {
appttime[i]->labelfont(editorfont);
apptname[i]->labelfont(editorfont);
appttime[i]->labelsize(editorfontsize);
apptname[i]->labelsize(editorfontsize);
appttime[i]->redraw();
apptname[i]->redraw();
appttimein->textfont(editorfont);
apptnamein->textfont(editorfont);
appttimein->textsize(editorfontsize);
apptnamein->textsize(editorfontsize);
appttimein->redraw();
apptnamein->redraw();
}
for (i = 0; i < 10; i++) {
holdate[i]->labelfont(editorfont);
holmonth[i]->labelfont(editorfont);
holtext[i]->labelfont(editorfont);
holdate[i]->labelsize (editorfontsize);
holmonth[i]->labelsize (editorfontsize);
holtext[i]->labelsize (editorfontsize);
holdate[i]->redraw();
holmonth[i]->redraw();
holtext[i]->redraw();
holdatein->textfont(editorfont);
holmonthin->textfont(editorfont);
holtextin->textfont(editorfont);
holdatein->textsize (editorfontsize);
holmonthin->textsize (editorfontsize);
holtextin->textsize (editorfontsize);
holdatein->redraw();
holmonthin->redraw();
holtextin->redraw();
}
}
//end apply_prefs
//end file