Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. calltips in scintilla

calltips in scintilla

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mirraa
    wrote on last edited by
    #1

    in my program i'm creating an scintilla based editor... i can display the calltips... but if anyone knows the logic of displaying the variables types in calltips such that... if i keep mouse on a variable 'i' which is an integer...,in calltip it should show "int i"... how to implement this?any help thanx n advance...

    R 1 Reply Last reply
    0
    • M mirraa

      in my program i'm creating an scintilla based editor... i can display the calltips... but if anyone knows the logic of displaying the variables types in calltips such that... if i keep mouse on a variable 'i' which is an integer...,in calltip it should show "int i"... how to implement this?any help thanx n advance...

      R Offline
      R Offline
      Russell
      wrote on last edited by
      #2

      Simple tooltip[^] Advanced Tooltip[^] To know how plot it you have to know what the mouse is pointing! To do this you can plot the text storing the border of any useful word displayed and test if the mouse position is on it (if yes then plot the tooltip). nother way is create a custom class that display a single word of the text, it can bes mouse sensitive and you can display its tooltip (if needed).


      Russell

      M 1 Reply Last reply
      0
      • R Russell

        Simple tooltip[^] Advanced Tooltip[^] To know how plot it you have to know what the mouse is pointing! To do this you can plot the text storing the border of any useful word displayed and test if the mouse position is on it (if yes then plot the tooltip). nother way is create a custom class that display a single word of the text, it can bes mouse sensitive and you can display its tooltip (if needed).


        Russell

        M Offline
        M Offline
        mirraa
        wrote on last edited by
        #3

        i didn't understand clearly the meaning of "plot the text storing the border of any useful word "...that is how to store the border of text...first how 'll get the text over which the mouse is pointing... since i'm totally confused cud u explain me somewhat eloborately if possible with an example code of 4 or 5 lines.... thanx 4 ur reply...

        R 1 Reply Last reply
        0
        • M mirraa

          i didn't understand clearly the meaning of "plot the text storing the border of any useful word "...that is how to store the border of text...first how 'll get the text over which the mouse is pointing... since i'm totally confused cud u explain me somewhat eloborately if possible with an example code of 4 or 5 lines.... thanx 4 ur reply...

          R Offline
          R Offline
          Russell
          wrote on last edited by
          #4

          When you draw the text on your DC you can use CDC::GetTextExtent(...) /CDC::GetOutputTextExtent(...) to know the size of the label [heigh and width]. :-D Of course, to do this you have to draw yourself the text on the screen, so you have to create a derived class of CView. In this way it will be very simple also to color the words with different colors: I think that this can be useful to your project.:rolleyes:


          Russell

          R M 2 Replies Last reply
          0
          • R Russell

            When you draw the text on your DC you can use CDC::GetTextExtent(...) /CDC::GetOutputTextExtent(...) to know the size of the label [heigh and width]. :-D Of course, to do this you have to draw yourself the text on the screen, so you have to create a derived class of CView. In this way it will be very simple also to color the words with different colors: I think that this can be useful to your project.:rolleyes:


            Russell

            R Offline
            R Offline
            Russell
            wrote on last edited by
            #5

            _Russell_ wrote:

            color the words with different colors

            Probally 2 useful articles: http://www.codeproject.com/editctrl/crysedit.asp[^] http://www.codeproject.com/editctrl/scintillawnd.asp[^] :)


            Russell

            1 Reply Last reply
            0
            • R Russell

              When you draw the text on your DC you can use CDC::GetTextExtent(...) /CDC::GetOutputTextExtent(...) to know the size of the label [heigh and width]. :-D Of course, to do this you have to draw yourself the text on the screen, so you have to create a derived class of CView. In this way it will be very simple also to color the words with different colors: I think that this can be useful to your project.:rolleyes:


              Russell

              M Offline
              M Offline
              mirraa
              wrote on last edited by
              #6

              i think i didn't explain u my problem in a correct way... the 2 functions u have given returns the height and width of the string... but my question is how will i get the string over which mouse is thr... that is if u keep the mouse over a variable name "var name" which is of integer type my tooltip should show "int var name".:(( i think i've explained u clearly now... thanx 4 ur reply ...:laugh:

              R 1 Reply Last reply
              0
              • M mirraa

                i think i didn't explain u my problem in a correct way... the 2 functions u have given returns the height and width of the string... but my question is how will i get the string over which mouse is thr... that is if u keep the mouse over a variable name "var name" which is of integer type my tooltip should show "int var name".:(( i think i've explained u clearly now... thanx 4 ur reply ...:laugh:

                R Offline
                R Offline
                Russell
                wrote on last edited by
                #7

                :doh: I think that I understand your ploblem. 1) Plot the data storing somewhere (in a member of the Plot-class) the position and size of the single words 2) Get the mouse position and then, if it is inside one of the region that you store at the step 1, create the tooltip and display addictional information. To know the mouse position (x,y) use CWnd::OnMouseMove(UINT nFlags, CPoint **point**); Is it enough clear?:confused: Do you need other information about something?:)


                Russell

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups