AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Alternative method of selecting the text

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
pvagner



Joined: 27 Jul 2008
Posts: 57
Location: slovakia

PostPosted: Mon Aug 04, 2008 9:08 pm    Post subject: Alternative method of selecting the text Reply with quote

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
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5423

PostPosted: Tue Aug 05, 2008 4:04 am    Post subject: Reply with quote

If you don't want to unload plugin:
Code:
...
    SelStart =-1;
    SelEnd =-1;
  }
  pd->nUnload=UD_NONUNLOAD;
}
...
Back to top
View user's profile Send private message Send e-mail
pvagner



Joined: 27 Jul 2008
Posts: 57
Location: slovakia

PostPosted: Tue Aug 05, 2008 7:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5423

PostPosted: Tue Aug 05, 2008 1:48 pm    Post subject: Reply with quote

pvagner wrote:
is it correctly unloaded on exit or do I need to do something about that too?
Program will unload it on exit.
Quote:
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 Smile
Back to top
View user's profile Send private message Send e-mail
pvagner



Joined: 27 Jul 2008
Posts: 57
Location: slovakia

PostPosted: Fri Aug 08, 2008 2:40 pm    Post subject: Reply with quote

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:
pd->hMainWnd
or
Code:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group