IDE-PlugIns. Better support.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

IDE-PlugIns. Better support.

Post by Hroudtwolf »

Hello Fred,

I have a little wish for any future IDEs...
Please, let send "PB_TOOL_Scintilla" enviromentvariable permanent after changing editortabs.
This would support more PlugIn-Ideas.

Thank you.

Best regards

Hroudtwolf
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Environment variables for the tools can only be set before the tool starts.
After that, both programs have separate environment blocks and the IDE
has no access to the variables of the tool anymore.
quidquid Latine dictum sit altum videtur
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Oh. Ok.
That, I didn't know.
But maybe, it is possible to create such PlugIn-support by another way !?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

I don't know about PB_TOOL_Scintilla ...
Are you looking for the active scintilla handle ?
This should work :

Code: Select all

Global PBIDEHandle.l, PBIDEScintillaHandle.l
;
Procedure FindPBIDEScintillaEnumWindowsCallBack(hwnd.l, lParam.l)
  ReturnValue.l = #TRUE
  If IsWindow_(hwnd)
    WindowText.s = Space(250)
    LenWindowText.l = 250
    GetClassName_(hwnd, @WindowText, LenWindowText)
    If WindowText = "Scintilla" And IsWindowVisible_(hwnd)
      PBIDEScintillaHandle = hwnd
      ReturnValue = #FALSE 
    EndIf
  EndIf
  ProcedureReturn ReturnValue
EndProcedure
;
Procedure FindPBIDEEnumWindowsCallBack(hwnd.l, lParam.l)
  ReturnValue.l = #TRUE
  If IsWindow_(hwnd)
    WindowText.s = Space(250)
    LenWindowText.l = 250
    GetWindowText_(hwnd, @WindowText, LenWindowText)
    If FindString(WindowText, "PureBasic", 1) And FindString(WindowText, "Debugger", 1) = #FALSE
      PBIDEScintillaHandle = 0
      EnumChildWindows_(hwnd, @FindPBIDEScintillaEnumWindowsCallBack(), 0)
      If PBIDEScintillaHandle
        ReturnValue = #FALSE 
        PBIDEHandle = hwnd
      EndIf
    EndIf
  EndIf
  ProcedureReturn ReturnValue
EndProcedure
;
Procedure.l GetPBIDEHandle()
  PBIDEHandle = 0
  EnumWindows_(@FindPBIDEEnumWindowsCallBack(), 0)
  ProcedureReturn PBIDEHandle
EndProcedure
;
Procedure.l GetPBIDEScintillaHandle()
  PBIDEScintillaHandle = 0
  If GetPBIDEHandle()
    EnumChildWindows_(PBIDEHandle, @FindPBIDEScintillaEnumWindowsCallBack(), 0)
  EndIf
  ProcedureReturn PBIDEScintillaHandle
EndProcedure

; get active scintilla editor handle
debug GetPBIDEScintillaHandle()
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Ah.
Nice one.

Thank you very much.
tomijan
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 1:32 pm

Post by tomijan »

@gnozal
Hi,
how it's possible to use this handle to call scilexer funtions?

thx
tom
Post Reply