Page 1 of 2
[IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Mon Jan 03, 2011 8:22 pm
by skywalk
Hi,
Please add some Tool method to navigate the IDE tabs or project files.
If we have the handle to the IDE and the Scintilla gadget, we can only work on the active tab or file.
hIDE = Val(GetEnvironmentVariable("PB_TOOL_MainWindow"))
hSCI = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
Maybe expose the handle to the SysTabControl32?
hTAB = Val(GetEnvironmentVariable("PB_TOOL_IDETAB"))
Then we can SendMessage_(hTAB, #WM_Notify, TabNumber, ?)
By the way, SendKeys([Ctrl+TAB]) does not work while the Tool is running.
It does change the active window after the Tool completes
With this new variable or method, we could write Tools that do more complex searches(in all directions/files) and update the IDE display.
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Wed Jan 30, 2013 6:46 pm
by skywalk
Well, it's been 2 years since this request.
Any chance we can navigate the IDE tabs using a Tool?
I want to unlock and customize the steps behind the 'Find in files' function.
So many possibilities with this variable.

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Wed Jan 30, 2013 7:02 pm
by ts-soft
Your request is good, but there is no way to update a environmentvariable. So it can't work, if some tab closed or
new tabs opened.
I have read in another thread, that freak works on a new "Plugin-Interface".
In the moment, i doesn't found the thread.
Greetings - Thomas
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Wed Jan 30, 2013 7:25 pm
by skywalk
Not sure I understand?
How does find in files jump to the correct tab if already opened?
In tool code I could check whether the tab exists.
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Wed Jan 30, 2013 7:35 pm
by ts-soft
Sorry, my english is very bad.
In the moment, the IDE uses environmentvars for the IDE-Tools. This vars was set before starting your tool. There is no way
to update this values in your tool.
Freak works on another Interface for the IDE, you can found this in another thread of this subforum.
This should help to make some features like your wish to make available.
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Wed Jan 30, 2013 7:46 pm
by skywalk
Oh, maybe I am requesting the wrong term?
Should I request a new environment variable = #PB_Tool_NumTabs?
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Wed Jan 30, 2013 7:59 pm
by ts-soft
No, environmentvar can't help. The values changeless after start of tool, but the user can change many things,
like open new tab, close tab, move tab and so on.
We have to wait for the new interface for the IDE.
// edit:
Here is the thread:
http://www.purebasic.fr/english/viewtop ... 50#p343150
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Thu Feb 14, 2013 8:03 pm
by skywalk
Thanks, I remember that thread.
Since that is too involved and freak said not imminent, I was hoping for a super easy addition of 1 Tool variable to navigate the tabs.
I am curious how 'Find in files' works and why we cannot perform the same functions without overburdening Fred and freak with dozens of tiny feature requests.

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Thu Feb 14, 2013 8:53 pm
by freak
'Find in Files' is part of the IDE. It just calls the appropriate procedure.
If you have "run only a single instance" enabled in the preferences, you can just use RunProgram() to start a new instance of PureBasic.exe and pass your file as a commandline parameter. It will cause the original instance to switch to the file. You can even use the "/L" switch to show a specific line in the file. See here:
http://www.purebasic.com/documentation/ ... dline.html
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Fri Feb 15, 2013 8:52 am
by skywalk
Thanks freak, I tried that a while back and now same result...
IDE - Preferences - General - [x] Run only one Instance
Code: Select all
RunProgram("c:\program files\purebasic\purebasic.exe", "c:\try\try_mv_tab.pb /L 8","c:\try")
A 2nd instance of the IDE starts and loads all my currently loaded files.
Is this a bug?
If I double-click a pb file from windows explorer, it is opened in the main instance.
If IDE - Preferences - General - [ ] Run only one Instance
Then a 2nd instance of IDE starts and loads only the 1 file in the RunProgram().
From Preferences...
[OpenedFiles]
Count = 5
OpenedFile_1 = C:\try\f1.pb
OpenedFile_2 = C:\try\f2.pb
OpenedFile_3 = C:\try\f3.pb
OpenedFile_4 = C:\try\f4.pb
OpenedFile_5 = C:\try\f5.pb
Are there really a lot of variables to expose to navigate the tabs?
Once I have the correct handle to the active Scintilla, I could do a lot of stuff!
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Fri Feb 15, 2013 4:20 pm
by freak
Are you sure the executable you are running is the same one as the existing instance? If you have multiple PB installations, each has its own runonce check. (two IDE's from different directories can run in parallel).
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Fri Feb 15, 2013 4:45 pm
by skywalk
freak wrote:Are you sure the executable you are running is the same one as the existing instance?
Yes, I only have one PB version installed.
TaskBar - PureBasic - Properties - Shortcut - Target wrote:"C:\Program Files\PureBasic\PureBasic.exe"
Code: Select all
RunProgram("c:\program files\purebasic\purebasic.exe", "c:\try\try_mv_tab.pb /L 8","c:\try")
With IDE - Preferences - General - [±] Run only one Instance it always opens a 2nd instance of PB, but does actually go to the file and line stated in RunProgram().
I think this is a bug, Win7 x86.
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Fri Feb 15, 2013 5:16 pm
by freak
You are right. It is because you gave the path in all lowercase it was detected as different. I will fix that.
In the meantime, just use the PB_TOOL_IDE environment variable to read the filename of the IDE and it will work.
Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Fri Feb 15, 2013 5:25 pm
by skywalk
Cool that worked!
Need to verify other stuff now.

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB
Posted: Fri Feb 15, 2013 5:38 pm
by skywalk
Another weird behavior...
Initial Preference setting...
[OpenedFiles]
Count = 7
After manually changing a Preference setting...
[OpenedFiles]
Count = 0
After closing IDE...
[OpenedFiles]
Count = 7
Intentional or bug?