Search in .. / Display list all Captions and Tooltips

Started by Peter2, June 01, 2026, 05:02:11 AM

Previous topic - Next topic

Peter2

In many software products the settings are incredible long, and so there is often a "search in settings" functions. The same would be nice for my palette with is a little bit overloaded by buttons and functions.

I have a ..
- modeless palette
- with 5 tabs
- with each of them 15 buttons with caption and tooltips

Now I would like to create a list which consists of ..
"name of the tab - caption of button - Tooltip", like ..

"Drawing - Red line - Draw a red line on layer water"
"Drawing - Blue Line - Draw a blue line on layer street"
"Modify - Red2Blue - Changes all red-water-lines to blue-street-lines"

At the moment I'm fighting with all objects and functions, so I would like to ask if there is already an existing snippet?

Thanks in advance!
Peter
Peter
ODCL 9.1.... German, AutoCAD 2023, Bricscad 26, Win 11

Peter2

Here is my current code, which searches all entries for Caption and ToolTipTitle. If one of them exists, it concatenates it with the name of the control.

It does not..
- find and consider the type of the control
- know the name of the tab where the control is situated.

Improvements are welcomed!

    (setq project htp/palette)
   
    ; Caption und/oder TooltipTitle auflisten
    (foreach control (dcl-form-getcontrols project)
        (setq showflag nil)
        (setq props (dcl-Control-GetProperties control))
        (if (member "Caption" props)
            (progn
                (setq kurz (dcl-Control-GetProperty control "Caption"))
                (if (/= kurz "")
                    (setq showflag t)
                )
            )
            (progn
                (setq kurz "----")
            )
        )
        (if (member "ToolTipTitle" props)
            (progn
                (setq lang (dcl-Control-GetProperty control "ToolTipTitle"))
                (if (/= lang "")
                    (setq showflag t)
                )
            )
            (progn
                (setq lang "----")
            )
        )
        (if showflag
            (progn
                (setq name (dcl-Control-GetProperty control "(Name)"))
                ; Version A: princ
                (setq info (strcat "\n" kurz "\t" lang "\t" name))
                (princ info)
                ; Version B: Add data to datasheet
                (dcl-Grid-AddRow htp/palette/Datenblatt kurz lang name)
            )
        ) ; if
    ) ; foreach




---
Peter
ODCL 9.1.... German, AutoCAD 2023, Bricscad 26, Win 11