Feature Request - Smart EDIT

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

pj
Gold Member
Gold Member
Posts: 477
Joined: 2006 Jan 26, 14:01
Location: Florida

Re: Feature Request - Smart EDIT

Post by pj »

Kilmatead wrote:... Download: TemperTantrumEdit ...The name and icon, in case you didn't guess, are a response to PJ's little rant. Civility and age progress by inverse proportions within his blood-line, apparently. :wink:
I have yet to see a case in which calm discourse stirred Nikos to action. Most changes come about as hoards with pitchforks and torches march upon his doorstep. Please cite reference if I'm wrong.

Sorry, Nikos, but, even given that you're a one-man band, the conductor is beginning to look like Tristan.
otlaolap
Silver Member
Silver Member
Posts: 239
Joined: 2007 Aug 11, 21:37

Re: Feature Request - Smart EDIT

Post by otlaolap »

Kilmatead wrote: Using the "$L" and "$R" tokens in user-commands give the pane-paths accordingly. The most difficult thing is usually determining the "active pane" if you need it, which pretty much all of my scripts have a reliable stock method of doing.
Do you mind sharing? Most of my scripts use the contents of the edit box (called the "address bar" in the help file) to get the path to the active pane. There is additional internal work to keep track of what has been opened in each pane (because both panes may be open to the same place). This works well enough for me in my usages, but I've always felt this to be a rather untrustworthy hack.
Kilmatead
Platinum Member
Platinum Member
Posts: 4580
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Feature Request - Smart EDIT

Post by Kilmatead »

The simplest script would be this one which removes the focus from the current active pane. (It doesn't matter what the script is actually for, you just want to goo inside.) This is written in AutoIt, but conversion into AHK (or whatever) would be pretty straightforward as the constants and SendMessage() calls are normal, as long as you understand what it's doing first.

Download the zip and just look at the function _GetActivePane() which follows the simple regex-verification that the active window is actually an x2 window.

The function itself returns the ClassName of the active pane, such that:

$SCRAP = "ATL:BrowserListView1" ; This is the "miniscrap" pane, if visible
$LEFT = "ATL:BrowserListView2"
$RIGHT = "ATL:BrowserListView3"

Afterwards, you can use ControlGetHandle() or something on that classname string which would give you the handle of the actual pane-control itself, which then lets you manipulate it (and thus its contents) any way you want. :D

Like your own idea, it's based off the Addressbar control, but it's not subject to any real interference, and I consider it 100% reliable, a status which not even my own mum qualifies for. :wink:
otlaolap
Silver Member
Silver Member
Posts: 239
Joined: 2007 Aug 11, 21:37

Re: Feature Request - Smart EDIT

Post by otlaolap »

Thanks. I did not want actually to touch the edit box. As a side effect of your elegant script I see now the number 33131 (previously unknown to me and requiring sending the enter character instead) and this has caused me to go back for a new thorough scavenge through the resources. Thanks again.
Kilmatead
Platinum Member
Platinum Member
Posts: 4580
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Feature Request - Smart EDIT

Post by Kilmatead »

otlaolap wrote:I did not want actually to touch the edit box.
It's quite reliable, and even works when the Addressbar is "hidden", so such scripts are fine for public consumption. If you're worried about disturbing the text that's there, all you have to do is store it in a buffer, do your dirty-work, and replace the text... no one will ever even know you had your hand in the cookie-jar.

33131 - that's exactly the thing that makes it reliable - none of this blindly sending key-codes into an active window "hoping" nothing else is going to get in the way. This way it's clean and surgical. Took me ages to find that code, as it's not immediately obvious. :D
Enternal
Member
Member
Posts: 54
Joined: 2013 Aug 03, 05:28

Re: Feature Request - Smart EDIT

Post by Enternal »

Kilmatead wrote:Yeah, CodeBlocks is the IDE, but that's not really important - the source is tiny, relatively speaking; the project file is included just in case anyone wants to compile from scratch where the libraries are manually linked. The compiler is the TDM-GCC 64 branch of MinGW, but that too isn't important - the code is all just WinAPI so any setup could make it. :shrug:

You must have missed my Road to Damascus Moment. :wink:
Yeah I sure did... and it sure is pretty to look at :) Seen plenty of GUI software written in C++. Plenty of console software written in C. But rarely any GUI software written in C. That's cool... :shock:
Kilmatead wrote:I thought you were a PureBasic guy, no? With a real license all your own and everything.

I design GUI's to be "loose" (airy?) to make it easier to add options later (if necessary) without needing to move stuff around too much, as I don't cheat by using a resource-editor in design: it's all done manually by hand (and numbers). :D I also design in a higher-DPI so sometimes things look a little different when scaled down, but I try to test everything to make sure its voice doesn't change too much when you kick it in the gonads.
Naw I'm not exactly a PureBasic guy. I just wanted to learn PureBasic and take it for a spin. Although I liked it, I probably won't use it too much. Currently looking at Free Pascal and Lazarus so I wrote my new (probably pointless) tool in it.

And are you a tailor or something? Or perhaps an M? Doing it all by hand wow that's crazy :)
Kilmatead wrote:Using the "$L" and "$R" tokens in user-commands give the pane-paths accordingly. The most difficult thing is usually determining the "active pane" if you need it, which pretty much all of my scripts have a reliable stock method of doing.
PERFECT. This is what I'm looking for. Going to have fun with this now and see if I can get it working with my little (probably pointless) tool hehe.
Kilmatead wrote:I think Nikos already took care of that, no?
Yeah it did but I just want to "collect" Total Commander :twisted:

pj&co 9
nikos 3

Nikos! You lost! You must implement that feature! *runs away before he gets smacked by nikos*
Post Reply