summaryrefslogtreecommitdiff
path: root/core/pim/datebook
authorhakan <hakan>2002-05-12 09:54:24 (UTC)
committer hakan <hakan>2002-05-12 09:54:24 (UTC)
commit6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d (patch) (unidiff)
tree6fac867effefe67c98896418047fe794a88c6953 /core/pim/datebook
parent6f5ac2fbf69f019cc9d3a1522fc507c6b88d2bd6 (diff)
downloadopie-6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d.zip
opie-6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d.tar.gz
opie-6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d.tar.bz2
Added a ONoteEdit class which is a QMultiLineEdit subclass copying indentation from line to line
Diffstat (limited to 'core/pim/datebook') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.pro6
-rw-r--r--core/pim/datebook/dateentryimpl.cpp1
-rw-r--r--core/pim/datebook/noteentry.ui28
-rw-r--r--core/pim/datebook/noteentryimpl.cpp1
-rw-r--r--core/pim/datebook/onoteedit.cpp19
-rw-r--r--core/pim/datebook/onoteedit.h19
6 files changed, 67 insertions, 7 deletions
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro
index 60c2b08..cf3ed30 100644
--- a/core/pim/datebook/datebook.pro
+++ b/core/pim/datebook/datebook.pro
@@ -14,3 +14,4 @@ HEADERS = datebookday.h \
14 timepicker.h \ 14 timepicker.h \
15 noteentryimpl.h 15 noteentryimpl.h \
16 onoteedit.h
16 17
@@ -27,3 +28,4 @@ SOURCES = main.cpp \
27 timepicker.cpp \ 28 timepicker.cpp \
28 noteentryimpl.cpp 29 noteentryimpl.cpp \
30 onoteedit.cpp
29 31
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp
index 9cc5073..dab3375 100644
--- a/core/pim/datebook/dateentryimpl.cpp
+++ b/core/pim/datebook/dateentryimpl.cpp
@@ -43,2 +43,3 @@
43#include "timepicker.h" 43#include "timepicker.h"
44#include "onoteedit.h"
44 45
diff --git a/core/pim/datebook/noteentry.ui b/core/pim/datebook/noteentry.ui
index ce3c4ad..0bea06e 100644
--- a/core/pim/datebook/noteentry.ui
+++ b/core/pim/datebook/noteentry.ui
@@ -55,3 +55,3 @@
55 <widget> 55 <widget>
56 <class>QMultiLineEdit</class> 56 <class>ONoteEdit</class>
57 <property stdset="1"> 57 <property stdset="1">
@@ -60,6 +60,2 @@
60 </property> 60 </property>
61 <property stdset="1">
62 <name>wordWrap</name>
63 <enum>WidgetWidth</enum>
64 </property>
65 </widget> 61 </widget>
@@ -67,2 +63,24 @@
67</widget> 63</widget>
64<customwidgets>
65 <customwidget>
66 <class>ONoteEdit</class>
67 <header location="local">onoteedit.h</header>
68 <sizehint>
69 <width>-1</width>
70 <height>-1</height>
71 </sizehint>
72 <container>0</container>
73 <sizepolicy>
74 <hordata>7</hordata>
75 <verdata>7</verdata>
76 </sizepolicy>
77 <pixmap>image0</pixmap>
78 </customwidget>
79</customwidgets>
80<images>
81 <image>
82 <name>image0</name>
83 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
84 </image>
85</images>
68</UI> 86</UI>
diff --git a/core/pim/datebook/noteentryimpl.cpp b/core/pim/datebook/noteentryimpl.cpp
index 9e1abb9..0e45985 100644
--- a/core/pim/datebook/noteentryimpl.cpp
+++ b/core/pim/datebook/noteentryimpl.cpp
@@ -4,2 +4,3 @@
4#include "qlabel.h" 4#include "qlabel.h"
5#include "onoteedit.h"
5 6
diff --git a/core/pim/datebook/onoteedit.cpp b/core/pim/datebook/onoteedit.cpp
new file mode 100644
index 0000000..d66ad86
--- a/dev/null
+++ b/core/pim/datebook/onoteedit.cpp
@@ -0,0 +1,19 @@
1#include "onoteedit.h"
2
3ONoteEdit::ONoteEdit (QWidget * parent, const char * name) :
4 QMultiLineEdit(parent,name) {
5 setDefaultTabStop(2);
6 setWordWrap(WidgetWidth);
7}
8
9// Copy indentation from previous line
10void ONoteEdit::newLine() {
11 int l,c;
12 getCursorPosition(&l,&c);
13 QString s=textLine(l);
14
15 insert("\n");
16
17 int i=0;
18 while (s[i]==' ' || s[i]=='\t') insert(QString(s[i])), i++;
19}
diff --git a/core/pim/datebook/onoteedit.h b/core/pim/datebook/onoteedit.h
new file mode 100644
index 0000000..2f71d0d
--- a/dev/null
+++ b/core/pim/datebook/onoteedit.h
@@ -0,0 +1,19 @@
1#ifndef ONOTEEDIT_H
2#define ONOTEEDIT_H
3
4#include <qmultilineedit.h>
5
6class ONoteEdit: public QMultiLineEdit {
7
8 Q_OBJECT
9
10 public:
11
12 ONoteEdit (QWidget * parent=0, const char * name=0);
13
14 protected:
15
16 virtual void newLine ();
17};
18
19#endif