Page 1 of 1

IDE-PlugIns. Better support.

Posted: Sat Feb 25, 2006 11:14 am
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

Posted: Sat Feb 25, 2006 2:53 pm
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.

Posted: Sat Feb 25, 2006 5:22 pm
by Hroudtwolf
Oh. Ok.
That, I didn't know.
But maybe, it is possible to create such PlugIn-support by another way !?

Posted: Sat Feb 25, 2006 5:30 pm
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()

Posted: Sat Feb 25, 2006 6:03 pm
by Hroudtwolf
Ah.
Nice one.

Thank you very much.

Posted: Fri Mar 10, 2006 7:17 pm
by tomijan
@gnozal
Hi,
how it's possible to use this handle to call scilexer funtions?

thx
tom