Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
5ea47dbc
Commit
5ea47dbc
authored
Jan 24, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CreateObject in WFoe popupmenu
parent
982fd09c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
wb/lib/wb/gtk/wb_foe_gtk.cpp
wb/lib/wb/gtk/wb_foe_gtk.cpp
+15
-4
wb/lib/wb/gtk/wb_foe_gtk.h
wb/lib/wb/gtk/wb_foe_gtk.h
+2
-1
No files found.
wb/lib/wb/gtk/wb_foe_gtk.cpp
View file @
5ea47dbc
/*
* Proview $Id: wb_foe_gtk.cpp,v 1.
4 2007-01-17 10:28:39
claes Exp $
* Proview $Id: wb_foe_gtk.cpp,v 1.
5 2007-01-24 12:42:44
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -142,6 +142,15 @@ void WFoeGtk::activate_delete( GtkWidget *w, gpointer data)
foe
->
activate_delete
();
}
void
WFoeGtk
::
activate_createobject
(
GtkWidget
*
w
,
gpointer
data
)
{
WFoe
*
foe
=
(
WFoe
*
)
data
;
double
x
,
y
;
foe
->
gre
->
pixel_to_position
(
foe
->
gre
->
popup_menu_x
,
foe
->
gre
->
popup_menu_y
,
&
x
,
&
y
);
foe
->
activate_createobject
(
(
float
)
x
,
(
float
)
y
);
}
// Callback from the menu.
void
WFoeGtk
::
activate_changetext
(
GtkWidget
*
w
,
gpointer
data
)
{
...
...
@@ -634,7 +643,8 @@ typedef void (*gtk_tCallback)(GtkWidget *,gpointer);
int
WFoeGtk
::
modify_popup
(
unsigned
long
popupmenu_mask
,
int
x
,
int
y
)
{
static
char
buttontext
[][
40
]
=
{
"ObjectEditor"
,
"SubWindow"
,
"Connect"
,
"Delete"
,
"Paste"
,
"Copy"
,
"Cut"
,
"PrintSelect"
,
"HelpClass"
};
"Paste"
,
"Copy"
,
"Cut"
,
"PrintSelect"
,
"HelpClass"
,
"CreateObject"
};
static
gtk_tCallback
menu_callbacks
[]
=
{
WFoeGtk
::
activate_attribute
,
WFoeGtk
::
activate_subwindow
,
WFoeGtk
::
activate_getobj
,
...
...
@@ -643,12 +653,13 @@ int WFoeGtk::modify_popup( unsigned long popupmenu_mask, int x, int y)
WFoeGtk
::
activate_copy
,
WFoeGtk
::
activate_cut
,
WFoeGtk
::
activate_printselect
,
WFoeGtk
::
activate_helpclass
};
WFoeGtk
::
activate_helpclass
,
WFoeGtk
::
activate_createobject
};
popupmenu_x
=
x
+
5
;
popupmenu_y
=
y
;
GtkMenu
*
menu
=
(
GtkMenu
*
)
g_object_new
(
GTK_TYPE_MENU
,
NULL
);
for
(
int
i
=
0
;
i
<
9
;
i
++
)
{
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
if
(
popupmenu_mask
&
(
1
<<
i
))
{
GtkWidget
*
w
=
gtk_menu_item_new_with_label
(
buttontext
[
i
]);
g_signal_connect
(
w
,
"activate"
,
...
...
wb/lib/wb/gtk/wb_foe_gtk.h
View file @
5ea47dbc
/*
* Proview $Id: wb_foe_gtk.h,v 1.
1 2007-01-04 07:29:02
claes Exp $
* Proview $Id: wb_foe_gtk.h,v 1.
2 2007-01-24 12:42:44
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -173,6 +173,7 @@ class WFoeGtk : public WFoe {
static
void
activate_compile
(
GtkWidget
*
w
,
gpointer
data
);
static
void
delete_subwindow_ok_cb
(
void
*
ctx
,
void
*
data
);
static
void
activate_delete
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_createobject
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_changetext
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_cut
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_copy
(
GtkWidget
*
w
,
gpointer
data
);
...
...
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