Menu

Plugin developing (DBGP)

2007-05-17
2012-11-14
  • Damjan Cvetko

    Damjan Cvetko - 2007-05-17

    Hello good people of Notepad++ q:)

    I love this editor, we are using it all the time.

    Long story short, I started developing a Plugin for remote debugging of PHP scripts. I use the DBGP protocol (XDebug). That debugger engine works mostly like I expect it (especially in the way to start and stop debugging). I also chose DBGP because there are engines (I believe) that are used for debugging Python, PERL etc...

    I started exploring the example code but got sick of it quite fast. C++ is not my language of choice for Win developing. I started developing in Delphi 6 and created o few classes that would help me. The debugger client is coming along OK (I love tracing line by line in N++), I even got docking working (sort of) and a few other things, but I'm stuck and could use some help.

    This are the things I'm interested in:
    I want to show markers for current code execution location. One thing is defining markers and setting them in the current scintilla, other is removing the previous one. For example I'm stepping in file1.php so the marker is in the active SCI. Then the next step is in file2.php. A new tab is opened but the old marker is not erased... Any suggestions on this one?

    Second it the docking of multiple windows. The debugger is a thing that needs lots of windows (stack, breakpoints, variables, watch...).. I think the best way to show them would be like most IDE's do. A docking space with lots of tabs... Is Notepad's docking system usable in this way? Could I create a window and use some other docking provider (I think the JVCL has one..)

    Setting breakpoints.. Currently I can only set a line breakpoint in the way that I put the cursor onto the desired line and pres a button in my form. I would love to be able to use the markers like most IDE's do. Two problems:
    - I think the only space for a marker is used by the bookmark marker and
    - again how do I get the positions of all markers in all open files... (I'm afraid that I'll need to list all files and do a DOOPEN on each on of them!!)
    - and if I saw right, N++ saves all markers and displays them as bookmark items at the next start.

    I intend to post the plugin as soon as it is stable enough..

    One more: Examples examples.. Are there more examples on plugin developing? I'm struggling with toolbar icons and other little things...

    Best regards,
    -Zobo

     
    • Nobody/Anonymous

      Hi Zobo,

      > This are the things I'm interested in:
      > I want to show markers for current code execution location. One thing is defining
      > markers and setting them in the current scintilla, other is removing the previous
      > one. For example I'm stepping in file1.php so the marker is in the active SCI.
      > Then the next step is in file2.php. A new tab is opened but the old marker is not erased...
      > Any suggestions on this one?

      With this functionset of scintilla you can define your own set of markers/bookmarkers/brakepoints...
      Please read carefully the Scintilla documentation.
      http://scintilla.sourceforge.net/ScintillaDoc.html#Markers

      > Second it the docking of multiple windows. The debugger is a thing that needs lots of windows
      > (stack, breakpoints, variables, watch...)..
      > I think the best way to show them would be like most IDE's do. A docking space with lots of tabs...
      > Is Notepad's docking system usable in this way? Could I create a window and use some other docking provider (I think the JVCL has one..)

      Yes it is possible. But you can do this in two ways:
      First way:
      Create your own dialog window, which handles your dockable windows. Register your window to notepad. Please look into other plugin sources codes or look into notepad's sourcecode. There is a plugin interface header file. It contains all possible messages to register dialogs to noteapad as dockable ones.
      Seond one:
      Register every window to Notepad and use docking of notepad. Ok, you have only top, buttom, left and right, but isn't enough?

      Plugins source codes you can find here:
      http://sourceforge.net/projects/npp-plugins/

      > Setting breakpoints...
      Same as Markers... and look into notepad plugins interfacing. So you can get the full list of files. If you want to have additional interface functions, please feel free and ask Don.

      A good toolbar icons libarary, we use it for Notepad++, is www.famfamfam.com.

      Best Regards
      Jens

       
      • Damjan Cvetko

        Damjan Cvetko - 2007-05-18

        HI back, Jens.

        Thank you for your answer.

        I have already explored the SCI documentation and experimented with it. My question was more regarding what Notepad++ does with markers (those in the range 1-31).. I guess I'll have to dig around the source some more and come back with a more concrete question.
        (Where does N++ store the location of bookmark marks?)

        Let me try to rephrase the other part of this question. If there are 5 open tabs, there must be 5 Csintilla controls. If this presumption is correct, how can I reach those CSI HWNDs without grabbing the list of open files and doing DOOPEN on all of them...
        I'm guessing, from your other answers, there is no other way.

        I did some experimenting with the docking, and figured out that it's best to create one window, let it dock with N++ and then use that window to dock other small windows.. Like you said..

        Thanks for the toolbar icons link.

        Should I post my questions in the notepad++ plugins SF project? I will also download other plugins and read some code..

        Thanks again.
        -Zobo

         
MongoDB Logo MongoDB