[IDE] - Add Tool variable = PB_TOOL_IDETAB

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

[IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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. :idea:
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post by skywalk »

Oh, maybe I am requesting the wrong term?
Should I request a new environment variable = #PB_Tool_NumTabs?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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. :cry:
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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
quidquid Latine dictum sit altum videtur
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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!
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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).
quidquid Latine dictum sit altum videtur
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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.
quidquid Latine dictum sit altum videtur
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post by skywalk »

Cool that worked!
Need to verify other stuff now. :D
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE] - Add Tool variable = PB_TOOL_IDETAB

Post 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?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply