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
1b3d717d
Commit
1b3d717d
authored
Dec 09, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wb value and command input, escape to close added
parent
3c418280
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
4 deletions
+62
-4
wb/lib/wb/gtk/wb_watt_gtk.cpp
wb/lib/wb/gtk/wb_watt_gtk.cpp
+18
-3
wb/lib/wb/gtk/wb_watt_gtk.h
wb/lib/wb/gtk/wb_watt_gtk.h
+1
-0
wb/lib/wb/gtk/wb_wtt_gtk.cpp
wb/lib/wb/gtk/wb_wtt_gtk.cpp
+31
-1
wb/lib/wb/gtk/wb_wtt_gtk.h
wb/lib/wb/gtk/wb_wtt_gtk.h
+3
-0
xtt/lib/cow/gtk/cow_wow_gtk.cpp
xtt/lib/cow/gtk/cow_wow_gtk.cpp
+5
-0
xtt/lib/cow/gtk/cow_wow_gtk.h
xtt/lib/cow/gtk/cow_wow_gtk.h
+4
-0
No files found.
wb/lib/wb/gtk/wb_watt_gtk.cpp
View file @
1b3d717d
...
...
@@ -240,6 +240,18 @@ gboolean WAttGtk::action_inputfocus( GtkWidget *w, GdkEvent *event, gpointer dat
return
FALSE
;
}
void
WAttGtk
::
hide_cmd_input
(
GtkWidget
*
w
,
gpointer
data
)
{
WAttGtk
*
watt
=
(
WAttGtk
*
)
data
;
watt
->
wattnav
->
set_inputfocus
();
if
(
watt
->
input_open
)
{
g_object_set
(
watt
->
cmd_prompt
,
"visible"
,
FALSE
,
NULL
);
watt
->
input_open
=
0
;
}
}
void
WAttGtk
::
print
(
const
char
*
title
)
{
pwr_tStatus
sts
;
...
...
@@ -350,9 +362,6 @@ void WAttGtk::activate_cmd_input( GtkWidget *w, gpointer data)
WAttGtk
*
watt
=
(
WAttGtk
*
)
data
;
int
sts
;
g_object_set
(
watt
->
cmd_prompt
,
"visible"
,
FALSE
,
NULL
);
g_object_set
(
watt
->
cmd_input
,
"visible"
,
FALSE
,
NULL
);
watt
->
wattnav
->
set_inputfocus
();
textutf8
=
gtk_editable_get_chars
(
GTK_EDITABLE
(
w
),
0
,
-
1
);
...
...
@@ -369,6 +378,9 @@ void WAttGtk::activate_cmd_input( GtkWidget *w, gpointer data)
}
g_free
(
text
);
g_object_set
(
watt
->
cmd_prompt
,
"visible"
,
FALSE
,
NULL
);
g_object_set
(
watt
->
cmd_input
,
"visible"
,
FALSE
,
NULL
);
if
(
watt
->
pending_close
)
{
if
(
watt
->
close_cb
)
(
watt
->
close_cb
)(
watt
);
...
...
@@ -584,10 +596,13 @@ WAttGtk::WAttGtk(
cmd_prompt
=
gtk_label_new
(
"value > "
);
gtk_widget_set_size_request
(
cmd_prompt
,
-
1
,
25
);
cmd_entry
=
new
CoWowEntryGtk
(
&
value_recall
);
cmd_entry
->
set_hide_on_esc
(
true
);
cmd_input
=
cmd_entry
->
widget
();
gtk_widget_set_size_request
(
cmd_input
,
-
1
,
25
);
g_signal_connect
(
cmd_input
,
"activate"
,
G_CALLBACK
(
activate_cmd_input
),
this
);
g_signal_connect
(
cmd_input
,
"hide"
,
G_CALLBACK
(
hide_cmd_input
),
this
);
gtk_box_pack_start
(
GTK_BOX
(
statusbar
),
msg_label
,
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
statusbar
),
cmd_prompt
,
FALSE
,
FALSE
,
0
);
...
...
wb/lib/wb/gtk/wb_watt_gtk.h
View file @
1b3d717d
...
...
@@ -96,6 +96,7 @@ class WAttGtk : public WAtt {
static
void
activate_cmd_scrolled_ok
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_cmd_scrolled_ca
(
GtkWidget
*
w
,
gpointer
data
);
static
void
action_text_inserted
(
GtkTextBuffer
*
w
,
GtkTextIter
*
arg1
,
gchar
*
arg2
,
gint
arg3
,
gpointer
data
);
static
void
hide_cmd_input
(
GtkWidget
*
w
,
gpointer
data
);
};
#endif
...
...
wb/lib/wb/gtk/wb_wtt_gtk.cpp
View file @
1b3d717d
...
...
@@ -1541,6 +1541,31 @@ gboolean WttGtk::action_inputfocus( GtkWidget *w, GdkEvent *event, gpointer data
return
FALSE
;
}
gboolean
WttGtk
::
focused_cmd_input
(
GtkWidget
*
w
,
GdkEvent
*
event
,
gpointer
data
)
{
WttGtk
*
wtt
=
(
WttGtk
*
)
data
;
if
(
wtt
->
accel_g
->
acceleratables
)
gtk_window_remove_accel_group
(
GTK_WINDOW
(
wtt
->
toplevel
),
wtt
->
accel_g
);
return
FALSE
;
}
gboolean
WttGtk
::
hide_cmd_input
(
GtkWidget
*
w
,
gpointer
data
)
{
WttGtk
*
wtt
=
(
WttGtk
*
)
data
;
if
(
wtt
->
input_open
)
{
wtt
->
input_wnav
->
select_object
(
wtt
->
input_node
);
wtt
->
set_prompt
(
""
);
wtt
->
input_open
=
0
;
gtk_window_add_accel_group
(
GTK_WINDOW
(
wtt
->
toplevel
),
wtt
->
accel_g
);
}
else
if
(
wtt
->
command_open
)
gtk_window_add_accel_group
(
GTK_WINDOW
(
wtt
->
toplevel
),
wtt
->
accel_g
);
return
FALSE
;
}
void
WttGtk
::
open_input_dialog
(
const
char
*
text
,
const
char
*
title
,
const
char
*
init_text
,
void
(
*
ok_cb
)(
Wtt
*
,
char
*
))
...
...
@@ -2145,7 +2170,7 @@ WttGtk::WttGtk(
CoWowGtk
::
SetWindowIcon
(
toplevel
);
GtkAccelGroup
*
accel_g
=
(
GtkAccelGroup
*
)
g_object_new
(
GTK_TYPE_ACCEL_GROUP
,
NULL
);
accel_g
=
(
GtkAccelGroup
*
)
g_object_new
(
GTK_TYPE_ACCEL_GROUP
,
NULL
);
gtk_window_add_accel_group
(
GTK_WINDOW
(
toplevel
),
accel_g
);
GtkMenuBar
*
menu_bar
=
(
GtkMenuBar
*
)
g_object_new
(
GTK_TYPE_MENU_BAR
,
NULL
);
...
...
@@ -2855,10 +2880,15 @@ WttGtk::WttGtk(
cmd_prompt
=
gtk_label_new
(
"value > "
);
gtk_widget_set_size_request
(
cmd_prompt
,
-
1
,
25
);
cmd_entry
=
new
CoWowEntryGtk
(
&
cmd_recall
);
cmd_entry
->
set_hide_on_esc
(
true
);
cmd_input
=
cmd_entry
->
widget
();
gtk_widget_set_size_request
(
cmd_input
,
-
1
,
25
);
g_signal_connect
(
cmd_input
,
"activate"
,
G_CALLBACK
(
WttGtk
::
valchanged_cmd_input
),
this
);
g_signal_connect
(
cmd_input
,
"focus-in-event"
,
G_CALLBACK
(
WttGtk
::
focused_cmd_input
),
this
);
g_signal_connect
(
cmd_input
,
"hide"
,
G_CALLBACK
(
WttGtk
::
hide_cmd_input
),
this
);
gtk_box_pack_start
(
GTK_BOX
(
statusbar
),
msg_label
,
FALSE
,
FALSE
,
20
);
gtk_box_pack_start
(
GTK_BOX
(
statusbar
),
cmd_prompt
,
FALSE
,
FALSE
,
20
);
...
...
wb/lib/wb/gtk/wb_wtt_gtk.h
View file @
1b3d717d
...
...
@@ -128,6 +128,7 @@ class WttGtk : public Wtt {
GtkWidget
*
tools_edit_w
;
GtkWidget
*
tools_buildnode_w
;
GtkWidget
*
tools_save_w
;
GtkAccelGroup
*
accel_g
;
int
set_focus_disabled
;
gint
disfocus_timerid
;
gint
selection_timerid
;
...
...
@@ -281,6 +282,8 @@ class WttGtk : public Wtt {
static
void
reset_avoid_deadlock
(
Wtt
*
wtt
);
static
void
set_avoid_deadlock
(
Wtt
*
wtt
,
int
time
);
static
gboolean
action_inputfocus
(
GtkWidget
*
w
,
GdkEvent
*
event
,
gpointer
data
);
static
gboolean
focused_cmd_input
(
GtkWidget
*
w
,
GdkEvent
*
event
,
gpointer
data
);
static
gboolean
hide_cmd_input
(
GtkWidget
*
w
,
gpointer
data
);
static
void
menu_position_func
(
GtkMenu
*
menu
,
gint
*
x
,
gint
*
y
,
gboolean
*
push_in
,
gpointer
data
);
static
void
popup_button_cb
(
GtkWidget
*
w
,
gpointer
data
);
...
...
xtt/lib/cow/gtk/cow_wow_gtk.cpp
View file @
1b3d717d
...
...
@@ -1153,6 +1153,11 @@ gboolean CoWowEntryGtk::event_cb( GtkWidget *w, GdkEvent *event, gpointer data)
sts
=
TRUE
;
break
;
}
case
GDK_Escape
:
if
(
en
->
m_hide_on_esc
)
gtk_widget_hide
(
w
);
sts
=
FALSE
;
break
;
default:
sts
=
FALSE
;
}
...
...
xtt/lib/cow/gtk/cow_wow_gtk.h
View file @
1b3d717d
...
...
@@ -68,6 +68,7 @@ class CoWowEntryGtk {
CoWowRecall
*
m_re
;
GtkWidget
*
w
;
bool
m_re_alloc
;
bool
m_hide_on_esc
;
CoWowEntryGtk
(
CoWowRecall
*
re
=
0
);
~
CoWowEntryGtk
();
...
...
@@ -76,6 +77,9 @@ class CoWowEntryGtk {
if
(
!
m_re_alloc
)
m_re
=
re
;
}
void
set_hide_on_esc
(
bool
hide
)
{
m_hide_on_esc
=
hide
;
}
static
gboolean
event_cb
(
GtkWidget
*
w
,
GdkEvent
*
event
,
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