Re: Navigating

Yan Seiner <[email protected]>
Newsgroups gmane.comp.web.links
Message-ID <[email protected]>
Jonas Fonseca napsal(a):
> Yan Seiner <[email protected]> wrote Wed, May 02, 2007:
>   
>> I'm trying to make elinks into a front end for our embedded panel.  So 
>> far, I've figured out how to manipulate the form and users can enter and 
>> modify the information on the forms with our interface.
>>
>> I'm having a bit of an issue with navigation, though.
>>
>> Question 1:
>>
>> The form fields are labeled and contain attributes with nav info, eg
>> <INPUT type='text'  class='float' id='F_2' idindex='22'  tabindex='14' 
>> WRAP='true'  NUMTYPE='bearing'  VALUE='125'  SIZE='4'  NAME='F_2'  
>> right='T_2' left='' up='F_1' down='F_3'>
>>
>> So on down arrow I need to navigate to the INPUT field with ID of 
>> 'F_3'.  I've modified the parser code to extract the attributes I need, 
>> but I can't figure out the navigation....
>>
>> How do I navigate 'by force'?  Somehow I need to be able to extract the 
>> information from the INPUT element and use it to navigate.  I've tried 
>> next_link_in_dir from within the forms editor but it seems to have no 
>> effect....
>>
>> What function or combination of functions should I be looking at to:
>>
>> exit edit mode
>> navigate to a given field in the form
>>     
>
> I think it will be enough to search the document->links for the form and then
> jump to the link. Maybe you need to escape the edit/insert mode yourself.
>
> 	struct document *document = doc_view->document;
>         int link;
>
>         for (link = 0; link < document->nlinks; link++) {
>                 struct form_control *fc = get_link_form_control(&document->links[link]);
>
>                 if (fc && fc->form == form
> 		    && CHECK FOR FORM ID) {
>                         jump_to_link_number(ses, doc_view, link);
>                         return;
>                 }
>         }
>   
OK, thanks.
>   
>> Question 2:
>>
>> I need to implement shortcuts so that when a user hits a button, s/he is 
>> taken to a new page.  Right now I have F1 mapped to "HomeURL", F2 to 
>> 'back", and F5 to "HelpURL".  How do I tie these keys to URLs?
>>     
>
> Using building keybindings / actions. This requires adding something to
> src/config/action-*.inc and src/viewer/action.c. Maybe try to look for
> the patch of a new action that was added in the past.
>
>   

Great!  I'll look into that section of the code when I get to work...

One thing that would help developers like me is a diagram of the path 
that a character takes as it moves from the keyboard through elinks....  
(If this is in the docs, I missed it...)

I really like the way the code is structured, and it all makes a lot of 
sense, but it is difficult to trace how keyboard input is handled.

For my application, elinks is a great front end to a complex back end.

Thanks for all the hard work, folks.

--Yan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.