Re: gtk_entry_new and accented chars
- From: "Luiz Rafael Culik Guimaraes" <culikr brturbo com br>
- To: "Luiz Rafael Culik Guimaraes" <luiz xharbour com br>, "GTK developer list" <gtk-app-devel-list gnome org>
- Subject: Re: gtk_entry_new and accented chars
- Date: Wed, 16 Jan 2008 13:13:37 -0200
Dear Friends
I have an small app with one gtk_entry_new with an handle to my user
defined key_press_event
but i cannot get the accented char from latin 1 code page on entry
here an part of my key handler
here is the routine for key_press_event
#define WM_MOVE 3
#define WM_SIZE 5
#define WM_KEYDOWN 256 // 0x0100
#define WM_KEYUP 257 // 0x0101
#define WM_MOUSEMOVE 512 // 0x0200
#define WM_LBUTTONDOWN 513 // 0x0201
#define WM_LBUTTONUP 514 // 0x0202
#define WM_LBUTTONDBLCLK 515 // 0x0203
#define WM_RBUTTONDOWN 516 // 0x0204
#define WM_RBUTTONUP 517 // 0x0205
static gint cb_event( GtkWidget *widget, GdkEvent * event, gchar* data )
{
gpointer gObject = g_object_get_data( (GObject*) widget, "obj" );
LONG lRes;
if( !pSym_onEvent )
pSym_onEvent = hb_dynsymFindName( "ONEVENT" );
//if( !gObject )
// gObject = g_object_get_data( (GObject*) (widget-parent->parent),
"obj" );
if( pSym_onEvent && gObject )
{
LONG p1, p2, p3;
if( event->type == GDK_KEY_PRESS || event->type == GDK_KEY_RELEASE )
{
p1 = (event->type==GDK_KEY_PRESS)? WM_KEYDOWN : WM_KEYUP;
p2 = ((GdkEventKey*)event)->keyval;
p3 = ( ( ((GdkEventKey*)event)->state & GDK_SHIFT_MASK )? 1 : 0 ) |
( ( ((GdkEventKey*)event)->state & GDK_CONTROL_MASK )? 2 : 0 ) |
( ( ((GdkEventKey*)event)->state & GDK_MOD1_MASK )? 4 : 0 );
}
else if( event->type == GDK_SCROLL )
{
p1 = WM_KEYDOWN;
p2 = ( ( (GdkEventScroll*)event )->direction == GDK_SCROLL_DOWN )?
0xFF54 : 0xFF52;
p3 = 0;
}
else if( event->type == GDK_BUTTON_PRESS ||
event->type == GDK_2BUTTON_PRESS ||
event->type == GDK_BUTTON_RELEASE )
{
p1 = (event->type==GDK_BUTTON_PRESS)? WM_LBUTTONDOWN :
( (event->type==GDK_BUTTON_RELEASE)? WM_LBUTTONUP :
WM_LBUTTONDBLCLK );
p2 = 0;
p3 = ( ((ULONG)(((GdkEventButton*)event)->x)) & 0xFFFF ) | ( (
((ULONG)(((GdkEventButton*)event)->y)) << 16 ) & 0xFFFF0000 );
}
else if( event->type == GDK_MOTION_NOTIFY )
{
p1 = WM_MOUSEMOVE;
p2 = ( ((GdkEventMotion*)event)->state & GDK_BUTTON1_MASK )? 1:0;
p3 = ( ((ULONG)(((GdkEventMotion*)event)->x)) & 0xFFFF ) | ( (
((ULONG)(((GdkEventMotion*)event)->y)) << 16 ) & 0xFFFF0000 );
}
else if( event->type == GDK_CONFIGURE )
{
p2 = 0;
if( widget->allocation.width != ((GdkEventConfigure*)event)->width
||
widget->allocation.height!=
((GdkEventConfigure*)event)->height )
{
return 0;
}
else
{
p1 = WM_MOVE;
p3 = ( ((GdkEventConfigure*)event)->x & 0xFFFF ) |
( ( ((GdkEventConfigure*)event)->y << 16 ) & 0xFFFF0000 );
}
}
else if( event->type == GDK_ENTER_NOTIFY || event->type ==
GDK_LEAVE_NOTIFY )
{
p1 = WM_MOUSEMOVE;
p2 = ( ((GdkEventCrossing*)event)->state & GDK_BUTTON1_MASK )? 1:0
|
( event->type == GDK_ENTER_NOTIFY )? 0x10:0;
p3 = ( ((ULONG)(((GdkEventCrossing*)event)-x)) & 0xFFFF ) | ( (
((ULONG)(((GdkEventMotion*)event)->y)) << 16 ) & 0xFFFF0000 );
}
else
sscanf( (char*)data,"%ld %ld %ld",&p1,&p2,&p3 );
}
return 0;
}
any ideia?
Regards
Luiz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]