On 24.09.2010, at 10:19, MacArthur, Ian (SELEX GALILEO, UK) wrote:

[Roman Kantor wrote:]
>> The modification adds possibility to call these accelerators
>> before TranslateMessage() and DispatchMessage() within
>> fl_wait() (approx. line 338 in Fl_win32.cxx) and if
>> successful, such message is not furthet processed:
>>
>>
>> static int (*translate_accelerator_)(MSG * msg)  = 0;
>>
>> // this platform-specific  declaration  would be  in Fl_win32.H
>> void fl_translate_accelerator(int (*accelerator)(MSG * msg)){
>>    translate_accelerator_ = accelerator;
>> }
>>
>>
>> fl_wait(...){
>>    ...
>>    if(!translate_accelerator_ || !(*translate_accelerator_)(&fl_msg)){
>>          TranslateMessage(&fl_msg);
>>          DispatchMessage(&fl_msg);
>>    }
>> }
>>
>> Implementation of the translator is completely up to the
>> user, normally this pointer is NULL.
>> The function could be even declared without argument as user
>> can always dig it out from fl_msg which is set at that moment.
>>
>> Maybe some users are interested to embed stock "windows
>> controls" - so maybe something similar can be added to next
>> fltk version (1.3)?
>
>
> This is an interesting idea - though I don't think I'd use it right now - but 
> it triggered a bit of a déjà vu for me... Did we not have a discussion a 
> while back about extending the shortcut / accelerator mechanism to allow the 
> user to add their own handlers?

Yes, I had the same impression when I read it.

> This would be in the same ballpark - though I think the proposed scheme was 
> substantially different.

I think that it was almost the same, but with a more general
approach. The principle is the same: give the user a way to
intercept events *before* FLTK uses them, and return whether
FLTK should handle the event or not. I found the STR:

http://www.fltk.org/str.php?L2179


Roman, I think that having such a feature would do exactly
what you requested (for Windows). Is this correct?

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to