You assigned hotkey in HotKey plugin or in Scripts plugin? In any case that plugin should be setup for autoload.assigned it to a hotkey
hotkey for text margins etc -- a "writer's script"
- Author
- Message
-
Offline
- Posts: 767
- Joined: Mon Sep 28, 2009 10:03 am
- Location: Minsk, Belarus
-
Offline
- Posts: 19
- Joined: Tue Apr 19, 2011 12:50 pm
Now it works. Great, thanks
Since we're "at it", two more questions though:
1. Is it possible to change the location of AkelFiles folder?
(Explanation: to have one AP instance always in "writing" mode and another in "normal" mode, I'm using two different .exe and .ini files -- but would be nice if these "different programs" shared all the scripts, plugins etc. Because as for now, I have to manually synchronize any changes related to plugs/scripts.)
2. Can one also somehow change the title of AkelPad window? Ie to have a "AkelPad Notes" and a "AkelPad Writing"? (That's handy for Alt-Tabbing in Windows )
Thanks,
M.
Since we're "at it", two more questions though:
1. Is it possible to change the location of AkelFiles folder?
(Explanation: to have one AP instance always in "writing" mode and another in "normal" mode, I'm using two different .exe and .ini files -- but would be nice if these "different programs" shared all the scripts, plugins etc. Because as for now, I have to manually synchronize any changes related to plugs/scripts.)
2. Can one also somehow change the title of AkelPad window? Ie to have a "AkelPad Notes" and a "AkelPad Writing"? (That's handy for Alt-Tabbing in Windows )
Thanks,
M.
Last edited by martz on Sat Aug 20, 2011 10:08 pm, edited 1 time in total.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
You can do it by the script SetWindowTitle.js:martz wrote:2. Can one also somehow change the title of AkelPad window? Ie "AkelPad Notes" and "AkelPad Writing"?
Code: Select all
var sWndTitle = "AkelPad Notes";
var hMainWnd = AkelPad.GetMainWnd();
var lpText;
if ((hMainWnd) && (lpText = AkelPad.MemAlloc((sWndTitle.length + 1) * _TSIZE)))
{
AkelPad.MemCopy(lpText, sWndTitle, _TSTR);
AkelPad.SystemFunction().Call("user32::SetWindowText" + _TCHAR, hMainWnd, lpText);
AkelPad.MemFree(lpText);
}
-
Offline
- Posts: 2247
- Joined: Tue Aug 07, 2007 2:03 pm
- Location: Vinnitsa, Ukraine
KDJ, your code can be much simpler - only one statement.
Code: Select all
AkelPad.SystemFunction().Call("user32::SetWindowText" + _TCHAR, AkelPad.GetMainWnd(), "AkelPad Notes")
-
Offline
- Posts: 19
- Joined: Tue Apr 19, 2011 12:50 pm
This is excellent, guys. Thank you again!
(Btw, I already embedded a different color icon into one of my AkelPad.exe files, so now it's really comfy to switch between the "different applications".)
So, as for now, I've only got one slight annoyance. When the whole screen is already filled with text and I continue typing, then the caret stays on the very bottom line of the screen. In the long run this is inconvenient for the eyes. Hence, could a script:
a) Add customizable top and bottom margins to the full screen window or
b) As a workaround, enable a "page break". That is, after reaching the bottom of the screen, the script would always empty the screen and I could start typing from the top line of the window again.
I think (and hope) not only the "article writers" but also coders would benefit from additions like these.
Thanks for any thoughts,
AP is an awesome tool,
M.
(Btw, I already embedded a different color icon into one of my AkelPad.exe files, so now it's really comfy to switch between the "different applications".)
So, as for now, I've only got one slight annoyance. When the whole screen is already filled with text and I continue typing, then the caret stays on the very bottom line of the screen. In the long run this is inconvenient for the eyes. Hence, could a script:
a) Add customizable top and bottom margins to the full screen window or
b) As a workaround, enable a "page break". That is, after reaching the bottom of the screen, the script would always empty the screen and I could start typing from the top line of the window again.
I think (and hope) not only the "article writers" but also coders would benefit from additions like these.
Thanks for any thoughts,
AP is an awesome tool,
M.
Last edited by martz on Sun Aug 21, 2011 11:15 am, edited 1 time in total.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Indeed, it works.FeyFre wrote:KDJ, your code can be much simpler - only one statement.Code: Select all
AkelPad.SystemFunction().Call("user32::SetWindowText" + _TCHAR, AkelPad.GetMainWnd(), "AkelPad Notes")
But, the description on msdn shows, that the second argument of SetWindowText() is of type LPCTSTR - a pointer to the string.
-
Offline
- Posts: 2247
- Joined: Tue Aug 07, 2007 2:03 pm
- Location: Vinnitsa, Ukraine
Yes, and Call method automatically detects argument as string and converts it internally into LPCSTR representation.(This feature was introduced a while ago into Scripts plugin)But, the description on msdn shows, that the second argument of SetWindowText() is of type LPCTSTR - a pointer to the string.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
FeyFre
Well, yes, but in SendMessage() method can not use a string, it must be a pointer.
generates a data type mismatch error.
Well, yes, but in SendMessage() method can not use a string, it must be a pointer.
Code: Select all
AkelPad.SendMessage(AkelPad.GetMainWnd(), 0x000C /*WM_SETTEXT*/, 0, "AkelPad Notes");
-
Offline
- Posts: 1862
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
-
Offline
- Posts: 3217
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
While, with some reservations, you can try the to Scroll-plugin, see the description of the Scroll::Settings-function for call an external in plug-in documentation.martz wrote:So, as for now, I've only got one slight annoyance. When the whole screen is already filled with text and I continue typing, then the caret stays on the very bottom line of the screen. In the long run this is inconvenient for the eyes.
I added the proposal to expand the functionality of the plug-in topic.
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
This is possible with AEM_SETRECT, but maybe next variant will be more suitable.martz wrote:a) Add customizable top and bottom margins to the full screen window...
"Next variant" Add new shortcut in Hotkeys plugin:martz wrote:b) As a workaround, enable a "page break". That is, after reaching the bottom of the screen, the script would always empty the screen and I could start typing from the top line of the window again.
Name: EnterNoscroll
Command: Call("Scroll::Settings", 5)
Hotkey: Enter or Ctrl+Enter
P.S. of course Scroll plugin must be installed.
Infocatcher wrote:I think, it would be good to improve SendMessage().KDJ wrote:Well, yes, but in SendMessage() method can not use a string, it must be a pointer.
Code: Select all
oSys.Call("user32::SendMessage" + _TCHAR, hWndFind, 0x143 /*CB_ADDSTRING*/, 0, "12345");
-
Offline
- Posts: 1862
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
Yes, but why not make a similar improvement in SendMessage() ?Instructor wrote:Code: Select all
oSys.Call("user32::SendMessage" + _TCHAR, hWndFind, 0x143 /*CB_ADDSTRING*/, 0, "12345");
-
Offline
- Posts: 19
- Joined: Tue Apr 19, 2011 12:50 pm
Hmm, this doesn't do the trick for me. Instead it shows me the beginning of the file (line 1).Instructor wrote:"Next variant" Add new shortcut in Hotkeys plugin:martz wrote:b) As a workaround, enable a "page break". That is, after reaching the bottom of the screen, the script would always empty the screen and I could start typing from the top line of the window again.
Name: EnterNoscroll
Command: Call("Scroll::Settings", 5)
Hotkey: Enter or Ctrl+Enter
P.S. of course Scroll plugin must be installed.
How would you implement this with AEM_SETRECT?
Thanks a bunch,
M.