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;
                }
        }

> 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.

-- 
Jonas Fonseca
_______________________________________________
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev

Reply via email to