Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Graphics
KRuler
Commits
8ed0492d
Commit
8ed0492d
authored
Oct 05, 2005
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Launch my script
svn path=/trunk/KDE/kdegraphics/kruler/; revision=467474
parent
adbc6745
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
klineal.cpp
klineal.cpp
+6
-5
klineal.h
klineal.h
+3
-3
No files found.
klineal.cpp
View file @
8ed0492d
...
...
@@ -27,7 +27,7 @@
#include <klocale.h>
#include <kmainwindow.h>
#include <knotifyclient.h>
#include <k
popup
menu.h>
#include <kmenu.h>
#include <kstandarddirs.h>
#include <kwin.h>
#include <kstdguiitem.h>
...
...
@@ -46,6 +46,7 @@
#include <QEvent>
#include <QLabel>
#include <QMouseEvent>
#include <ktoolinvocation.h>
#include "klineal.h"
...
...
@@ -149,9 +150,9 @@ KLineal::KLineal(QWidget*parent,const char* name):KMainWindow(parent,name){
_clicked
=
false
;
setOrientation
(
South
);
// setMediumLength();
mMenu
=
new
K
Popup
Menu
(
this
);
mMenu
=
new
KMenu
(
this
);
mMenu
->
insertTitle
(
i18n
(
"KRuler"
));
K
Popup
Menu
*
oriMenu
=
new
K
Popup
Menu
(
this
);
KMenu
*
oriMenu
=
new
KMenu
(
this
);
oriMenu
->
insertItem
(
UserIconSet
(
"kruler-north"
),
i18n
(
"&North"
),
this
,
SLOT
(
setNorth
()),
Qt
::
Key_N
);
oriMenu
->
insertItem
(
UserIconSet
(
"kruler-east"
),
i18n
(
"&East"
),
this
,
SLOT
(
setEast
()),
Qt
::
Key_E
);
oriMenu
->
insertItem
(
UserIconSet
(
"kruler-south"
),
i18n
(
"&South"
),
this
,
SLOT
(
setSouth
()),
Qt
::
Key_S
);
...
...
@@ -159,7 +160,7 @@ KLineal::KLineal(QWidget*parent,const char* name):KMainWindow(parent,name){
oriMenu
->
insertItem
(
i18n
(
"&Turn Right"
),
this
,
SLOT
(
turnRight
()),
Qt
::
Key_R
);
oriMenu
->
insertItem
(
i18n
(
"Turn &Left"
),
this
,
SLOT
(
turnLeft
()),
Qt
::
Key_L
);
mMenu
->
insertItem
(
i18n
(
"&Orientation"
),
oriMenu
);
mLenMenu
=
new
K
Popup
Menu
(
this
);
mLenMenu
=
new
KMenu
(
this
);
mLenMenu
->
insertItem
(
i18n
(
"&Short"
),
this
,
SLOT
(
setShortLength
()),
Qt
::
CTRL
+
Qt
::
Key_S
);
mLenMenu
->
insertItem
(
i18n
(
"&Medium"
),
this
,
SLOT
(
setMediumLength
()),
Qt
::
CTRL
+
Qt
::
Key_M
);
mLenMenu
->
insertItem
(
i18n
(
"&Tall"
),
this
,
SLOT
(
setTallLength
()),
Qt
::
CTRL
+
Qt
::
Key_T
);
...
...
@@ -502,7 +503,7 @@ void KLineal::keyPressEvent(QKeyEvent *e) {
QPoint
dist
(
0
,
0
);
switch
(
e
->
key
())
{
case
Qt
::
Key_F1
:
kapp
->
invokeHelp
();
KToolInvocation
::
invokeHelp
();
break
;
case
Qt
::
Key_Left
:
dist
.
setX
(
-
1
);
...
...
klineal.h
View file @
8ed0492d
...
...
@@ -19,7 +19,7 @@
#define KLINEAL_H
#include <kapplication.h>
#include <k
popup
menu.h>
#include <kmenu.h>
#include <kmainwindow.h>
#include <kcolordialog.h>
...
...
@@ -70,8 +70,8 @@ private:
int
mOrientation
;
int
mLongEdgeLen
;
int
mShortEdgeLen
;
K
Popup
Menu
*
mMenu
;
K
Popup
Menu
*
mLenMenu
;
KMenu
*
mMenu
;
KMenu
*
mLenMenu
;
QColor
mColor
;
QColor
mStoredColor
;
QCursor
mCurrentCursor
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment