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
badf62ba
Commit
badf62ba
authored
Feb 06, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conversion ISO to UTF8 in textfields
parent
e2255584
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
wb/lib/wb/gtk/wb_watt_gtk.cpp
wb/lib/wb/gtk/wb_watt_gtk.cpp
+8
-3
wb/lib/wb/gtk/wb_wtt_gtk.cpp
wb/lib/wb/gtk/wb_wtt_gtk.cpp
+4
-2
No files found.
wb/lib/wb/gtk/wb_watt_gtk.cpp
View file @
badf62ba
/*
/*
* Proview $Id: wb_watt_gtk.cpp,v 1.
4 2007-02-06 10:06:41
claes Exp $
* Proview $Id: wb_watt_gtk.cpp,v 1.
5 2007-02-06 13:22:47
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -114,7 +114,10 @@ void WAttGtk::change_value( int set_focus)
...
@@ -114,7 +114,10 @@ void WAttGtk::change_value( int set_focus)
gtk_text_buffer_delete
(
cmd_scrolled_buffer
,
&
start_iter
,
&
end_iter
);
gtk_text_buffer_delete
(
cmd_scrolled_buffer
,
&
start_iter
,
&
end_iter
);
gtk_text_buffer_get_start_iter
(
cmd_scrolled_buffer
,
&
start_iter
);
gtk_text_buffer_get_start_iter
(
cmd_scrolled_buffer
,
&
start_iter
);
gtk_text_buffer_insert
(
cmd_scrolled_buffer
,
&
start_iter
,
value
,
-
1
);
char
*
textutf8
=
g_convert
(
value
,
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
gtk_text_buffer_insert
(
cmd_scrolled_buffer
,
&
start_iter
,
textutf8
,
-
1
);
g_free
(
textutf8
);
// Select the text
// Select the text
// gtk_text_buffer_get_start_iter( cmd_scrolled_buffer, &start_iter);
// gtk_text_buffer_get_start_iter( cmd_scrolled_buffer, &start_iter);
...
@@ -122,9 +125,11 @@ void WAttGtk::change_value( int set_focus)
...
@@ -122,9 +125,11 @@ void WAttGtk::change_value( int set_focus)
// gtk_text_buffer_select_range( cmd_scrolled_buffer, &start_iter, &end_iter);
// gtk_text_buffer_select_range( cmd_scrolled_buffer, &start_iter, &end_iter);
}
}
else
{
else
{
char
*
textutf8
=
g_convert
(
value
,
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
gint
pos
=
0
;
gint
pos
=
0
;
gtk_editable_delete_text
(
GTK_EDITABLE
(
cmd_input
),
0
,
-
1
);
gtk_editable_delete_text
(
GTK_EDITABLE
(
cmd_input
),
0
,
-
1
);
gtk_editable_insert_text
(
GTK_EDITABLE
(
text_w
),
value
,
strlen
(
value
),
&
pos
);
gtk_editable_insert_text
(
GTK_EDITABLE
(
text_w
),
textutf8
,
strlen
(
textutf8
),
&
pos
);
g_free
(
textutf8
);
// Select the text
// Select the text
gtk_editable_set_position
(
GTK_EDITABLE
(
cmd_input
),
-
1
);
gtk_editable_set_position
(
GTK_EDITABLE
(
cmd_input
),
-
1
);
...
...
wb/lib/wb/gtk/wb_wtt_gtk.cpp
View file @
badf62ba
/*
/*
* Proview $Id: wb_wtt_gtk.cpp,v 1.
9 2007-02-06 10:06:41
claes Exp $
* Proview $Id: wb_wtt_gtk.cpp,v 1.
10 2007-02-06 13:22:47
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -726,9 +726,11 @@ void WttGtk::open_change_value()
...
@@ -726,9 +726,11 @@ void WttGtk::open_change_value()
gtk_widget_grab_focus
(
cmd_input
);
gtk_widget_grab_focus
(
cmd_input
);
if
(
value
)
{
if
(
value
)
{
char
*
textutf8
=
g_convert
(
value
,
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
gint
pos
=
0
;
gint
pos
=
0
;
gtk_editable_delete_text
(
GTK_EDITABLE
(
cmd_input
),
0
,
-
1
);
gtk_editable_delete_text
(
GTK_EDITABLE
(
cmd_input
),
0
,
-
1
);
gtk_editable_insert_text
(
GTK_EDITABLE
(
cmd_input
),
value
,
strlen
(
value
),
&
pos
);
gtk_editable_insert_text
(
GTK_EDITABLE
(
cmd_input
),
textutf8
,
strlen
(
textutf8
),
&
pos
);
g_free
(
textutf8
);
// Select the text
// Select the text
gtk_editable_set_position
(
GTK_EDITABLE
(
cmd_input
),
-
1
);
gtk_editable_set_position
(
GTK_EDITABLE
(
cmd_input
),
-
1
);
...
...
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