[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xforms-cvs] Problems with shortcuts
From: |
xforms |
Subject: |
Re: [Xforms-cvs] Problems with shortcuts |
Date: |
Thu, 07 Jul 2005 16:59:14 +0200 |
Thank You, Serge, for your answer!
> 1) I have tried a simple application using "^M" as the shortcut for Return.
> This seems to work fine for me. Even on a form that has input objects.
1)I test a button with "^M" but no reaction! It is the same problem like 2). I
looked at the output from the application "xev" and see the same event with
CTRL-M and return key press; but all classic xfroms application like fdesign
or xfmail shows the same problem: no reaction by pressing a return key or
CTRL-M on return buttons.
> 3) The "aA" example shows two states. When you press the "a" the button
> visibly goes down. When you release the key it goes up. Some time the mouse
> click is so fast that you do not see the button being going down. You may see
> two reactions because the button is not the type "NORMAL BUTTON". Some
> buttons give 2 reactions.
3)I mean a normal button (NORMAL_BUTTON) with a shortcut!! On one hand I press
the button with the mouse. When I let the button comes up, the callback
function works. It's fine. On the other hand I press the shortcut key very
short(no key auto repeat is possible). When the button comes up, now the
callback function works twice.
> If you sent a sample program it would be easier to see the problem.
I use xforms with freepascal. My first Idea, there is the problem with the
freepascal-compiler(fpc), but other applications shows the same problems. So I
think, it's not the problem with the compiler. The fpc use the XForms library
directly over a unit with the external (XForms-) function from the forms
library. It's a very stable procedure to use c-librarys under fpc without
problems.
some source:
{this is a comment}
{the '...' is other fp-source}
...
function _the_callback_function_name(obj:PFL_OBJECT;data:longint);cdecl;
begin
{write to stdout by starting form xterm,terminal,...}
writeln('here i'am');
end;
...
fl_initialize(@argc,argv,'Xgelb',nil,0);
form:=fl_bgn_form(FL_UP_BOX,600,600);
...
{for problem 1}
obj1:=fl_add_button(FL_RETURN_BUTTON,10,10,100,25'press return');
{no fl_set_button_shortcut... or fl_set_button_shortcut(obj1,'^M',1);}
fl_set_object_callback(obj1,PFL_CALLBACKPTR(@_the_callback_function_name),longint(PData));
...
{for problem 2}
obj2:=fl_add_button(FL_NORMAL_BUTTON,10,110,100,25,'Button 2');
fl_set_button_shortcut(obj2,'^O',1);
fl_set_object_callback(obj2,PFL_CALLBACKPTR(@_the_callback_function_name),longint(PData));
...
{problem 3}
obj3:=fl_add_button(FL_NORMAL_BUTTON,10,110,100,25,'Button 3');
fl_set_button_shortcut(obj3,'Bb',1);
fl_set_object_callback(obj3,PFL_CALLBACKPTR(@_the_callback_function_name),longint(PData));
...
fl_end_form;
fl_show_form(form,FL_PLACE_CENTER,FL_NOBORDER,'Xgelb-Shortcut-Test');
while fl_do_forms<>nil do;
fl_hide_form(form);
...
thanks and bye
xgelb
_________________________________________________________________________
Mit der Gruppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle
Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179