Alternative method of selecting the text

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 57
Joined: Sun Jul 27, 2008 6:47 am
Location: slovakia

Alternative method of selecting the text

Post by pvagner »

Hello,
Is there a plugin or script or whatewer which adds ability to use keyboard shortcuts to define start and end of the selection?
To describe it in simple words I am looking for something like this:
1) use arrow keys to navigate where I'd like to start selecting the text.
2) press a hotkey which will store the caret position.
3) navigate to the position where I'd like to stop selecting the text.
4) press another hotkey which will store the caret position and examine whether start position is already stored If yes then it will select all the text between these 2 caret positions.
I am unable to find such functionality my-self so I have started doing a plugin but I am doing it the wrong way. I have exported 2 functions which store SelStart and SelEnd in a global variable. The problem is when akelpad calls function from a plugin and the function returs it unloads the dll and if the function is executed one more time or if another function is executed looking for something what the first function has stored inside a global variable it simply can't find it because dll has been reloaded and it's back to initial state. I am not very experienced programmer so perhaps this is completelly wrong way of doing this. Anyway I'd just like to show I am happy try doing things when I miss something. So even I might be able to learn something from you. Here is a skeleton of very simple plugin I am tallking about

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

If you don't want to unload plugin:

Code: Select all

...
    SelStart =-1;
    SelEnd =-1;
  }
  pd->nUnload=UD_NONUNLOAD;
}
...

Offline
Posts: 57
Joined: Sun Jul 27, 2008 6:47 am
Location: slovakia

Post by pvagner »

is it correctly unloaded on exit or do I need to do something about that too?

While I am asking about plugins... Is it possible for a plugin to add a pannel into the status bar? I'd like to add something what shows total character count in a document.

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

pvagner wrote:is it correctly unloaded on exit or do I need to do something about that too?
Program will unload it on exit.
Is it possible for a plugin to add a pannel into the status bar? I'd like to add something what shows total character count in a document.
It is possible :)

Offline
Posts: 57
Joined: Sun Jul 27, 2008 6:47 am
Location: slovakia

Post by pvagner »

Sorry for another question related to coding plugins...
How can one get notified when text in a document changes and when caret position changes? I think I can just hook AEN_SELCHANGED and AEN_TEXTCHANGED messages. Anyway I am confused which window to subclass because these are AkelEdit control specific messages and at the other hand there is "Sends to the parent window procedure..." written in the description for each such notification. So which window are these messages sent to? is that

Code: Select all

pd->hMainWnd
or

Code: Select all

pd->hWndEdit
?
Or is there a more universal way of getting such a notifications so I can make the plugin working even with AkelPad 3.6?
Edit: Ok perhaps I have figured something out my-self. Edit parent window is either main window or if MDI is active then it's the frame.
Post Reply