Re: offer to code mouse wheel (To Pete)

new topic     » topic index » view thread      » older message » newer message

Hi Pete,
   I've tried to communicate with you to your private mail, but i got
an error saying that your inbox is full, so i'm sending the mails here:

"Hi Pete,
   I did the code (it's on the end of the mail).
   Another suggestion would be to be able to select using both mouse +
arrows (i always mix a little of mouse and keys when selecting).
   Oh, i almost forget, it would be cool that ctrl+left/right went to
the next word, ie: (I = the cursor)   Ivar = 134   after pressing
ctrl+right twice i would like to end like this: var = I134

Here's the code, I put it after procedure tick() oh, maybe you should
add a check to see if a file is opened or something like that, i didn't
check about that:


--={ GB - Guillermo Bonvehi }=--
procedure eventhandler(integer Event, atom wParam, atom hParam)
        integer Shifted, Controled
        if hParam = 0 then end if -- Dummy, to avoid warnings
        Shifted = 0
        Controled = 0
        if Event = #20A then -- WM_MOUSEWHEEL = #20A
            hideCursor()
            if shortInt(lo_word(wParam)) = MK_CONTROL then Controled =
1 end if
            if shortInt(lo_word(wParam)) = MK_SHIFT then Shifted = 1
end if
            if shortInt(lo_word(wParam)) = or_bits(MK_CONTROL,MK_SHIFT)
then Shifted = 1 Controled = 1 end if
           
            if Shifted then
                if not isTextSelected() then
                    initiateTextSelection( getCursorLine(),
getCursorColumn() )
                end if
            end if
           
            if shortInt(hi_word(wParam)) > 0 then
                if Controled then
                    if getTopLine()> 1 then
                        moveCursorUp()
                      
void=scrollScreen(getTopLine()-1,getLeftColumn())
                        setDisplayRange(getTopLine(),
getTopLine()+getScreenRows())
                        resolveEvent()
                    end if
                else
                    moveCursorUp()
                end if
            else
                if Controled then
                    if getTopLine()<getNumberOfLinesInFile() then
                        moveCursorDown()
                      
void=scrollScreen(getTopLine()+1,getLeftColumn())
                        setDisplayRange(getTopLine(),
getTopLine()+getScreenRows())
                        resolveEvent()
                    end if
                else
                    moveCursorDown()
                end if
            end if
            if Shifted then
                continueTextSelection( getCursorLine(),
getCursorColumn() )
            end if
            resolveEvent()
            showCursor()
            setEditorFocus()
        end if
end procedure
onEvent[MAIN] = routine_id("eventhandler")
--={ EGB }=--

Best Regards,
    Guillermo Bonvehi
    AKA: KNiXEUR - Caballero Rojo"

"Hi Pete,
   Maybe you could add an option to choose how many lines scroll with
the wheel (I think that would be nice, if itsn't not the option is
optional =P).

=====
Best Regards,
    Guillermo Bonvehi
    AKA: Knixeur - Caballero Rojo"

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu