Announcement

Collapse
No announcement yet.

Tooltips in a console app?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tooltips in a console app?

    Is it possible to use tooltips in a console app?

    I am creating a console app with text-based "pseudo-controls" (i.e. screen hot-spots which, if clicked with a mouse, will generate a reaction from the program.) The hot-spots contain symbols (like arrow heads) that suggest their purpose, but there are also plain-text fields (containg purely alphabetic text), which are clickable and produce some reaction. Since they don't have the look-and-feel of a control, it would be nice if I could make a tooltip pop up whenever the mouse is over one of these fields. The tooltip would say something like "click here to ... ".

    FWIW, I have recently purchased (but have not yet used) both PBWin 9.01 and Perfect Sync's Console Tools Pro. The availability of the latter might be relevant to this question.

  • #2
    Mottel:

    Have you thought about developing your applications on a Graphic Window?. If you have PBCC5 you could create all those refinemets by yourself. Also, programming is almost the same as PBDOS graphic mode.

    Regards,

    Comment


    • #3
      >I have recently purchased (but have not yet used) both PBWin 9.01 ...

      It you want tooltips, now would be a really good time to start using this, because adding tooltips to controls on a GUI screen is a snap.
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        I will eventually produce a GUI version as well, however for this version I prefer a console app because execution speed is of the essence and I think a text screen can be updated many times in succession far more rapidly than a GUI screen. The application is a dual solar and lunar calendar displaying correlated month grids shown side-by-side in two different calendars, with matching dates highlighted. One of two possible solar calendars (Julian/Gregorian) is matched to one of two possible lunar calendars. This version is primarily aimed at allowing astronomy and calendar-study geeks to explore patterns of repetition and correlation over cycles of various lengths and long-term trends and stats covering a maximum period of 689,473 years -- hence the need for rapid navigation.

        This is one of several reasons why this version is staying text-based. I take it from the answers given so far that you can't add tooltips to a console app that uses text screen mode. The irony is that while tooltips in a GUI version might be a nice (and easy-to-implement) extra, they would serve a far more practical purpose in the console version of this app. My thinking was that the ability provided by Console Tools to add a GUI-style drop-down menu and other GUI elements to a console app might imply that there could be a way of extending this extra functionality to include tooltips.

        Comment


        • #5
          >however for this version I prefer a console app because execution speed is of the >essence ....

          Straw Man! Other than the screen I-O, it's the same code.

          Which brings us to...

          >and I think a text screen can be updated many times in succession far more rapidly than a GUI screen.

          I have found console screen updating slower than GUI updating. YMMV.

          But I have found BOTH can be updated far, far faster than any human can read.

          "Side by side calendar grids" is, for some reason, screaming "GUI! GUI! GUI!" at me.


          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Mottel:

            I had the same prejudice until I converted a PBCC Text Console to PBCC Graphic Window and realized that the late is far faster. Not surprise however, since Windows "text console" is not really text, but an emulation. The application is a grid like screen scrolling up and down, left and right. BTW, as this application do, you can built your own GUI.

            Regards,
            Attached Files

            Comment


            • #7
              Originally posted by Mottel Gutnick View Post
              [SIZE=3]Is it possible to use tooltips in a console app?/SIZE]
              the thread entitled "Tooltips on a console" in this forum may help.

              Comment


              • #8
                The example below, I copied parts from one of my old programs.

                It uses the window's api to display the screen, which is a faster method. Even though it looks kind of ugly, it should go ahead and display alright. I haven't found to many forums that would mess it up.

                Run the mouse cursor over the different buttons and it should display the tips.

                If you like Select/Case, use it instead.
                ------------------------



                Code:
                #COMPILE EXE
                
                #INCLUDE "C:\PBCC40\WINAPI\WIN32API.INC"
                
                 SUB PUTZ(Lside&, Rside&, Top&, Bottom&, scr$)
                    LOCAL lpReadRegion AS SMALL_RECT, sBuffer AS STRING
                    Length& = LEN(scr$)
                    FOR x& = 1 TO Length&
                      sBuffer = sBuffer + MID$(scr$, X&, 1)+ CHR$(32)
                    NEXT x&
                    lpReadRegion.xLeft = Lside& - 1
                    lpReadRegion.xRight = Rside& - 1
                    lpReadRegion.xTop = Top& - 1
                    lpReadRegion.xBottom = Bottom& - 1
                    WriteConsoleOutPut GetStdHandle(%STD_OUTPUT_HANDLE), BYVAL STRPTR(sBuffer), _
                    BYVAL MAKDWD((Rside&+1)-Lside&, (Bottom&+1)-Top&), BYVAL 0&, lpReadRegion
                    scr$ = ""
                 END SUB
                
                
                 SUB  EZGRID
                  LOCAL SCN AS STRING
                 SCN = "ڇććććććć¿€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "³‡PŽaŽrŽeŽnŽtŽ ³€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "ڇććććććć¿€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "³‡Button ³€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "ڇććććććć¿€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "³‡ Edit  ³€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "ڇććććććć¿€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "³‡ListBox³€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "ڇććććććć¿€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "³‡ Combo ³€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "ڇććććććć¿€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "³‡CheckBx³€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "ڇććććććć¿€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "³‡RButton³€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "ڇććććććć¿€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "³‡Static ³€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "ڇććććććć¿€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "³‡ Frame ³€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "ڇććććććć¿€ €ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ú€ €" _
                 + "³‡RichEd ³€ €ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ú€ù€ú€ú€ €" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€ € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € € €" _
                 + "                                                                                          " _
                 + "ڇććććć¿€Ú‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡Ä‡¿€Ú‡Ä‡Ä‡¿€" _
                 + "³‡LView³€³‡PBar³€³‡HTrack³€³‡VTrack³€³‡Rectangle³€³‡RRect³€³‡Oval³€³‡Menu³€³‡MŠsŠgŠBŠoŠxг€³‡P‹r‹e‹v‹i‹e‹w‹³€³‡C‹o‹d‹e‹V‹i‹e‹w‹³€³‡OŽK޳€" _
                 + "À‡Ä€Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ä€Ù€À‡Ä€Ä€Ù€"
                    PUTZ 1, 90, 1, 34, SCN
                END SUB
                
                
                
                
                 SUB GetKey ()
                        
                   DO
                
                      char$ = WAITKEY$
                
                      rrow&  = MOUSEY : ccol&  = MOUSEX           'Get mouse cursor location
                      SLEEP 10
                
                    IF ccol& < 10 AND rrow& < 30 THEN
                       COLOR 0, 7
                       LOCATE 31, 1
                       IF rrow& > 0 AND rrow& < 4 THEN                                    ' Parent
                            PRINT "Create a Parent or delete areas selected for controls. Right Click for colors or styles   "
                       ELSEIF rrow& > 6 AND rrow& < 10 THEN                                ' Edit
                            PRINT "Creates an EditBox to write or edit text. Right Click to change colors, Fonts and styles  "
                       ELSEIF rrow& > 3 AND rrow& < 7 THEN                                     ' buttons
                            PRINT "Buttons Menu. Click on 'Ex' in the Menu for different button styles, Bitmaps and fonts    "   ' button
                       ELSEIF rrow& >  9 AND rrow& < 13 THEN                                       ' Listbox
                            PRINT "ListBox with items. Right click on Button for Menu to change Colors, Fonts and Styles     "
                       ELSEIF rrow& > 12 AND rrow& < 16 THEN                                       ' Combobox
                            PRINT "Combination Box with Items. Right Click on Button to Change Fonts or Styles               "
                       ELSEIF rrow& > 15 AND rrow& < 19 THEN                                        ' Checkbox
                            PRINT "Checkboxes. Right Click to change to a button or to change fonts or styles                "
                       ELSEIF rrow& > 18 AND rrow& < 22 THEN                                       ' radiobutton
                            PRINT "Radio Button. Right Click to change to a button or to change Fonts and styles             "
                       ELSEIF rrow& > 21 AND rrow& < 25 THEN                                      '  Label
                            PRINT "Static controls adds Text on the Parent. Right Click for Bitmaps, Colors, Fonts           "
                       ELSEIF rrow& > 24 AND rrow& < 28 THEN
                            PRINT "Frame. Hit Enter in Editbox for no text in frame. Right Click to change styles            "
                       ELSEIF rrow& > 27 AND rrow& < 31 THEN
                            PRINT "RichEdit control - At this time it doesn't have an extended Menu                          "
                       END IF
                
                     
                    ELSEIF rrow& > 31 THEN                         ' bottom menu
                       LOCATE 31, 1 :COLOR 0, 7
                       IF  ccol& < 8 THEN                                           ' ListView
                           PRINT "ListView menu. In Menu, Click on different types. Right Click to change Colors and Fonts  "
                       ELSEIF ccol& > 7 AND ccol& < 14 THEN                                         'Progress bar
                           PRINT "Progress Bar.  Right Click to change Range and colors                                     "
                       ELSEIF ccol& > 13 AND ccol& < 22 THEN                                 'Horizontal track bar
                           PRINT "Horizontal TrackBar. Left Click for default or Right Click to change it's Range           "
                       ELSEIF ccol& > 21 AND ccol& < 30 THEN                                     'Vertical track
                           PRINT "Vertical TrackBar. Right Click on this Button to Change it's Range                        "
                       ELSEIF ccol& > 53 AND ccol& < 60 THEN                                        'make Menu
                           PRINT "Menu maker. After selecting top row of Parent Grid, click on Menu to create Dropdown Menus"
                       ELSEIF ccol& > 59 AND ccol& < 68 THEN                                        ' Make message box
                           PRINT "Message Boxes. Use its menus to create them. They work in GUI or Console  Window          "
                       ELSEIF ccol& > 29 AND ccol& < 41 THEN                                        ' Rectangle
                           PRINT "Rectangles. Right Click for Hatch and Pen colors, styles, penwidth, Gradient Fills, etc   "
                       ELSEIF ccol& > 40 AND ccol& < 48 THEN                                     ' Round Rectangle
                           PRINT "Round Rectangles. Same as Rectangles except has rounded corners                           "
                       ELSEIF ccol& > 47 AND ccol& < 54 THEN                                     ' circle/oval
                           PRINT "Ovals or Circle. Right Click to make same changes as Rectangles                           "
                       ELSEIF ccol& > 67 AND ccol& < 77 THEN                                      ' Preview
                           PRINT "PreView Displays a GUI of what is already completed, JaxGUI must be in the PBC Directory  "
                       ELSEIF ccol& > 76 AND ccol& < 87 THEN                                       ' Code view
                           PRINT "CodeView Displays program code with the IDE                                               "
                       ELSEIF ccol& > 86 THEN                                           ' Build ....  OK button
                           PRINT "Click OK when thru. Code will be in ClipBoard. Right Click for its Extended Menu          "
                           rrow& = 10: ccol& = 50
                       END IF
                      
                    END IF
                
                   LOOP
                
                  END SUB
                  
                  
                
                
                FUNCTION PBMAIN () AS LONG
                  
                   CONSOLE SCREEN 34, 90
                   MOUSE ON
                   MOUSE 7, DOWN, MOVE
                
                   CURSOR OFF
                
                   Ezgrid
                
                   GetKey
                   
                   WAITKEY$
                
                END FUNCTION

                Comment


                • #9
                  Here's another one I dug up. Stinking corpse or fragrant truffle? You decide.

                  This code, a slightly modified copy from the MSDN example, will display a tooltip for a rect, rather than for a control.

                  So if you can work out what the rect is for the "hot" area of your console application, this will associate a tooltip with it and it will work!
                  Code:
                  '---------------------------------------------------
                  sub CreateToolTipForRect(hwndParent as dword, r as rect, sTT as string)
                      local ti as TOOLINFO
                      local hWndTT, hinstance as dword
                      local s as string
                      
                      hinstance = getmodulehandle(byval 0)
                      '// Create a tooltip.
                      hwndTT = CreateWindowEx(%ws_ex_topmost, _
                          $TOOLTIPS_CLASS, byval 0, _
                          %ws_popup or %TTS_NOPREFIX or %TTS_ALWAYSTIP, _
                          %CW_USEDEFAULT, %CW_USEDEFAULT, _
                          %CW_USEDEFAULT, %CW_USEDEFAULT, _
                          hwndParent, byval 0, hInstance, byval 0)
                  
                      SetWindowPos(hwndTT, %HWND_TOPMOST, _
                          0, 0, 0, 0,                    _
                          %SWP_NOMOVE or %SWP_NOSIZE or %SWP_NOACTIVATE)
                  
                      '// Set up "tool" information.
                      '// In this case, the "tool" is the entire parent window.
                      ti.cbSize = sizeof(TOOLINFO)
                      ti.uFlags = %TTF_SUBCLASS
                      ti.hwnd = hwndParent
                      ti.hinst = hInstance
                      's = "This is your tooltip string."
                      ti.lpszText = strptr(sTT)
                      ti.rec = r 'GetClientRect (hwndParent, &ti.rect)
                  
                      '// Associate the tooltip with the "tool" window.
                      SendMessage(hwndTT, %TTM_ADDTOOL, 0, byval varptr(ti))
                  end sub

                  Comment


                  • #10
                    What do I do with it?

                    > Here's another one I dug up

                    Chris, does your sub require
                    Code:
                    #include "CommCtrl.inc"
                    And, does it use the sub Animate_Create, beginning at line 5371 in CommCtrl.inc?

                    I assume it needs that file because I initially got a bunch of "undeclared equate" errors when I added this sub to my program and compiled it. When I added that #INCLUDE, those errors disappeared, but the compiler (5.03.0112) still doesn't like it.

                    Something is wrong with lines 5371 to 5372 in CommCtrl.inc. Compile error reads:
                    Code:
                    Error 516 in ... COMMCTRL.INC(5371:009):  DefType, Type id (?%&!#$), or AS... required: CREATEWINDOW
                    Line 5371:         CreateWindow ("SysAnimate32", BYVAL %NULL, dwStyle, 0, 0, 0, 0, hWndP, _
                    I tried editing the offending line, adding "as asciiz", "as dword", etc, to the arguments, based on what I found in Win32API.inc at DECLARE FUNCTION CreateWindow. But no matter what I tried, I couldn't fix it. Eventually, I disabled lines 5371 and 5372 in CommCtrl.inc and it compiled without error. So, if it doesn't need that sub Animate_Create, it should be usable. Trouble is, now I don't know what to do with it. There is no visible effect in the console window.

                    I also changed this line:
                    Code:
                    's = "This is your tooltip string."
                    to this:
                    Code:
                    sTT = "This is your tooltip string."
                    How am I doing so far?

                    I assume some kind of call statement is needed to make it work. Could you provide an example of some calling code for it? Better still (if it's not asking too much), a working demo?

                    This is the program that I tried to add your subroutine to. A partial listing of it is here.

                    Comment


                    • #11
                      Code:
                      Error 516 in ... COMMCTRL.INC(5371:009):  DefType, Type id (?%&!#$), or AS... required: CREATEWINDOW
                      Line 5371:         CreateWindow ("SysAnimate32", BYVAL %NULL, dwStyle, 0, 0, 0, 0, hWndP,
                      ==>
                      Code:
                      #IF %DEF(%USEMACROS)
                          MACRO Animate_Create (hWndP, ID, dwStyle, hInstance)
                              CreateWindow "SysAnimate32", BYVAL %NULL, dwStyle, 0, 0, 0, 0, hWndP, _
                                 ID, hInstance, BYVAL %NULL
                          END MACRO
                      #ELSE
                          SUB Animate_Create (BYVAL hWndP AS DWORD, BYVAL ID AS DWORD, _
                             BYVAL dwStyle AS DWORD, BYVAL hInstance AS DWORD)
                              CreateWindow "SysAnimate32", BYVAL %NULL, dwStyle, 0, 0, 0, 0, hWndP, _
                                 ID, hInstance, BYVAL %NULL
                          END SUB
                      #ENDIF
                      You have a spurious left paren between "CreateWindow" and "Sysanimate32" .. possibly due to some weird use of a MACRO at the point of call, or possibly because your version of COMMCTRL.INC is corrupt.

                      My commctrl32.inc:
                      Code:
                      '  Last updated 26 August 2009
                      Code shown from my file lines 5363 to 5375.


                      OR.... Your Win32API.INC does not include CreateWindow, which I think you can have happen by setting one of those 'control equates' such as "%NOGDI"

                      FWIW, I wonder why 'CreateWindow' is being used instead of 'CreateWindowEx?' Maybe that particular setup hasn't been reviewed for content in a while?



                      MCM
                      Last edited by Michael Mattias; 2 Aug 2010, 07:09 AM.
                      Michael Mattias
                      Tal Systems (retired)
                      Port Washington WI USA
                      [email protected]
                      http://www.talsystems.com

                      Comment


                      • #12
                        Mottel,

                        you need COMMCTRL.INC - anything to do with tooltips needs this include.

                        Apart from that, it works for me exactly as posted!

                        sTT is a parameter to the sub, containing the string to be displayed at the "hot" rect when the mouse is over it. You should not assign a value to it inside the sub, because that will just give it a fixed value.

                        Sorry, I left the 's = "This is your tooltip string." in the code. I should have deleted it, not just commented it out.

                        Comment


                        • #13
                          It's not the L parenthesis

                          > You have a spurious left paren between "CreateWindow" and "Sysanimate32"

                          No, that's not the problem, Michael, just careless cutting & pasting on my part. I added a pair of parentheses at one point in my attempts to fix it, then later took them (both) out. I copied the error message from one of a dozen or so copied from the compiler IDE to the clipboard -- just unluckily chose that one to post the error message here, without noticing the misleading diagnostic.

                          I just checked the backup I made of the original CommCtrl.inc before I tried to fix it. Same vintage as the one you posted from, and the section you posted is identical to what I had.

                          But you did put me on the right track:
                          > OR.... Your Win32API.INC does not include CreateWindow ...

                          my Win32API.inc
                          > ' Last Update: 27 August 2009
                          (lines 48739 to 48744)
                          Code:
                          #IF %DEF(%CCWIN)
                              FUNCTION CreateWindow (lpClassName AS ASCIIZ, lpWindowName AS ASCIIZ, BYVAL dwStyle AS DWORD, BYVAL xx AS LONG, BYVAL yy AS LONG, BYVAL nWidth AS LONG, _
                                       BYVAL nHeight AS LONG, BYVAL hwndParent AS DWORD, BYVAL hMenu AS DWORD, BYVAL hInstance AS DWORD, BYVAL lpParam AS DWORD) AS LONG
                                  FUNCTION = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, xx, yy, nWidth, nHeight, hWndParent, hMenu, hInstance, BYVAL lpParam)
                              END FUNCTION
                          #ENDIF
                          So, I just now added to my MouseDemo program:
                          Code:
                          %CCWIN=1
                          #include "CommCtrl.inc"
                          ... and it now compiles OK with Chris's sub added, and using the factory copy of CommCtrl.inc.

                          The first line niggles at me a little though. It fixed the immediate problem, but I can't help wondering if it's not misleading the compiler and thereby creating the potential for other problems. I have a vague recollection that the compiler needs these control equates to identify which code it should be generating and I am compiling here for a console app. I hope it's not going to mess things up in other ways.

                          So, it compiles okay. Now I have to figure out how to use it ...

                          Comment


                          • #14
                            P.s.

                            > FWIW, I wonder why 'CreateWindow' is being used instead of 'CreateWindowEx'?

                            I think the code snippet I posted above from Win32API.inc answers that question as well, Michael. If I'm not mistaken, it seems to be doing exactly that, just using a different name for the calling function.

                            Comment


                            • #15
                              %CCWIN is used to specify whether the GUI parts of the Windows SDK should be declared. Since console programs don't generally involve GUI, the declares are bypassed by default for PB/CC. The equate is provided in case you wish to override this default.

                              Comment


                              • #16
                                Small refinements:
                                a) Ballon tip style
                                b)To avoid recreating the tooltip several times on the same rect, for example when tooltipping in response to a WM_MOUSEMOVE message, make the tooltip window handle global or static, then:

                                Code:
                                '---------------------------------------------------
                                sub CreateToolTipForRect(hwndParent as dword, r as rect, sTT as string)
                                    local ti as TOOLINFO
                                    local hinstance as dword
                                    local s as string
                                    static lastr as rect
                                
                                    if hWndTT then
                                        if r = lastr then
                                            exit sub       ' don't recreate TT on same rect
                                        end if
                                    end if
                                    lastr = r
                                    hinstance = getmodulehandle(byval 0)
                                    '// Create a tooltip.
                                    hwndTT = CreateWindowEx(%ws_ex_topmost, _
                                        $TOOLTIPS_CLASS, byval 0, _
                                        %ws_popup or %TTS_NOPREFIX or %TTS_ALWAYSTIP or %TTS_BALLOON, _
                                        %CW_USEDEFAULT, %CW_USEDEFAULT, _
                                        %CW_USEDEFAULT, %CW_USEDEFAULT, _
                                        hwndParent, byval 0, hInstance, byval 0)
                                
                                    SetWindowPos(hwndTT, %HWND_TOPMOST, _
                                        0, 0, 0, 0,                    _
                                        %SWP_NOMOVE or %SWP_NOSIZE or %SWP_NOACTIVATE)
                                
                                    '// Set up "tool" information.
                                    '// In this case, the "tool" is the entire parent window.
                                    ti.cbSize = sizeof(TOOLINFO)
                                    ti.uFlags = %TTF_SUBCLASS
                                    ti.hwnd = hwndParent
                                    ti.hinst = hInstance
                                    ti.lpszText = strptr(sTT)
                                    ti.rec = r 'GetClientRect (hwndParent, &ti.rect)
                                
                                    '// Associate the tooltip with the "tool" window.
                                    SendMessage(hwndTT, %TTM_ADDTOOL, 0, byval varptr(ti))
                                end sub

                                Comment


                                • #17
                                  >a) Ballon tip style

                                  Requires minimum Common Controls version 5.80.

                                  Should not 'really' be an issue, as this version has been available since at least 2002.

                                  But ya never knows....

                                  (I'm pretty sure there is code here somewhere (William Burns' tooltip code?) which queries the CC version and only adds TTS_BALLOON if a sufficient version is in use).
                                  Michael Mattias
                                  Tal Systems (retired)
                                  Port Washington WI USA
                                  [email protected]
                                  http://www.talsystems.com

                                  Comment

                                  Working...
                                  X